SIM Swap API HTTP responses

Here are the possible HTTP status codes you can get when using the SIM Swap API:

200

When you get a successful response containing information about the SIM swap event.

{
    "latestSimChange": "2023-07-03T12:27:08.312Z"
}

400

When there are issues, such as invalid arguments in the client request:

{
    "status": 400,
    "code": "INVALID_ARGUMENT",
    "message": "Client specified an invalid argument, request body or query param"
}

401

When there is an authentication issue with the client request:

{
    "status": 401,
    "code": "UNAUTHENTICATED",
    "message": "Request not authenticated due to missing, invalid, or expired credentials"
}

403

When a client does not have the right or enough permissions to access device data:

{
    "status": 403,
    "code": "PERMISSION_DENIED",
    "message": "Client does not have sufficient permissions to perform this action"
}

404

When the resource data cannot be found:

{
    "status": 404,
    "code": "SIM_SWAP.UNKNOWN_PHONE_NUMBER",
    "message": "SIM swap can't be checked because the phone number is unknown"
}

409

When there's a conflict with two requests for the same phone number (MSISDN):

{
    "status": 409,
    "code": "CONFLICT",
    "message": "Another request is created for the same MSISDN"
}

500

For internal server errors, you can contact Network as Code support team.

{
    "status": 500,
    "code": "INTERNAL",
    "message": "Server error"
}

503

Service is unavailable. Typically the server is down. Contact Network as Code support team and check when the service will return.

{
    "status": 503,
    "code": "UNAVAILABLE",
    "message": "Service unavailable"
}

504

The request time has been exceeded. If it happens repeatedly, consider reducing the request complexity. You can also contact Network as Code support team for possible solutions.

{
    "status": 504,
    "code": "TIMEOUT",
    "message": "Request timeout exceeded. Try later."
}

Last updated on June 28, 2024