Messente avatar logo

Number Lookup API DOcumentation

Number Lookup API Setup

This tutorial will guide you through the setup of Number Lookup API.

  1. Create a Messente Account on https://dashboard.messente.com/register
  2. Obtain your Messente API username and API password from API Settings page - https://dashboard.messente.com/api-settings
  3. Start using the API

API REQUEST AUTHENTICATION

API endpoint

Number Lookup API requests are made to the following server:
  https://api.messente.com/

Authentication

Authentication is done by setting HTTP header "X-Service-Auth" to your Messente API username and password concatenated with a semicolon like this:
    X-Service-Auth: messente-api-username:messente-api-password

Request and response body

All request and response bodies for the API calls are JSON encoded strings according to the specification.

Response HTTP status codes

API call responses have status codes according to REST specifications.
Always set Accept and Content-Type headers to application/json as well.
Only 2XX response codes indicate a successful response.

Number Lookup Call

Request to lookup a number will be made to the following URL:
    POST https://api.messente.com/hlr/sync
Request headers 
HTTP header Description Required
Content-Type application/json Yes
Accept application/json Yes
X-Service-Auth Refer to authentication section on how to authenticate your API calls with Messente API username and password Yes
Request body (JSON encoded)
Key Description Required
numbers List of numbers to lookup.
Example: ["+12345678901", "+12310987654"]
Yes
Response body (JSON encoded)
Key Type Value
numbers List[Result] List of lookup results
error Error Indicates if any error occurred while handling the request
Result
Key Type Value
number String Number that was looked up
currentNetwork Network Indicates current network info
ported Boolean Indicates if a number is ported
originalNetwork Network If ported this field will indicate information about network number originated from
roaming Boolean Indicates if a number is roaming
roamingNetwork Network If roaming this field will indicate network to which it is currently connected to
status String Status of the mobile number can be: ONLINE, OFFLINE, UNKNOWN, INVALID
Network
Key Type Value
mccMnc String Mobile country and mobile network code
networkName String Mobile network name
countryName String Country name
countryPrefix String Country prefix
countryCode String Country code
Error
Key Type Value
code Number error code
description String error description
Error Codes
Code HTTP Code Description
101 401 Access is restricted, wrong credentials or Ip not whitelisted.
102 400
Parameters are wrong or missing. Check that all the required parameters are present.
103 400 Maximum number of numbers for the sync call exceeded.
104 402 Not enough credits on messente account.

Example request

$ curl -X POST \
   --header 'Content-Type: application/json' \
   --header 'Accept: application/json' \
   --header 'X-Service-Auth: uXXwRLJOaCifV:oA5rVSvslkcoXK' \
   --data '{"numbers": ["+12345678901", "+12310987654"]}' \
   'https://api.messente.com/hlr/'