REST API - Generating an Access Token

oAuth Token

To retrieve an oAuth token you will need to pass an Authorization header to the token endpoint in the following format:

Authorisation: Basic [ENCODED_CLIENT+SECRET]

Where [ENCODED_CLIENT+SECRET] is your client id and client secret separated by a colon and Base64 encoded.

 

APP Example Request - Refresh Token

With Refresh tokens you do not need a username and password.

Once your first token expires you use the refresh token URL below (URL 2) to get a Long Live token.

Pass this request: curl -X POST https://signon.communigator.co.uk/core/connect/token -H "Authorization: Basic [ENCODED_CLIENT+SECRET]" -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=refresh_token&refresh_token=[YOURREFRESHTOKEN]&scope=openid%20GatorMailApi"

And you will get the following access token: {"access_token":"hJJ0eXASDSsdsdKV1Q....","expires_in":3600,"token_type":"Bearer", "refresh_token": "as454kludu4kawejad..." }

APP Example Request - Long Live

The long live token will last for 6 months and is used after your first refresh token expires.

curl -X POST https://signon.communigator.co.uk/core/connect/extend_token -H "Authorization: Bearer [ACCESSTOKEN] " -H "Content-Type: application/x-www-form-urlencoded"

Environment Example Request

The environmental token is the same as other requests, except a few details change.

[SSO_USERNAME] and [SSO_PASSWORD] needs to be changed to [ENVIRONMENT_USERNAME] and [ENVIRONMENT_PASSWORD].

curl -X POST http://oauth.communigator.co.uk/core/connect/token -H "Authorization: Basic [ENCODED_CLIENT+SECRET]" -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=password&username=[ENVIRONMENT_USERNAME]&password=[ENVIRONMENT_PASSWORD]&scope=openid%20GatorMailApi"

Access Token Communication with Endpoints

You can then use your access token to call any of the GatorMail, GatorSurvey, or GatorLeads end points in the API documentation: https://communigator.github.io/API-Documentation/

To do so call the desired endpoint and pass along an authorisation header like so:

curl -X GET https://api.communigator.co.uk/mail/coinsglobal_testlz/campaign/1/100 -H "Authorization: Bearer [ACCESS_TOKEN]" -H "Content-Type: application/json"

 

The tools/integration screen is unrelated to accessing the API and is only used if you have one of our CRM integrations setup.

0 Comments

Add your comment

E-Mail me when someone replies to this comment