Grant Type Code

Scott Wallace
Scott Wallace
  • Updated

 

POST https://api.actonsoftware.com/token

Customers wanting to access our API via our gateway in the EU can use this link: 

POST https://api-eu.actonsoftware.com/token

(As of July 2019, Grant Type Code requests are disabled by default for new developer accounts. If you would like to enable this option, please contact Act-On Support with the callback URL you would like to use.)

The grant type code method allows users to authorize your application to connect to their Act-On account and does not require you to store their username and password in your application.

Instead, they will be redirected to a page that requests an authorization. This will generate a one-time code that will be passed to your callback URL.

mceclip0.png


Parameters


Name Parameter Type Allow Multiple Required/Optional Data Type Description
grant_type query False Required string The value must be set to 'authorization_code'.
code query False Required string The value from the callback URL code parameter.
client_id query False Required string The client ID you received in your welcome email.
client_secret query False Required string The client secret you received in your welcome email.
redirect_uri query False Required string The value must contain the redirect URL you set with Act-On Support.

 

Example Method to Obtain Code Parameter

The following example URL will send users to the authentication page:

https://api.actonsoftware.com/authorize?scope=PRODUCTION&response_type=code&client_id=12345678-9abc-defg-hijk-lmnopqrs&redirect_uri=http://localhost

Note: An optional "state" parameter can be passed to your callback URL.

Once the user has signed in and authorized the response containing the grant code is sent to your callback URL.

http://localhost/?code=db5b2d1d7c569c6ef8166267ffffff

Your application will then use that code for the code parameter.

Response

{
  "access_token": "12345678-9abc-defg-hijk-lmnopqrs",
  "refresh_token": "12345678-9abc-defg-hijk-lmnopqrs",
  "scope": "default",
  "token_type": "Bearer",
  "expires_in": 86400
}

 

Code Examples


cURL

curl -X POST https://api.actonsoftware.com/token -H "Content-Type: application/x-www-form-urlencoded" -d 'grant_type=authorization_code&code=12345967-1234-1234-1234-1234567891234&client_id=123456789abcdefghijklmnopqrs&client_secret=123456789abcdefghijklmnopqrs&redirect_uri=https://localhost'
Note: Following an upgrade to Act-On's API infrastructure in late 2023, check that the new Base URL, client ID, and secret are used. See API Infrastructure Upgrade for more information.

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request