Skip to main content

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 sending 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 user engages with a placement on your site, the Rokt system will send this data to you. There are a few technical pieces required to get this completed, which are outlined below.

Requirements#

To begin the API setup, Rokt requires a few pieces of information.

The following details should be sent to your account manager:

  1. Full API documentation on how to create subscribers in your system.
  2. Technical contact details to help troubleshoot setup queries.
  3. Endpoints for any relevant environments (production, testing, staging, etc.).
  4. Method (e.g., GET, POST, PUT)
  5. Authentication (if any)
  6. Request body encoding (e.g., JSON, XML, URL Encoded)
  7. Required API parameters (Learn about what attributes Rokt can share.)
  8. Expected API responses to help Rokt accurately categorize leads delivered successfully versus those that were rejected.

API documentation#

API 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 details#

Provide 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

john.smith@company.com

Endpoint#

This is the location that Rokt should send data to. 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

Method#

This is the HTTP request type that Rokt uses to send data to your list. The majority of the time, this is a POST request.

Rokt supports the following submit methods:

  • GET
  • POST
  • PUT

Authentication#

Provide any authentication details necessary for Rokt to send you data. This could come in many forms, such as:

  • User name and password combination
  • An API key
  • Client ID and secret

API parameters#

Provide a list of parameters for Rokt to send 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, or first-name, for example)

Common attributes include:

  • Email
  • First name
  • Last lame
  • 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 responses#

By 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 connection#

  1. Navigate to your account in One Platform.

  2. From the left navigation, click Connections.

    Transaction Export via API

  3. Click Add connection.

    Transaction Export via API

  4. Under Transactions, select API.

    Transaction Export via API

  5. Give your connection a name.

    Transaction Export via API

  6. Enter the endpoint for your connection.

    Transaction Export via API

  7. Enter all required information under Authorization, Headers, and Body.

    Transaction Export via API

  8. Enter all your Response handling rules.

    Transaction Export via API

Testing your real-time connection#

  1. Once your API connection is set up (endpoint, authorization, headers, body, and response handling), click Settings.

    Transaction Export via API

  2. Edit the test settings according to your test criteria.

    Transaction Export via API

  3. Click Save.

  4. Click Test.

    Transaction Export via API

  5. Check your test result.

  6. Repeat tests until you've achieved your desired outcomes.

Linking placements to your API connection#

  1. From the Connections page, select Real-time and Transactions from the dropdown.

  2. Expand the connection that you want to link your placements to.

    Transaction Export via API

  3. Click Show unlinked.

    Transaction Export via API

  4. Click Link for All Placements.

    Transaction Export via API

  5. All placements are now linked to your connection.

    Transaction Export via API

Unlinking placements from your API connection#

  1. From the Connections page, select Real-time and Transactions from the dropdown.

  2. Expand the connection that you want to unlink your placements from.

    Transaction Export via API

  3. Click Unlink to unlink all placements.

    Transaction Export via API

  4. All placements are unlinked.

Was this article helpful?