Skip to content

Token Authentication

When using our APIs to send messages you need to provide means of authentication so our servers can verify which account the request is made from and thus who is sending the messages.

Create an Account

Before you can start using the GatewayAPI service, you will need to register an account with us. When creating an account we create a set of credentials for you to use in your own application - you can of course create new ones via the dashboard.

Token Authorization Header

The simplest form used for authentication is to just set the Authorization header with the token itself using the Token authorization scheme.

The value of the Authorization header is specified to be {scheme} {value}, and thus when using the scheme Token, it becomes Token {value}.

1
2
3
4
5
6
7
POST /rest/mtsms HTTP/1.1
Host: gatewayapi.com
Authorization: Token your-token-here
Accept: application/json, text/javascript
Content-Type: application/json

{"message": "Hello World", "recipients": [{"msisdn": 4512345678}]}

Token vs Bearer

To anybody familiar with the current landscape of HTTP authentication schemes, this will look very similar to the Bearer scheme, and in fact it is.

But the Bearer scheme has become so intertwined with JWT sessions and OAuth that it is just simpler and avoids a lot of support dialogue to use a differently named scheme when just transporting a simple token.