Making requests

To start making requests to our API, you need to know how, and that's easy!.

Before starting, check at our knowledge bar the API URL. Right there you have our API URLs to make the request, just append the endpoint and follow the steps:

With that in mind, we need 2 basic headers and the body in our GET request (or any request):

The first one needs the Content-Type , we allow ONLY two Content-Type :

  • application/json (recomendada)
  • x-www-form-urlencoded

After that, we need the Auth header, for that we use Basic as authentication, for these you need the follow:

Authorization: Basic {your_auth_code}

How do you use it?, is pretty simple, just append that header to your request headers replacing {your_auth_code} with your auth code, but how do you replace that?, keep reading...

To create your auth code string, you need your API Key and your API Secret.

Then, you need to concatenate them using a semicolon in the middle ( : ) so you get something like this:

api_key:api_secret

After that, there is only one more step, you need to encode the string to base64, so, let's think you have the API Key: 123abc, and the API Secret: 456def.

With that in mind we concatenate them:

123abc:456def

And finally we encode them to base64, so we get:

MTIzYWJjOjQ1NmRlZg==

Using that, we get our final auth header:

Authorization: Basic MTIzYWJjOjQ1NmRlZg==

And that's it...you have your two headers. Now there is only one step more:

We need the Body in the request to match with the Content-Type. We are using Content-Type: application/json in this case, so we use the Body in a JSON format.

WIn the /mnp/PHONE_NUMBER endpoint we need one param, the PHONE_NUMBER

The phone number in the e164 format

And we make the request and the magic happens!.

We support the HTTP/2 protocol in our API so if you want a faster connection and response, please use it.

Responses

All the responses are in JSON format. So you can parse them in your programming language more easily.

Check the knowledge bar for a response example of the /mnp/PHONE_NUMBER endpoint using GET.

In every endpoint here in the docs, you have the response in the knowledge bar.