API Authentication

In order to integrate with Hubtel APIs, you will need to create API keys for authentication purposes. Each API has specific keys that would need to be created to access them.

Authentication Methods

There are two main API authentication methods used:

  1. HTTP Basic Authentication
  2. URL Authentication

Basic Authentication

The easiest way to authenticate is by using HTTP Basic Authentication. Basic Auth requires a Base64 encoded string of your ClientID or API ID as your username and ClientSecret or API Key as your password. The encoded string is sent in the HTTP Authorization header. See below for a sample header request information.

Authorization: Basic {base64_encode(ClientID:ClientSecret)} - For SMS

Authorization: Basic {base64_encode(APIiD:APIKey)} - For Sales

A Base64 encoding of your API keys should have your Authorization header appear like this:
Basic a2hlcW2sb3U6bWdhtHd9YW8=. Try sample basic auth here https://www.base64encode.org

So if khsqolyu is your ClientID and muahwiao is your ClientSecret, then the following header will be sent in the request:

Authorization: QmFzaWMge2Jhc2U2NF9lbmNvZGUoa2hzcW9seXU6bXVhaHdpYW8pfQ==

👍

Sample Authorization Header

Authorization: Basic a2hzcW9sb3U6bWdhaHdpYW8=

Basic Authorization for SMS API using Postman


URL Authentication

URL Authentication involves passing your ClientId and ClientSecret as request parameters in the URL of each request. This form of authentication is used for the Hubtel Quick Send SMS API.



https://domain.website.com?From={From}&To={To}&Content={Content}&ClientId={ClientId}&ClientSecret={ClientSecret}&RegisteredDelivery={RegisteredDelivery}