sTN Partner APIsTN Partner API
Home
Getting Started
Guide
Home
Getting Started
Guide
  • Guide

    • Introduction
    • Supported Features
    • Authentication
    • Base URLs
    • Advanced Query Parameters
    • Error Handling
  • Getting Started

    • Introduction
    • Quick Start Guide
  • API Endpoints

    • QuerySimcard
    • QueryActivation
    • QuerySubscription
    • NewSubscription
    • CancelNewSubscription
    • SuspendSubscription
    • ResumeSubscription
    • SimSwapSubscription
    • SetServicesSubscription
    • MoveEnvironmentSubscription
    • InPortSubscription
    • ChangeInPortSubscription
    • CancelInPortSubscription
    • PortingOutSubscription
    • CancelPortingOutSubscription
    • TerminateSubscription
    • CancelTerminateSubscription
    • QueryInvoice
    • QueryCdrMonth
    • QueryCdr
    • QueryUsageSubscription

Error Handling

The error handling is quite basically; you will receive a general message stating the main reason of the problem. We advise to debug the error by ruling out elements in the expression which can cause the problem. (Start with a basic query which results in a succesfull response and start adding the extra elements.) If the problem persists and you can't find the error, don't hesitate to contact us.


Possible Error levels

  • 400 Bad Request: If any of the query parameters are invalid
  • 401 Unauthorized: If the API key is missing or invalid
  • 403 Forbidden: If the user doesn't have permission
  • 429 Too Many Requests: If the rate limit for this endpoint is exceeded

Example Error messages

In case your are posting a message which is correctly formatted but is rejected because of an error (400) in the content of the fields you may get a response like:

{
    "responseStatus": {
        "errorCode": "MaximumLength",
        "message": "The length of 'reference Number' must be 15 characters or fewer. You entered 26 characters.",
        "errors": [
            {
                "errorCode": "MaximumLength",
                "fieldName": "referenceNumber",
                "message": "The length of 'reference Number' must be 15 characters or fewer. You entered 26 characters.",
                "meta": {
                    "MinLength": "0",
                    "MaxLength": "15",
                    "TotalLength": "26",
                    "PropertyName": "reference Number",
                    "PropertyValue": "Regular Error Notification"
                }
            }
        ]
    }
}

Or for example when required fields are missing:

{
    "responseStatus": {
        "errorCode": "BadRequest",
        "message": "Email address is required when activating an eSim",
        "errors": []
    }
}
{
    "responseStatus": {
        "errorCode": "SerializationException",
        "message": "Could not deserialize 'application/json' request using STNPartnerAPIServiceStack.ServiceModel.CancelTerminateSubscription'\nError: JSON deserialization for type 'STNPartnerAPIServiceStack.ServiceModel.CancelTerminateSubscription' was missing required properties, including the following: activationId",
        "errors": []
    }
}

Info

The provided information should normally point you in the right direction to solve the issue.

Last Updated:
Contributors: UP2media-AR
Prev
Advanced Query Parameters