Skip to content
Get started

Get last device swap date

POST/deviceswap/retrieve-date

Get timestamp of last device swap for a mobile user account provided with phone number.

Header ParametersExpand Collapse
"x-correlator": optional string
Body ParametersJSONExpand Collapse
phoneNumber: optional string

A public identifier addressing a telephone subscription. In mobile networks it corresponds to the MSISDN (Mobile Station International Subscriber Directory Number). In order to be globally unique it has to be formatted in international format, according to E.164 standard, prefixed with ’+’.

ReturnsExpand Collapse
latestDeviceChange: string

Timestamp of latest device swap performed. It must follow RFC 3339 and must have time zone.

formatdate-time
monitoredPeriod: optional number

Timeframe in days for device change supervision for the phone number. It could be valued in the response if the latest Device swap occurred before this monitored period.

Get last device swap date

curl https://api.example.com/camara/deviceswap/retrieve-date \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $CAMARA_BEARER_TOKEN" \
    -d '{
          "phoneNumber": "+34666111333"
        }'
{
  "latestDeviceChange": "2024-09-18T07:37:53.471829447Z"
}
{
  "latestDeviceChange": null,
  "monitoredPeriod": 120
}
{
  "latestDeviceChange": null
}
{
  "status": 400,
  "code": "INVALID_ARGUMENT",
  "message": "Client specified an invalid argument, request body or query param."
}
{
  "status": 401,
  "code": "UNAUTHENTICATED",
  "message": "Request not authenticated due to missing, invalid, or expired credentials."
}
{
  "status": 403,
  "code": "PERMISSION_DENIED",
  "message": "Client does not have sufficient permissions to perform this action."
}
{
  "status": 404,
  "code": "NOT_FOUND",
  "message": "The specified resource is not found."
}
{
  "status": 404,
  "code": "IDENTIFIER_NOT_FOUND",
  "message": "Device identifier not found."
}
{
  "status": 422,
  "code": "SERVICE_NOT_APPLICABLE",
  "message": "The service is not available for the provided identifier."
}
{
  "status": 422,
  "code": "MISSING_IDENTIFIER",
  "message": "The device cannot be identified."
}
{
  "status": 422,
  "code": "UNNECESSARY_IDENTIFIER",
  "message": "The device is already identified by the access token."
}
Returns Examples
{
  "latestDeviceChange": "2024-09-18T07:37:53.471829447Z"
}
{
  "latestDeviceChange": null,
  "monitoredPeriod": 120
}
{
  "latestDeviceChange": null
}
{
  "status": 400,
  "code": "INVALID_ARGUMENT",
  "message": "Client specified an invalid argument, request body or query param."
}
{
  "status": 401,
  "code": "UNAUTHENTICATED",
  "message": "Request not authenticated due to missing, invalid, or expired credentials."
}
{
  "status": 403,
  "code": "PERMISSION_DENIED",
  "message": "Client does not have sufficient permissions to perform this action."
}
{
  "status": 404,
  "code": "NOT_FOUND",
  "message": "The specified resource is not found."
}
{
  "status": 404,
  "code": "IDENTIFIER_NOT_FOUND",
  "message": "Device identifier not found."
}
{
  "status": 422,
  "code": "SERVICE_NOT_APPLICABLE",
  "message": "The service is not available for the provided identifier."
}
{
  "status": 422,
  "code": "MISSING_IDENTIFIER",
  "message": "The device cannot be identified."
}
{
  "status": 422,
  "code": "UNNECESSARY_IDENTIFIER",
  "message": "The device is already identified by the access token."
}