Skip to main content
Integrations API - Overview
Updated this week

The Jebbit Integrations API is a webhook service that Jebbit will provide to our customers as a way to receive real time access to user session data - which includes unique identifiers, attributes, outcomes, channel and more!


Overview

The Integrations API enables clients to integrate quickly as opposed to setting up a custom integration with the Jebbit integrations team. You can get setup within 48 hours! Here is the API documentation site and below are some articles on how to get started with it.

Authentication

All API interactions will require a valid access token from Auth0 to interact with Jebbit’s API application. Please speak with your Jebbit Customer Success Representative to request your account's Auth0 API client_id and client_secret needed to generate the access token. There are four parameters that need to be included in your request to receive your Auth0 token:

Header

Value

Type

Description

client_id

your client id

string

Provided to you by Jebbit

client_secret

your client secret

string

Provided to you by Jebbit

audience

public-api

string

grant_type

client_credentials

string

Example Request:

curl -X POST "https://auth.jebbit.com/oauth/token" \ -d '{"client_id": "client_id", "client_secret": "client_secret", "audience": "public-api", "grant_type": "client_credentials"}'

Example Response:

{ "access_token":"YOUR.JWT.HERE", "scope":"read:business:abc123 read:integration write:integration", "expires_in":86400, "token_type":"Bearer" }

All generated tokens are valid for 24 hours. Please generate one token and reuse it throughout that time frame.

Making API Requests:

Jebbit requires your API key to be included in all API requests to the server in a header that looks like the following: Authorization: Bearer YOUR.JWT.HERE. You must replace YOUR.JWT.HERE with your business API key.

Getting Started with the Integrations API

Once you've gone ahead and generated a JSON Web Token (JWT) as outlined in this article, you're now ready to begin exploring the Integrations API. Your Integrations API credentials are tied to your Jebbit account and all of the experiences you choose to build within that account. To view your currently authenticated Jebbit account, try the following request:

Example HTTP Request

GET /api/v1/self HTTP/1.1 Host: api.jebbx.com Authorization: Bearer <YOUR JWT>

*Note: Example is using the staging endpoint. Please use the production endpoint.

Example Response

{ "data": { "id": "bTUIhsye", "type": "businesses", "attributes": { "name": "Jebbit Internal" } } }

We now know that the Jebbit Account ID that is tied to our API credentials is bTUIhsye. Next, let's go ahead and set up the webhook service so that you may begin receiving user session data. Below is an example request to create a webhook service:

Example Request

POST /api/v1/integrations HTTP/1.1 Host: api.jebbx.com Content-Type: application/vnd.api+json Authorization: Bearer <YOUR JWT> Content-Length: 198{"data": { "attributes": { "endpoint": "<YOUR ENDPOINT>", "region": "us", "additional_options": { "hash_pii": false}, "is_active" : true}, "type": "integrations"}}

Note:

1.) This is using the staging endpoint. Please use the production endpoint.

2.) Please insert the endpoint of the service receiving our webhook where it says <YOUR ENDPOINT>.

Example Response

{ "data": { "id": "L5m24mjs", "type": "integrations", "attributes": { "endpoint": "<YOUR ENDPOINT>", "include_uids": false, "region": "us", "require_opt_in": null, "created_at": "2021-12-16T17:48:14.098Z", "updated_at": "2021-12-16T17:48:14.167Z", "service_name": "webhooks_standard", "include_mapped_attributes": true, "additional_options": { "hash_pii": false }, "is_active": true, "shared_secret": "Qq6niUmvrO320lYbBGKha6cdy22Bz8BVBd" } } }

The above response contains all the details about our newly created integration including its ID, type, and attributes. The shared_secret is one of the critical payload elements for you to retrieve as this is what will be used to authenticate and transmit data between our webhook and your receiving endpoint. After providing the endpoint system with the mutually shared_secret, you can send a test submission to validate it's working:

Example Request

POST /api/v1/integrations/L5m24mjs/test HTTP/1.1 Host: api.jebbx.com Authorization: Bearer <YOUR JWT> Content-Type: application/vnd.api+json Content-Length: 2{}

Example Response

["{\"data\":{\"email\":\"test@example.com\",\"test_attribute\":\"attribute_value\",\"test_sata_attribute\":[\"option 1\",\"option 4\"],\"opt_in\":\"true\",\"outcome\":\"example_outcome\"},\"event\":{\"event_number\":0}}"]

Did this answer your question?