Grant Type Code

Prerequisites

The default setting for the code grant callback URL is http://localhost. If you would like to change this, please email the API Support team at api@act-on.com with the URL you would like to use.

How It Works

The Code grant 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 from them. When they respond by clicking Authorize App and logging in, a one-time code will be generated for them and sent to your callback URL. Your application will then use that code as one of the parameters for the /token endpoint call.

Step 1: User Authorization

Use the following URL to send users to the authentication page:

The "state" parameter is optional and will be passed along to your callback URL. This allows for session tracking.

 

Step 2: Callback URL and Code
The response containing the grant code is sent to your callback URL. The default setting for the callback is http://localhost. If you would like to change this, please email the API Support team at api@act-on.com with the URL you would like to use.
A response will look like the following:
 

Step 3: Request Access Token

POST the code from the above response to the token endpoint to obtain session access and refresh tokens:

Parameters

Name Parameter
Type
Allow
Multiple
Required/
Optional
Data Type Description
grant_type x-www-form-urlencoded False Required query Value must be 'authorization_code'.
code x-www-form-urlencoded False Required query Value from callback URL parameter
client_id x-www-form-urlencoded False Required query Your client ID.
client_secret x-www-form-urlencoded False Required query Your Client Secret.
redirect_uri x-www-form-urlencoded False Required query This will redirect the user to the URL of your choice.

Request

HTTP

NOTE: replace the placeholder text in brackets with your code, client ID and client secret.

cURL

NOTE: replace the placeholder text in brackets with your code, client ID and client secret.

Response

OAuth
Grant Type Password
Grant Type Code
Grant Type Refresh
Account API
Get account information
Create new account user
Delete account users
Delete account user
Get email senders
Fact API
Upload custom events
Get upload custom event status
List API
Get listing of lists
Download a list
Create a new list
Update or merge a list
Get list upload status
Delete a list
Delete records from a list
Get hard bounce list
Get spam complaint list
Get optout list
Update optout list
Get subscription opt-outs by category
mergespecs
uploadspecs
Content API
Get logo list
Get a logo
Add a logo
Update a logo
Delete a logo
Get header list
Get a header
Add a header
Update a header
Delete a header
Get footer list
Get a footer
Add a new footer
Delete a footer
Update a footer
Get image list
Get an image
Add an image
Replace an image
Delete an image
Get media list
Get media file
Add a media file
Add a media link
Update Media File
Delete a media object
Get form list
Get promotional form URLs
Get page list
Get page
Delete page
Get promotional page URLs
Get list of programs
Reporting API
Get message report
Get message report drilldown
Get message report by time period
Get media report
Get media message report
Get a media view report
Get a media timeline report
Get form report
Get page report
Get spam complaint list
Get hard bounce list
Email Campaign API
Get message list
Send a message
Resend a message
Add new template or draft message
Update template or draft message
Delete a message
Get message report
Get message report drilldown
Get message report by time period
Get message HTML contents
Contact API
Add a contact
Get contact record
Upsert a contact record by email
Update a contact by record ID
Delete a contact
Get contact record ID based on cookie ID
Get contact from list based on cookie ID or e-mail
Get contact fact and score data
Get subscription categories
Opt in/Opt out subscription category by email address
Get subscription category opt-ins by email
Opt in/Opt out multiple subscription categories by email address
SEO API
Get SEO keywords
Get a new SEO report
Frequently Asked Questions