Error handling
The API returns HTTP error codes according to the type of the error:
400error codes are used for client related issues500error codes indicate server side issues
JSON error representation
403 status codes are returned with the following JSON error:
400 error codes come with a consumable JSON error representation:
Some error codes like ValidationFailed can contain multiple error messages embedded:
List of error codes
Generic error codes
There are several error categories that have general applicability within API and aren’t specific to any particular resource.
Connectivity errors
This section provides additional information about endpoint connectivity errors with HTTP 404 status codes are returned.
Unknown Subscriber Error
This error indicates that the subscriber isn’t registered in the HLR.
This can occur if the IMSI doesn’t belong to emnify, the IMSI isn’t assigned to any SIM, the SIM isn’t activated or is suspended, etc.
Unknown Location Error
This error is used when the service request is made for a subscriber without valid location data (that is, no location information is present in the HLR; this can occur if the IMSI is detached or didn’t respond to paging).
External Network Error
This error is used when the source of the error is external to the system, for example, timeout on a Network Request towards VPLMN.
Network Element Not Available Error
This error indicates no network element available to process the service request.
Data Missing
An example of missing data would be a missing optional parameter required by the context.
Unexpected Data Value
Invalid data, for example, an invalid MSISDN or IMSI.
Resource-specific errors
Errors that are specific to a particular resource and operation being performed are described in resource section.
Most of the errors in this category return 409 Conflict HTTP status code.
For example, trying to activate an endpoint that has no SIM card associated causes the following error:
Resource specific errors are segmented as follows:
Warning: Responses with different root causes may share an error code and token. Be sure to check the error message to determine the exact cause.
For example, the Create IP address space call has two possible reasons for returning a 422:
The requested IP address space isn’t allowed or overlaps with a reserved range.
These scenarios are both considered out of range, so each response contains an OutOfRange error token and 2701 error code.
The message indicates the cause of the error.