Message2Give Logo
Message2Give DocsVersion 1.2.8

Authentication

To access resources on the Message2Give API, you will need to be authenticated. You can choose from one of the Authentication methods listed below. We recommend API Key authentication in most cases. Message2Give staff will never ask you for your API Keys or passwords. Do not share your key with anyone.

API Key

API Keys can be created in the Message2Give Portal Channels.

To authenticate a request, set the x-api-key header on your request with your API key as the value.

Below is an example request using API key authentication.

$ curl
  -s
  -H 'x-api-key: YOUR_API_KEY'
  -H 'content-type: application/json'
  -d '{
    "to": "61400000000",
    "from": "Message2Give",
    "content": "Hello, World!",
    "type": "sms",
    "simulated": true,
  }

Session Token

Whenever you log in to your Message2Give account, a session token is generated for you. This cannot be programmatically retrieved. Thus, this form of authentication is primarily used by the Message2Give products.

To authenticate a request this way, set the x-token header on your request with a valid session token as it's value.

If your Workspace has enabled Multi-Factor Authentication (MFA), you must also set the x-mfa header with a valid MFA token as it's value.

Below is an example request using Session Token authentication.

$ curl
  -s
  -H 'x-token: YOUR_TOKEN'
  -H 'content-type: application/json'
  -d '{
    "to": "61400000000",
    "from": "Message2Give",
    "content": "Hello, World!",
    "type": "sms",
    "simulated": true,
  }

Basic Authorisation

If you base64 decode your API key, you will receive a value in the form {username}:{password}.

You can use this value to authenticate a request with Basic Authorization.

Set the Authorization header to have a value in the form Basic username:password.

Below is an example request using Basic Authorization:

$ curl
  -s
  -H 'Authorization: Basic usernamehere:passwordhere'
  -H 'content-type: application/json'
  -d '{
    "to": "61400000000",
    "from": "Message2Give",
    "content": "Hello, World!",
    "type": "sms",
    "simulated": true,
  }

How is this guide?

On this page