Transaction export via API
As a Rokt partner, you may want to receive data about the customers that engage with Rokt placements on your site so that you can integrate this data into a your own CRM or reporting dashboard. Our data management platform provides the ability for you to receive real-time and secure access to transaction data. One of the popular options is integrating transactions data via API directly into your CRM.
An API is the most efficient way for Rokt to deliver transactions data to you. This is because it works in real time, meaning that as soon as a customer engages with a placement on your site, the Rokt system can communicate the event to your system. There are a few technical pieces required to get this completed, which are outlined below.
#
RequirementsTo begin the API setup, Rokt requires a few pieces of information.
The following details should be sent to your account manager:
- Full API documentation on how to create subscribers in your system.
- Technical contact details to help troubleshoot setup queries.
- Endpoints for any relevant environments (production, testing, staging, etc.).
- Method (e.g., GET, POST, PUT)
- Authentication (if any)
- Request body encoding (e.g., JSON, XML, URL Encoded)
- Required API parameters (Learn about what attributes Rokt can share.)
- Expected API responses to help Rokt accurately categorize leads delivered successfully versus those that were rejected.
#
API documentationAPI documentation can encompass some or all of the points listed as requirements such as:
- Endpoint
- Method
- Body
This should detail exactly how Rokt can deliver leads to your system.
The API documentation as well as a technical contact should be sufficient to start the API setup process.
For a good example of API documentation, check out the Mailchimp API documentation.
#
Technical contact detailsProvide the relevant contact (either yourself or someone else on your team) who's best suited to address any questions about the API setup process.
The technical contact should be able to help with:
- Verifying that test leads have been recorded successfully in your system
- Explaining why we're receiving a response status of 403
For example:
John Smith
Technical Support
#
EndpointThis is the location where Rokt should deliver data. If you have a staging or testing endpoint, this will help the Rokt team during the setup and testing process so that no test leads are delivered to your live CRM.
For example:
https://us9.api.mailchimp.com/3.0/lists/abcdefghij/members
#
MethodThis is the HTTP request type that Rokt uses to deliver data to your list. The majority of the time, this is a POST request.
Rokt supports the following submit methods:
- GET
- POST
- PUT
#
AuthenticationProvide any authentication details necessary for Rokt to call your API. This could come in many forms, such as:
- User name and password combination
- An API key
- Client ID and secret
#
API parametersProvide a list of parameters for Rokt to include through in each API request. If possible, specify any:
- Required attributes (attributes that must be sent in order for the request to succeed)
- Optional attributes
- Parameter names for each attribute (whether to use
firstname
,FirstName
, orfirst-name
, for example)
Common attributes include:
- First name
- Last name
- Source
- Country
For reference, Rokt can share any of these attributes.
Rokt supports the following body encoding:
- JSON
- URL encoded
- Plain text
- XML
#
Expected API responsesBy providing a list of possible API responses, Rokt can set up response handling logic to quickly identify leads that were delivered successfully, versus those that failed to deliver or were labelled as duplicates.
The response handling could be created based on the status code we receive or the response body, depending on how your API is set up.
Example status codes:
- 201 (lead created successfully)
- 400 (unauthorized)
- 500 (server error)
Example response body values:
"successfully delivered"
{"status": "duplicate"}
{"success": false}
caution
Work with your Rokt account manager to complete the API setup process described below.
#
Setting up the API connectionNavigate to your account in One Platform.
From the left navigation menu, go to Integrations > Connections.
Click Add connection.
Under Transactions, select API.
Give your connection a name.
Enter the endpoint for your connection.
Enter all required information under Authorization, Headers, and Body.
Enter all your Response handling rules.
#
Testing your real-time connectionOnce your API connection is set up (endpoint, authorization, headers, body, and response handling), click Settings.
Edit the test settings according to your test criteria.
Click Save.
Click Test.
Check your test result.
Repeat tests until you've achieved your desired outcomes.
#
Linking placements to your API connectionFrom the Connections tab, select Real-time from the left dropdown menu and Transactions from the right dropdown menu.
Expand the connection that you want to link your placements to.
Click Show unlinked.
Click Link for All Placements.
All placements are now linked to your connection.
#
Unlinking placements from your API connectionFrom the Connections tab, select Real-time from the left dropdown menu and Transactions from the right dropdown menu.
Expand the connection that you want to unlink your placements from.
Click Unlink to unlink all placements.
All placements are unlinked.