Getting Started

In this section, we learn how to get started building applications using the M800 Phone Number API. The getting started procedure involves:

  1. API Account Credentials
  2. Authentication
  3. Authorization

Note

After completing the steps to getting started, see the M800 Phone API Reference document for endpoints and parameters usage.

1. API Account Credentials

To start using the Phone Number API services, M800 will create the API user account and send emails containing:

  • API User ID and Security Token
  • API Password

2. Authentication

In order to get access to the M800 Phone Number APIs, complete the API authentication process. The authentic process involves generating the access token string.

Generating Access Token

To generate the access token:

Pass the security token received via email in the Authorization header of the request body prefixed with M800Auth to the M800 API Gateway using:

https://phonenumber.m800.com/api/gateway/auth
curl -X POST \
 
  https://phonenumber.m800.com/api/gateway/auth \
 
  -H 'Authorization: M800Auth {security token}' \
 
  -H 'Content-Type: application/json' \
 
  -d '{
 
    "username" : "testusername",
 
    "password" : "12345678"
 
}'
Authorization Header
Authorization Header Value
Description

Authorization

M800Auth {security token}

Standard HTTP authorization header containing M800Auth and the security token

Content-Type

application/json

Structured data format

NOTE

Providing password key in the request body is optional.

If the request is successful, the access token is generated.


{
    "access_token": "gfvxrjvhetsfhr",
    "expires_in": 300
}

Where:
access_token: is the access token string which will be used to make API calls
expires_in: the number of seconds that the access token will be valid.

3. Authorization

Once the access token is received, pass it in standard HTTP Authorization header as a Bearer token to call any APIs.

-H 'Authorization: Bearer ${Access-Token}' \

Important

Pass the access token in standard HTTP Authorization header as a Bearer token to make API calls.

Example Authorization Request

To get available countries:

curl -X GET \
  https://phonenumber.m800.com/phonenumber/countries
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer ${Access-Token}' \
  -d '{
     
}'

The lifespan of the access token is 600 seconds. To refresh the access token after its expiry, generate a new access token by following the Generating Access Token procedure outlined in the Authentication section.

API Reference

See the M800 Phone Number API Reference documentation for the endpoints usage.

Technical Authorship: Rakesh Ghatvisave
Leave docs feedback at: rakeshghatvisave@m800.com
M800 Limited Technical Publications

Getting Started


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.