Page tree

Service Discovery refers to the process of finding a suitable service for a given task.

Request

To discover the service, an App must make a request to the Service using the Accept: application/xrds+xml header as in the example below:

HTTP Request
GET /uapi/
HOST <HostName>
Authorization: Bearer <token>
Content-Type: application/json
Content-Length: xxx
Accept: application/xrds+xml

Response

The Service returns the following response, which contains the address to the XRDS document:

HTTP Response
HTTP/1.1 204
Content-Type: application/json; charset=UTF-8
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 no-cache, must-revalidate
...
X-XRDS-Location: <hostname>/uapi/unfiedapi.xrds

The document located at <hostname>/uapi/unfiedapi.xrds has the following structure:

Discovery Document
<XRDS xmlns="xri://$xrds">
    <XRD xmlns:simple="http://xrds-simple.net/core/1.0" xmlns="xri://$XRD*($v*2.0)" version="2.0">
        <Type>xri://$xrds*simple</Type>
        <Service>
            <Type>https://<hostname>/uapi/phoneCalls</Type>
            <Uri>https://<hostname>/uapi/phoneCalls/{userId}/{extensionNumber}/{phoneCallId}/</Uri>
        </Service>
        <Service>
            <Type>https://<hostname>/uapi/extensions</Type>
            <Uri>https://<hostname>/uapi/extensions/{userId}/{extensionNumber}/presence/</Uri>
        </Service>
        <Service>
            <Type>https://<hostname>/uapi/extensions</Type>
            <Uri>https://<hostname>/uapi/extensions/{userId}/{extensionNumber}/queue/agents/{agentId}/</Uri>
        </Service>
        <Service>
            <Type>https://<hostname>/uapi/extensions</Type>
            <Uri>https://<hostname>/uapi/extensions/{userId}/{extensionNumber}/phoneCallEvents/{eventId}/</Uri>
        </Service>
        <Service>
            <Type>https://<hostname>/uapi/cdr</Type>
            <Uri>https://<hostname>/uapi/cdr/</Uri>
        </Service>
        <Service>
            <Type>https://<hostname>/uapi/faxes</Type>
            <Uri>https://<hostname>/uapi/faxes/{extensionNumber}/</Uri>
        </Service>
        <Service>
            <Type>https:///<hostname>/uapi/cache/invalidate</Type>
            <Uri>https://<hostname>/uapi/cache/invalidate</Uri>
        </Service>
    </XRD>
</XRDS> 

#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))

Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.