Check last device swap date
client.deviceswap.check(DeviceswapCheckParams { maxAge, phoneNumber, xCorrelator } params, RequestOptionsoptions?): DeviceswapCheckResponse { swapped }
POST/deviceswap/check
Check last device swap date
import Camara from 'camara-sdk';
const client = new Camara({
bearerToken: process.env['CAMARA_BEARER_TOKEN'], // This is the default and can be omitted
});
const response = await client.deviceswap.check({ maxAge: 120 });
console.log(response.swapped);{
"swapped": true
}{
"status": 400,
"code": "INVALID_ARGUMENT",
"message": "Client specified an invalid argument, request body or query param."
}{
"status": 400,
"code": "OUT_OF_RANGE",
"message": "Client specified an invalid range."
}{
"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
{
"swapped": true
}{
"status": 400,
"code": "INVALID_ARGUMENT",
"message": "Client specified an invalid argument, request body or query param."
}{
"status": 400,
"code": "OUT_OF_RANGE",
"message": "Client specified an invalid range."
}{
"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."
}