API Authentication

Before we allow use of our APIs you must first authenticate yourself, so we know who you are. API calls can be authenticated in a few different ways, but all options are underpinned by SSL/TLS encryption for security.

API Key in an HTTP Bearer token

An API key can be manually created from within eTXT on the My Settings | Api Keys page, by clicking the 'Create' menu item.

Make sure you copy the key to the clipboard, because you won't be able to access it again. Once you have generated an API Key you use it as a Bearer token in the HTTP Authorization header. eg:

curl -H "Authorization: Bearer eyJhbG...LBak" https://www.etxtservice.co.nz/api/3/sms/out --data "to=6427000001" --data "body=hi"

Username and Password via HTTP Basic Auth

It is also possible to authenticate your user using HTTP Basic Auth.

curl --user your-user-name:your-password https://www.etxtservice.co.nz/api/3/sms/out --data "to=6427000001" --data "body=hi"

Username and Password in HTTP POST request

curl https://www.etxtservice.co.nz/api/3/sms/out --data "userId=youruser-name" --data "password=your-password" --data "to=6427000001" --data "body=hi"