Device Status API
Device Status (0.5.1)
Download OpenAPI specification:Download
This API provides the customer with the ability to query device:
- Roaming Status
- Connectivity Status
Moreover, this API extends the functionality by allowing users customers to subscribe to events associated with these status queries.
API consumer is able to verify whether a certain user device is in roaming situation (or not). This capability is provided in 2 ways:
- via direct request with the roaming situation in the response.
- via a subscription request - in this case the roaming situation is not in the response but event notification is sent back to the event subscriber when roaming situation has changed.
The verification of the roaming situation depends on the network's ability. Additionally to the roaming status, when the device is in roaming situation, visited country information could be returned in the response.
API consumer is able to verify whether a certain user device is connected to the network via data- or sms-usage. This capability is provided in 2 ways:
- via direct request with the connectivity situation in the response.
- via a subscription request - in this case the connectivity situation is not in the response but event notification is sent back to the event subscriber when connectivity situation has changed.
Device status verification could be useful in scenario such as (not exhaustive):
- For regulatory reasons, where a customer may need to be within a certain jurisdiction, or out with others, in order for transactions to be authorized
- For security / fraud reasons, to establish that a customer is located where they claim to be
- For service delivery reasons, to ensure that the customer has access to particular service, and will not incur roaming charges in accessing them
Device: A device refers to any physical entity that can connect to a network and participate in network communication. At least one identifier for the device (user equipment) out of four options: IPv4 address, IPv6 address, Phone number, or Network Access Identifier assigned by the mobile network operator for the device.
Roaming : Roaming status -
true, if device is in roaming situation -falseelse.Country : Country code and name - visited country information, provided if the device is in roaming situation.
Connectivity : Connectivity status.
CONNECTED_SMS, if device is connected to the network via SMS usageCONNECTED_DATA, if device is connected to the network via data usageNOT_CONNECTED, if device is not connected to the network
The endpoint POST /roaming allows to get roaming status and country information (if device in roaming situation) synchronously.
The endpoint POST /connectivity allows to get current connectivity status information synchronously.
These endpoints allow to manage event subscription on roaming device status event. The CAMARA subscription model is detailed in the CAMARA API design guideline document and follows CloudEvents specification.
It is mandatory in the subscription to provide the event type subscribed are several are managed in this API.
Following event type are managed for this API:
org.camaraproject.device-status.v0.roaming-status- Event triggered when the device switch from roaming ON to roaming OFF and converselyorg.camaraproject.device-status.v0.roaming-on- Event triggered when the device switch from roaming OFF to roaming ONorg.camaraproject.device-status.v0.roaming-off: Event triggered when the device switch from roaming ON to roaming OFForg.camaraproject.device-status.v0.roaming-change-country: Event triggered when the device in roaming change country codeorg.camaraproject.device-status.v0.connectivity-data: Event triggered when the device is connected to the network for Data usage.org.camaraproject.device-status.v0.connectivity-sms: Event triggered when the device is connected to the network for SMS usageorg.camaraproject.device-status.v0.connectivity-disconnected: Event triggered when the device is not connected.
Note: Additionally to these list, org.camaraproject.device-status.v0.subscription-ends notification type is sent when the subscription ends.
This notification does not require dedicated subscription.
It is used when the subscription expire time (optionally set by the requester) has been reached or if the API server has to stop sending notification prematurely.
Notifications callback
The notifications callback describes the format of event notifications and expected responses to the messages sent when the event occurs. As for subscription, detailed description of the event notification is provided in the CAMARA API design guideline document.
WARNING: This callback endpoint must be exposed and reachable on the listener side under 'notificationUrldefined in thewebhook` attribute.
Get the current connectivity status information
Get the current connectivity status information
Authorizations:
Request Body schema: application/jsonrequired
required | object (Device) non-empty End-user equipment able to connect to a mobile network. Examples of devices include smartphones or IoT sensors/actuators. The developer can choose to provide the below specified device identifiers:
NOTE: the MNO might support only a subset of these options. The API invoker can provide multiple identifiers to be compatible across different MNOs. In this case the identifiers MUST belong to the same device. | ||||||||
| |||||||||
Responses
Request samples
- Payload
{- "device": {
- "phoneNumber": "123456789",
- "networkAccessIdentifier": "123456789@domain.com",
- "ipv4Address": {
- "publicAddress": "84.125.93.10",
- "publicPort": 59765
}, - "ipv6Address": "2001:db8:85a3:8d3:1319:8a2e:370:7344"
}
}Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "connectivityStatus": "CONNECTED_SMS"
}Operation to get device roaming status and country information (if roaming) synchronously
Get the current roaming status and the country information
Get the current roaming status and the country information
Authorizations:
Request Body schema: application/jsonrequired
required | object (Device) non-empty End-user equipment able to connect to a mobile network. Examples of devices include smartphones or IoT sensors/actuators. The developer can choose to provide the below specified device identifiers:
NOTE: the MNO might support only a subset of these options. The API invoker can provide multiple identifiers to be compatible across different MNOs. In this case the identifiers MUST belong to the same device. | ||||||||
| |||||||||
Responses
Request samples
- Payload
{- "device": {
- "phoneNumber": "123456789",
- "networkAccessIdentifier": "123456789@domain.com",
- "ipv4Address": {
- "publicAddress": "84.125.93.10",
- "publicPort": 59765
}, - "ipv6Address": "2001:db8:85a3:8d3:1319:8a2e:370:7344"
}
}Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "roaming": true,
- "countryCode": 901,
- "countryName": [ ]
}Operation to manage event subscription on device status event (roaming, connectivity)
Create a device status event subscription for a device
Create a device status event subscription for a device
Authorizations:
Request Body schema: application/jsonrequired
required | object (SubscriptionDetail) The detail of the requested event subscription |
| subscriptionExpireTime | string <date-time> The subscription expiration time in date-time format. |
required | object (Webhook) Webhook information for event channel |
Responses
Callbacks
Request samples
- Payload
{- "subscriptionDetail": {
- "device": {
- "phoneNumber": "123456789",
- "networkAccessIdentifier": "123456789@domain.com",
- "ipv4Address": {
- "publicAddress": "84.125.93.10",
- "publicPort": 59765
}, - "ipv6Address": "2001:db8:85a3:8d3:1319:8a2e:370:7344"
}, - "type": "org.camaraproject.device-status.v0.roaming-status"
}, - "subscriptionExpireTime": "2023-01-17T13:18:23.682Z",
- "webhook": {
- "notificationAuthToken": "c8974e592c2fa383d4a3960714"
}
}Response samples
- 201
- 202
- 400
- 401
- 403
- 409
- 500
- 503
{- "subscriptionDetail": {
- "device": {
- "phoneNumber": "123456789",
- "networkAccessIdentifier": "123456789@domain.com",
- "ipv4Address": {
- "publicAddress": "84.125.93.10",
- "publicPort": 59765
}, - "ipv6Address": "2001:db8:85a3:8d3:1319:8a2e:370:7344"
}, - "type": "org.camaraproject.device-status.v0.roaming-status"
}, - "subscriptionExpireTime": "2023-01-17T13:18:23.682Z",
- "webhook": {
- "notificationAuthToken": "c8974e592c2fa383d4a3960714"
}, - "subscriptionId": "qs15-h556-rt89-1298",
- "startsAt": "2019-08-24T14:15:22Z",
- "expiresAt": "2019-08-24T14:15:22Z"
}Callback payload samples
{- "id": "123654",
- "type": "org.camaraproject.device-status.v0.roaming-status",
- "specversion": "1.0",
- "datacontenttype": "application/json",
- "data": {
- "device": {
- "phoneNumber": 123456789
}, - "roaming": true,
- "countryCode": 208,
- "countryName": "FR",
- "subscriptionId": "qs15-h556-rt89-1298"
}, - "time": "2023-01-17T13:18:23.682Z"
}Retrieve a list of device status event subscription
Retrieve a list of device status event subscription(s)
Authorizations:
Responses
Response samples
- 200
- 400
- 401
- 403
- 500
- 503
[- {
- "subscriptionDetail": {
- "device": {
- "phoneNumber": "123456789",
- "networkAccessIdentifier": "123456789@domain.com",
- "ipv4Address": {
- "publicAddress": "84.125.93.10",
- "publicPort": 59765
}, - "ipv6Address": "2001:db8:85a3:8d3:1319:8a2e:370:7344"
}, - "type": "org.camaraproject.device-status.v0.roaming-status"
}, - "subscriptionExpireTime": "2023-01-17T13:18:23.682Z",
- "webhook": {
- "notificationAuthToken": "c8974e592c2fa383d4a3960714"
}, - "subscriptionId": "qs15-h556-rt89-1298",
- "startsAt": "2019-08-24T14:15:22Z",
- "expiresAt": "2019-08-24T14:15:22Z"
}
]Retrieve a device status event subscription for a device
retrieve event subscription information for a given subscription.
Authorizations:
path Parameters
| subscriptionId required | string Subscription identifier that was obtained from the create subscription operation |
Responses
Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "subscriptionDetail": {
- "device": {
- "phoneNumber": "123456789",
- "networkAccessIdentifier": "123456789@domain.com",
- "ipv4Address": {
- "publicAddress": "84.125.93.10",
- "publicPort": 59765
}, - "ipv6Address": "2001:db8:85a3:8d3:1319:8a2e:370:7344"
}, - "type": "org.camaraproject.device-status.v0.roaming-status"
}, - "subscriptionExpireTime": "2023-01-17T13:18:23.682Z",
- "webhook": {
- "notificationAuthToken": "c8974e592c2fa383d4a3960714"
}, - "subscriptionId": "qs15-h556-rt89-1298",
- "startsAt": "2019-08-24T14:15:22Z",
- "expiresAt": "2019-08-24T14:15:22Z"
}Delete a device status event subscription for a device
delete a given event subscription.
Authorizations:
path Parameters
| subscriptionId required | string Subscription identifier that was obtained from the create event subscription operation |
Responses
Response samples
- 202
- 400
- 401
- 403
- 404
- 500
- 503
{- "subscriptionId": "qs15-h556-rt89-1298"
}