Old Authorization
Aprimo Authorization - Retrieving an Access Token Directly from Marketing Operations
While Aprimo Authorization continues to function, if possible you should used OAuth2.0 flows.
Step 1: Register the Client Application
Complete these steps in Marketing Operations.
- Point to System Administration, and click System Tools.
- In System Tools, point to Integration and click Registrations.
- Click New.
- Complete the fields, setting the OAuth Flow Type to < None >.
Note: The Client Secret field operates like a password. However, there is no way to retrieve it from system, so remember it, or store it safely. - Click Save.
Step 2: Get the Authorization Code
Complete these steps in your web browser.
- Navigate to this URL: https://[CustomerURL]/api/oauth/authorize?client_id=[ClientId]&redirect_uri=https%3A%2F%2Fwww.microsoft.com (replacing CustomerURL, ClientID and redirect_uri value with the appropriate values for your site. Note that the redirect_url must be url encoded since it is a query string parameter).
- Log in to the site.
When your credentials are validated, you are redirected to a URL that is a concatenation of the redirect URI you specified and the authorization code.
Example: https://www.microsoft.com/?AuthorizationCode=DI3V7NK44I
Note: The authorization code is only valid for five minutes.
Step 3: Create a Base-64 Encoded Authorization Code
Complete this task in your web browser.
- Go to https://www.base64encode.org/ and create a base64 encoded string of [ClientId]:[Secret].
Note: The colon between [ClientID] and [Secret] is required.
Step 4: Get Authorization and Refresh Tokens
Complete these steps in Postman.
- Select POST.
- Enter this URL: https://[CustomerURL]/api/oauth/create-token.
- Click the Headers tab.
- Type these Key-Value pairs:
- client-id : [ClientId]
- authorization-code : [authorization code you obtained in Step 2: Get the Authorization Code]
- content-type : application/Json
- Authorization : Basic [Base64 encoded string you obtained in Step 3: Create a Base-64 Encoded Authorization Code]
- Click Send.
An access token and refresh token are returned.
Note: By default, the access token lasts 10 minutes before needing a refresh. You can use the refresh token to generate new access tokens for 7 days. If you receive a 401 Unauthorized response from the API with a null response body, your access token has expired.
Step 5: Refresh an Access Token (Optional)
Access tokens are only valid for 10 minutes by default. Once a token expires, API calls return unauthorized 401 responses. The advantage of using this method is that it hides authentication information from the header. Complete these steps in Postman.
- Select POST.
- Enter this URL: https://[CustomerURL]/api/token.
- Click the Headers tab.
- Type these Key-Value pairs:
- client-id : [ClientId]
- content-type : application/Json
- Click the Body tab.
- Click raw.
- Type:
{ "refreshToken":"[refresh token returned in Step 4: Get Authorization and Refresh Tokens]" }
- Click Send.
This returns a new access token that is good for 10 minutes
Aprimo Authorization - Retrieving an Access Token for Services and Daemons
While Aprimo Authorization continues to function, if possible you should used OAuth2.0 flows.
Step 1: Register the Client Application
Complete these steps in Marketing Operations.
- Point to System Administration, and click System Tools.
- In System Tools, point to Integration and click Registrations.
- Click New.
- Complete the fields, setting the OAuth Flow Type to < None >.
Note: The Client Secret field operates like a password. However, there is no way to retrieve it from system, so remember it, or store it safely. - Click Save.
Step 2: Generate a Native Token
Complete these steps in Marketing Operations.
- Log in as the user for whom you will create the token.
- On the toolbar, click the User button, and click User Token.
- Click Generate.
Step 3: Create a Base-64 Encoded Authorization Code
Complete this task in your web browser.
- Go to https://www.base64encode.org/ and create a base64 encoded string of [UserName]:[UserToken].
Note: The colon between [UserName] and [UserToken] is required.
Step 4: Get the Access Token and Refresh Token
Complete these steps in Postman.
- Enter this URL: https://[CustomerURL]/api/oauth/create-native-token.
- Click the Headers tab.
- Type these Key-Value pairs:
- client-id : [ClientId]
- content-type : application/Json
- Authorization : Basic [Base64 encoded string you obtained in Step 3: Create a Base-64 Encoded Authorization Code]
- Click Send.
An access token and refresh token are returned.
Note: By default, the access token lasts 10 minutes before needing a refresh. You can use the refresh token to generate new access tokens for 7 days.
Step 5: Refresh an Access Token
Note: This step is optional. The process can be handled programmatically from within the service. The advantage of using this method is that it hides authentication information from the header.
Complete these steps in Postman.
- Select POST.
- Enter this URL: https://[CustomerURL]/api/token.
- Click the Headers tab.
- Type these Key-Value pairs:
- client-id : [ClientId]
- content-type : application/Json
- Click the Body tab.
- Click raw.
- Type:
{ "refreshToken":"[refresh token returned in Step 4: Get the Access Token and Refresh Token]" }
- Click Send.
This returns a new access token that is good for 10 minutes
Aprimo Authorization - Revoking Tokens
You can revoke all refresh tokens for a user at DELETE api/oauth/revoke/{userID}. This immediately expires all refresh tokens associated with the {userID}. This route returns an error if the API user does not have permission to access the route:
- the API user must match the {userID} specified; OR
- the API user must be a Security Administrator or System Administrator (to revoke the refresh tokens of a different user)