Skip to main content

Authentication

The Event API leverages the OAuth 2.0 approach to client integration. See OAuth 2.0 Credentials Flow for more details. You need your Rokt App ID and App Secret to access the Rokt Event API.

You can generate credentials for the Rokt Reporting API with these same steps.

An access token is needed to call any endpoint on the Rokt Event API. Access tokens allow Rokt to identify client apps, the type of data that each client app is accessing, and prevent malicious apps from accessing data that they do not have access to.

Generating App ID and App Secret#

  1. Sign in to One Platform.

  2. Navigate to Profile Settings under your account icon at the top right.img

  3. Scroll down to the Generate Personal API Credentials section.

  4. Enter the name of your app.

  5. Click Generate.

  6. Your credentials for both the Event API and Reporting API will generate right away and will look something like this:

    AppId: "40svbin0d194subpohl079rhck"AppSecret: "1dimhvr1v6skae9uhvtgs3chs2astnjf0469df6ul9hurubtoovn"
  7. Store the App ID and App Secret in a secure location. You will not have access to the App Secret again after this session.

  8. You can use these credentials right away.

You should keep the credentials confidential in order to protect your account and they should never be emailed. Do not share them outside your organization, even if an inquiry appears to come from Rokt. No one who legitimately represents Rokt will ever ask you for your App Secret.

When to call#

Call this endpoint to generate an access token that allows you to interact with the Event API for one hour. If you need to continue interacting with the API for over an hour, call this endpoint again to get a new access token.

Request#

Sample#

curl -vX POST  https://api.rokt.com/auth/oauth2/token \    -H 'Authorization: Basic ${AuthToken}' \    -H 'Content-Type: application/x-www-form-urlencoded' \    -d 'grant_type=client_credentials'

Fields#

KeyInDescriptionRequired?Example
Authorizationheaderapp_id and app_secret must be passed in the authorization header through Basic HTTP authorization and can be generated under Profile Settings in One Platform; the header content is Basic base64encode(app_id:app_secret)YesBasic base64encocde(12345:abcde)
Content-TypeheaderMedia type of request must always be application/X-www-form-urlencodedYesapplication/X-www-form-urlencoded
grant_typebodyMust be client_credentialsYesclient_credentials

Response#

Sample#

{"Access_token":"eyJraWQiOiJNMDJyQmZzT3pNKzRVMjhHRjVuaDdIREphWlIwaytDMlwvNFl5dXYxZ2N0ST0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI0MHN2YmluMGQxOTRzdWJwb2hsMDc5cmhjayIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoicmVwb3J0LWFwaVwvcmVhZC1yZXBvcnQtYXBpIiwiYXV0aF90aW1lIjoxNTg1MTEwMDQxLCJpc3MiOiJodHRwczpcL1wvY29nbml0by1pZHAudXMtd2VzdC0yLmFtYXpvbmF3cy5jb21cL3VzLXdlc3QtMl9kb3dOWnV6VFgiLCJleHAiOjE1ODUxMTM2NDEsImlhdCI6MTU4NTExMDA0MSwidmVyc2lvbiI6MiwianRpIjoiZDFlNjgyMDYtNWVlNy00NThjLTkwODYtZjAwYjhiMjEzYjJhIiwiY2xpZW50X2lkIjoiNDBzdmJpbjBkMTk0c3VicG9obDA3OXJoY2sifQ.NOJIx7qLHFVXqKNZfJKsJlwitOvbHOLdknQ\_D33WjYe8O9ZE08t7LFgs7ANiwBicN5ejmdS7iND0cth5ViUWK5MKZxvLKI6dPG5RljegfpZJtGKqDT\_MFfpayvcOlkkZc5yRw9Bcgz\_fW2ha7q6BGRsUb-e9DZ0Pcb5zL\_HbRLbnvlhYCYi9rPmYOYG6BronvLwB8sg2kVubLQGn\_ASbK\_FW8bKPhqH4BL2\_JunGBzUKJPL9yNvOnFy7VKwlvH1OKUqKlCYbewOtUd1utcMNIb\_AbSGRtzJKslbE5VwQtL5bZ34kOCNH07gSolSGvqqw4dyxU4l0QSVXVmqgVYdKfA","expires_in": 3600,"token_type": "Bearer"}
Was this article helpful?