Getting started
Disclaimer (sandboxed version)
This CAMARA Sandbox - Device Location Retrieval - Orange lab API is a sandboxed version of the production-grade CAMARA - Device Location Retrieval API.
It is running in our lab, against a small list of lab-specific mobile devices (see list of phone number available for test below).
This API could be suspended or upgraded any time without any notice.
Introduction
The CAMARA Device Location Retrieval API provides a standardized mechanism for retrieving mobile equipment geographic location. API customers are able to retrieve the location of a specified user device. It can provide the location according to different area types. As of now only CIRCLE representation is provided.
For "CIRCLE" area type, the center of the circle (latitude and longitude) as well as the accuracy radius will be provided in the response.
Subscribe to the API
You get the Authorization header credentials when you register your application on the [Orange Developer Console] (https://developer.orange.com/myapps).
API Authentication
Note: In production environment the Device Location Retrieval API will require a 3-Legged OAuth 2.0 flow but as this implementation is provided on Orange Lab, the API works with a 2-Legged OAuth (OAuth 2 with client credentials).
To learn more about how Orange Developer handles authentication, please refer to our documentation.
In short, you will use your Orange Developer Authorization header as authorization_header for the Basic authentication with Orange Developer.
curl -X POST \
-H "Authorization: {{ authorization_header }}" \
-d "grant_type=client_credentials" \
https://api.orange.com/oauth/v3/token
In response, you will get an access_token
.
{
"token_type": "Bearer",
"access_token": "66AeYJF8eJQ...2SjkFg9LB1LePC",
"expires_in": "3600"
}
API Description
Summary of resources
This API has one resource retrieve. RetrievalResult attribute provides in the response information about mobile equipment location check.
Summary of methods and URL
Use case of operation | URL method |
---|---|
I want to retrieve the location of a device from a MSISDN number, an external identifier or an IP (+port) | POST "https://api.orange.com/camara/location-retrieval/orange-lab/v0/retrieve" |
Summary of request body parameters
Name | Description | Type | Mandatory |
---|---|---|---|
device | An object with four fields, each of them make possible to pass ueId in different format: networkAccessIdentifier, phoneNumber, ipv4Address and ipv6Address | See below information on device | Yes |
maxAge | Maximum age of the location information which is accepted for the location retrieval (in seconds). | integer | No |
Note on maxAge:
- Absence of maxAge means "any age" is acceptable for the client. In other words, this is like maxAge=infinite. The system still return lastLocationTime in the response. If the system is not able to provide location a error 404 with code LOCATION_RETRIEVAL.DEVICE_NOT_FOUND is send back.
- maxAge=0 means a fresh calculation is requested by the client. If the system is not able to provide fresh location an error 422 with code LOCATION_RETRIEVAL.UNABLE_TO_FULFILL_MAX_AGE is send back.
Following table provide details about device:
Name | Type | Format |
---|---|---|
networkAccessIdentifier | string | External Identifier format which has the format of username@realm |
phoneNumber | string | Subscriber number in E.164 format (starting with country code). Mandatory prefixed with '+' |
ipv4Address | string | IPv4 address may be specified in form <address/mask>. If address we expect an IPv4 number in dotted-quad form 1.2.3.4. Only this exact IP number will match the flow control rule. If address/mask - an IP number as above with a mask width of the form 1.2.3.4/24. |
ipv6Address | string | IPv6 address, following IETF 5952 format, may be specified in form <address/mask>. If address, the /128 subnet is optional for single address (2001:db8:85a3:8d3:1319:8a2e:370:7344 or 2001:db8:85a3:8d3:1319:8a2e:370:7344/128). If address/mask, an IP v6 number with a mask (2001:db8:85a3:8d3::0/64 or 2001:db8:85a3:8d3::/64 ) |
Lab implementation specific:
Only requests using phoneNumber
are operational.
Following phone number must be used (other will not work):
Phone Number |
---|
33699901031 |
33699901032 |
33699901033 |
33699901034 |
33699901035 |
33699901036 |
33699901037 |
33699901038 |
33699901039 |
33699901040 |
Example of body query
{
"device": {
"phoneNumber": "+33699901032"
},
"maxAge": 60
}
Summary of response parameters
Location
Name | Type | Format | Mandatory |
---|---|---|---|
lastLocationTime | defines the last location where the device was localized. It must follow RFC 3339 and must have time zone. Recommended format is yyyy-MM-dd'T'HH:mm:ss.SSSZ (i.e. which allows 2023-07-03T14:27:08.312+02:00 or 2023-07-03T12:27:08.312Z) | string | yes |
area | Defines a location area | object | yes |
Location area
Name | Type | Format | Mandatory |
---|---|---|---|
areaType | defines the type of the area that is described in the response | string | yes |
areaObj | Defines an object of the areaType | object | yes |
AreaType string
Name | Type | Format |
---|---|---|
CIRCLE | Defines a circle by its center point and its radius | string |
Area object
Circle
Name | Type | Format | Mandatory |
---|---|---|---|
center | Circle center as a Point object | object | Yes |
radius | Radius of the circle (in meters). | number | Yes |
Point
Name | Type | Format | Mandatory |
---|---|---|---|
latitude | Latitude component of location. Must between -90 and 90. | number | Yes |
longitude | Longitude component of location. Must be between -180 and 180. | number | Yes |
Retrieve mobile equipement location (from msisdn)
Request
curl -X POST "https://api.orange.com/camara/location-retrieval/orange-lab/v0/retrieve"
-H "Authorization: Bearer {your access token}"
-H "Cache-Control: no-cache"
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d {
"device": {
"phoneNumber": "+33699901032"
},
"maxAge": 60
}
Response
200 Location retrieval successful
Content-Type: application/json
{
"lastLocationTime": "2023-01-17T13:18:23.682Z",
"area": {
"areaType": "CIRCLE",
"center": {
"latitude": 50.735851,
"longitude": 7.10066
},
"radius": 2000
}
}
Fields description
The response features "area" and "lastLocationTime" attributes with the location area where the device was located.
Note:
- If the network is not able to localize the equipment, error code 404 is sent.
- If the service is not up and running, error code 503 is sent
- if the maxAge threshold cannot be satisfied, error code 400 is sent.
Most frequent errors
If invalid input are provided in particular for the device identifier a 400 error is triggered.
HTTP/1.1 400 Invalid input
Content-Type: application/json
{
"code": "INVALID_ARGUMENT",
"status": 400,
"message": "Invalid input"
}
If the network back end is not able to localize the equipment, a 404 error is sent.
HTTP/1.1 404 Not Found
Content-Type: application/json
{
"status": 404,
"code": "NOT_FOUND",
"message": "Unknown Location"
}
If the localisation service is not up and running, a 503 error is sent.
HTTP/1.1 503 Service unavailable
Content-Type: application/json
{
"code": "UNAVAILABLE",
"status": 503,
"message": "Service unavailable"
}
There are some cases where your client application will no longer gain access to API resources, and get an error back.
Please check the following points:
- Here, you attempt to use an expired or revoked access_token and you get an invalid token error. You will have to request a new access_token. As an example:
HTTP/1.1 401 Unauthorized
Content-Type: application/json
{
"code": "UNAUTHENTICATED",
"status": 401,
"message": "Authorization failed: ..."
}
- Here, you removed your subscription to the API so that the capability to generate an access_token is not allowed anymore. As an example:
HTTP/1.1 403 Forbidden
Content-Type: application/json
{
"code": "PERMISSION_DENIED",
"status": 403,
"message": "Operation not allowed: ..."
}
Looking for support ?
Facing technical issue when using this API ? please contact us
History of document
Version of the document | modification date | description of modifications |
---|---|---|
1.0 | 27/11/2023 | initialization by Orange CAMARA APIs team |
1.1 | 15/12/2023 | Added unit for radius |
1.2 | 05/01/2024 | Change case from 'Circle' to 'CIRCLE' |
1.3 | 07/06/2024 | Slight change on maxAge management |
1.4 | 20/08/2024 | Indicate that the prefix '+' is mandatory for the phoneNumber |
Go up |