Number cancellation API

Cancellation of a phone number:

Allows the cancellation of a phone number. The request body should contain the correct access key and phone number to cancel.

POST https://api.tenios.com/number/cancel

Request Parameter:

access_key
String
TheApi Access Key. It can be found in the menu MY ACCOUNT–>General Settings in the section API in the customer portal.
phone_type
String
Phone number to cancel
Currently is only the GEOGRAPHICAL phone number type supported.

Examples of correct requests:

Request:

{     "access_key":"XXXXX-XXXX-XXXXXX",     
      "phone_number": "+49888888" 
}

API Response:

HTTP Status Code: 200 (OK)

{
    "cancellation_date":"2019-01-01"
}

Examples of incorrect requests:

NUMBER_CANCEL_NO_SUBSCRIPTION_FOUND
This error is returned if no subscription was found for the provided phone number.

Request:

{
    "access_key":"XXXXX-XXXX-XXXXXX",
    "phone_number": "+49888888"
}

API Response:

 HTTP Status Code: 400 (Bad Request)

{
    "error_code": "NUMBER_CANCEL_NO_SUBSCRIPTION_FOUND",
    "error_message": "No active subscription found for provided phonenumber.",
    "fields": []
}
FIELD_IS_REQUIERED
This error is returned if no phone number is provided.

Request:

{
    "access_key":"XXXXX-XXXX-XXXXXX",
    "phone_number": ""
}

API Response:

HTTP Status Code: 400 (Bad Request)

{
    "error_code": "FIELD_IS_REQUIRED",
    "error_message": "Parameter 'phone_number' is required",
    "fields": ["phone_number"]
}
NUMBER_CANCEL_PHONE_NUMBER_NOT_VALID
This error is returned if the entered phone number is invalid.

Request:

{
    "access_key":"XXXXX-XXXX-XXXXXX",
    "phone_number": "abcdefg"
}

API Response:

HTTP Status Code: 400 (Bad Request)

{
    "error_code": "NUMBER_CANCEL_PHONE_NUMBER_NOT_VALID",
    "error_message": "Provided phone number is not valid. It should contain only digits.",
    "fields": []
}
NUMBER_CANCEL_ILLEGAL_NUMBER_TYPE
This error is returned if the phone number type is not accepted.

Request:

{
    "access_key":"XXXXX-XXXX-XXXXXX",
    "phone_number": "+80087897"
}

API Response:

HTTP Status Code: 400 (Bad Request)

{
    "error_code": "NUMBER_CANCEL_ILLEGAL_NUMBER_TYPE",
    "error_message": "Only 'GEOGRAPHICAL' number type is acceptable.",
    "fields": []
}
NUMBER_CANCEL_SUBSCRIPTION_ALREADY_CANCELLED
This error is returned if the entered phone number has already been cancelled.

Request:

{
    "access_key":"XXXXX-XXXX-XXXXXX",
    "phone_number": "+49888888"
}

API Response:

HTTP Status Code: 400 (Bad Request)

{
    "error_code": "NUMBER_CANCEL_SUBSCRIPTION_ALREADY_CANCELLED",
    "error_message": "You have already cancelled subscription for provided phone number.",
    "fields": []
}

TOP