This section provides additional information on using the Simple Edge Discovery API.
Getting an access token
You need a valid OAuth2 access token in order to use this API.
If the request is valid, the API returns an access_token. That can be used for multiple requests for its duration (59 minutes and 59 seconds).
An invalid request returns an error message.
For more information on using Authorization Basic, see RFC 6749.
Using the Sandbox
IP address for the Sandbox environment
You need to know the IP address of the server instance, because this information is not part of the API response. We have provided this IP address for you to use in the sandbox environment:
84.125.93.10
MSISDN for the Sandbox environment
441234567890
Network Access Identifier for the Sandbox environment
Endpoint request example
There is a single endpoint:
- /mecplatforms?filter=closest
The API returns the closest Edge Computing platform to a given device, so that device needs to be identifiable by the network.
Calling The API From A Server
If you call the API from a server, you must explicitly pass one or more device identifiers in the HTTP request header:
- IP-Address
- This is the public IP address of the user device: this can be obtained by an application hosted on that device calling a public IP address API.
- For example: GET https://api.ipify.org?format=json
- Phone-Number
- The international E.164 format (starting with country code)
- The number can be optionally prefixed with a '+'
- For example: +4407123123456
- Network-Access-Identifier
- Where available from the API host operator
If you call the API from a device attached to the operator network, you can omit the explicit device identifier(s) from the request header.
If this request fails with a `404 Not Found` error, include a device identifier and retry the request.
Examples for all API clients:
GET /mec-platforms?filter=closest HTTP/1.1
Host: example.com
Accept: application/json
Network-Access-Identifier: 4d596ac1-7822-4927-a3c5-d72e1f922c94@domain.com
GET /mec-platforms?filter=closest HTTP/1.1
Host: example.com
Accept: application/json
IP-Address: 84.125.93.10
GET /mec-platforms?filter=closest HTTP/1.1
Host: example.com
Accept: application/json
Phone-Number: 441234567890
Calling The API From Network-Attached Device
Example where API client is on a network-attached device:
GET /mec-platforms?filter=closest HTTP/1.1
Host: example.com
Accept: application/json
Endpoint response example
Below is an example response:
"MecPlatforms": [
{
"Provider": "AWS",
"Ern": "eu-west-2-wl1-man-wlz-1"
}
]
In this example, a JSON object is returned. It contains:
- A `MECPlatforms` array with a single member, along with the HTTP `200 OK` status code.
- The value of the `Provider` object. This is the name of the operator or cloud provider of the Edge Computing platform.
- `Ern` (Edge Resource Name) object. This is the name of the closest Edge Computing platform to the user device.
Note: The API publisher (i.e. the operator implementation) must ensure that the tuple of Provider+Ern in the success response is unique.