Eligibility

Discover how to check your eligibility to a given API


This guide shows you how to check your eligibility to a given API operation and will use our Network SMS API as example.

Endpoints

Below are all APIs url that you will need for this guide:

Transatel APIsURL
Authenticationhttps://api.transatel.com/authentication/api
Network SMShttps://api.transatel.com/network/sms

All Transatel APIs are available through our unique API gateway https://api.transatel.com

1. API Authentication

First thing first, let's get your access token by following the getting started guide!

2. Check service eligibility

Now that you are authenticated, and you have an access token, let's use it to check your eligibility to the service.

The eligibility mechanism works by accepting HTTP OPTIONS requests on any available URL of a given API.

  • If the URL does not match any operation, a 404 Not found error will be returned.
  • In any other case, a 204 No content response will be returned will all HTTP methods you are eligible to in the Allow header.
  • This mechanism does not require any particular permissions and is open to any authenticated user. As such, OPTIONS HTTP method is always included in a 204 No content response.

If the response contains only the OPTIONS HTTP method, then it means that you don't have the proper permissions for this particular operation. Please contact your Transatel account manager to request it if needed.

We are using below the Network SMS API as example, but you are free to do the same for most of our APIs. You can check their support for this mechanism in their API reference.

Below the eligibility checks for each operation of the Network SMS API:

/api/sms


curl --location --request OPTIONS \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer
eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJidXNpbmVzc19lbnRpdGllcyI6WyJBbnkiXSwicHJpbmNpcGFsIjoib2NzLXN1YnNjcmlwdGlvbi1vcmRlci1tYW5hZ2VyIiwic2NvcGUiOlsiQ0FUQUxPR19QUk9EVUNUU19SRUFEX1RFQ0hOSUNBTCIsIkNBVEFMT0dfUFJPRFVDVFNfUkVBRCIsIlVTRVJfUkVBRCIsIklOVkVOVE9SWV9TVUJTQ1JJUFRJT05TX1JFQUQiXSwiZXhwIjoxNjE3MjYwNTYxLCJhdXRob3JpdGllcyI6WyJST0xFX0lOVEVSTkFMX1NZU1RFTSJdLCJqdGkiOiJmOTYwNTFmNS05ZmQzLTQxMDEtYjNkZC0xZjY2Y2Q2MWUzZjIiLCJjbGllbnRfaWQiOiJvY3Mtc3Vic2NyaXB0aW9uLW9yZGVyLW1hbmFnZXIifQ.KBTlltd459_4kPV0O3OfsBTFGBtoqRxG65o_NohK1U7IuJAvIjAa8Fj4Qon1ptFrrTR5M2o8l0f9Dl0D7r0Us6Ej6OsVlFXfQKUiXwVytNUTP7POB6l56Svc5CaVqkXgFKyt7_8h6Ii6R_RteujtSzJSWX7zeLSeemxsxKNtHLLIS_HLyNdQyIsVCZWRfFhdPJVQId_p6B08_A54sAwhrT7qssSbtpG1nGzdqsHdFfaqJt9ABhPedatHNlwcWtCnFthrOrD2rv0Yf8OnRLnt-ZWtypr0cqm6U-brtZeBMhcxgzF4afKlJbKN3K3drPJRrRPjL8L9bf2YvzsDWxY5lA'
\
'https://api.transatel.com/network/sms/api/sms'

Above are highlighted the main information to provide to the API:

  • Authorization header: This is where you provide the previously retrieved access_token
  • URL: Should match the URL for which you want to check your eligibility

If successful, the response returned will be as follows:

HTTP/1.1 204 No Content
X-TSL-Request-Id: 12de1d3d-ce4b-45b8-84e8-aed3b1fe0a01
allow: POST, OPTIONS
...

As you can see in this response, the allow headers contains two HTTP methods:

  • POST: Means that you are allowed to perform a POST on this URL (i.e send a SMS)
  • OPTIONS: Means here that you can perform an eligibility check

/api/sms/{messageId}


curl --location --request OPTIONS \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer
eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJidXNpbmVzc19lbnRpdGllcyI6WyJBbnkiXSwicHJpbmNpcGFsIjoib2NzLXN1YnNjcmlwdGlvbi1vcmRlci1tYW5hZ2VyIiwic2NvcGUiOlsiQ0FUQUxPR19QUk9EVUNUU19SRUFEX1RFQ0hOSUNBTCIsIkNBVEFMT0dfUFJPRFVDVFNfUkVBRCIsIlVTRVJfUkVBRCIsIklOVkVOVE9SWV9TVUJTQ1JJUFRJT05TX1JFQUQiXSwiZXhwIjoxNjE3MjYwNTYxLCJhdXRob3JpdGllcyI6WyJST0xFX0lOVEVSTkFMX1NZU1RFTSJdLCJqdGkiOiJmOTYwNTFmNS05ZmQzLTQxMDEtYjNkZC0xZjY2Y2Q2MWUzZjIiLCJjbGllbnRfaWQiOiJvY3Mtc3Vic2NyaXB0aW9uLW9yZGVyLW1hbmFnZXIifQ.KBTlltd459_4kPV0O3OfsBTFGBtoqRxG65o_NohK1U7IuJAvIjAa8Fj4Qon1ptFrrTR5M2o8l0f9Dl0D7r0Us6Ej6OsVlFXfQKUiXwVytNUTP7POB6l56Svc5CaVqkXgFKyt7_8h6Ii6R_RteujtSzJSWX7zeLSeemxsxKNtHLLIS_HLyNdQyIsVCZWRfFhdPJVQId_p6B08_A54sAwhrT7qssSbtpG1nGzdqsHdFfaqJt9ABhPedatHNlwcWtCnFthrOrD2rv0Yf8OnRLnt-ZWtypr0cqm6U-brtZeBMhcxgzF4afKlJbKN3K3drPJRrRPjL8L9bf2YvzsDWxY5lA'
\
'https://api.transatel.com/network/sms/api/sms/c1e2fac8-0572-4e2c-a487-c3cc5cbbc85c'

Above are highlighted the main information to provide to the API:

  • Authorization header: This is where you provide the previously retrieved access_token
  • URL: Should match the URL for which you want to check your eligibility

If successful, the response returned will be as follows:

HTTP/1.1 204 No Content
X-TSL-Request-Id: d06aaa10-2fa6-4c25-bbd2-9a55bdbbc887
allow: GET, OPTIONS
...

As you can see in this response, the allow headers contains two HTTP methods:

  • GET: Means that you are allowed to perform a GET on this URL (i.e find a SMS)
  • OPTIONS: Means here that you can perform an eligibility check