The Twipla 3AS approach relies on a straightforward flow of data that can be easily integrated into any backend system.
intpId
(that can be used to create tokens) and a default set of packagesMost endpoints that deal with customers or websites support an external ID which can be provided and then used for all following requests.
For example creating a new customer with a website requires an intpCustomerId
and an intpWebsiteId
.
These must be provided by the INTP and are intended to make integrations easier because there is no need to save any external IDs.
Then when getting data about a customer the request is done using the same intpCustomerId
provided on creation.
Example implementation flow
jwtRS256.key.pub
) to the TWIPLA Dev TeamAll authentication is done based on JWT Tokens. These are created and signed by the INTP and validated by the TWIPLA API for each request using the public key provided in the on-boarding.
The token must be sent with every request as a Bearer token in the Authentication header Example:
Authentication: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
JWT tokens can be easily created in most programming languages using an appropriate library from jwt.io
INTP Token: Integration partner token used for endpoints that deal with modifying customers or websites
INTPC Token: Integration partner customer token used to give access to the dashboard and data of a particular customer
ssh-keygen -t rsa -b 2048 -m PEM -f jwtRS256.key
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
{
"alg": "RS256",
"typ": "JWT",
"kid": "UUID" // the id issued by TWIPLA for an INTP, in exchange for `jwtRS256.key.pub`
}
{
"roles": [
"intp"
],
"intp_id": "UUID" // the id issued by TWIPLA for an INTP, in exchange for `jwtRS256.key.pub`
"exp": 1667215913, // expires at
"iat": 1667215313 // issued at
}
To create the signature, you have to use the encoded header, the encoded payload, the generated private key and the algorithm specified in the header (e.g., "RS256").
{
"alg": "RS256",
"typ": "JWT",
"kid": "UUID" // the id issued by TWIPLA for an INTP, in exchange for `jwtRS256.key.pub`
}
{
"roles": [
"intpc"
],
"intp_id": "UUID" // the id issued by TWIPLA for an INTP, in exchange for `jwtRS256.key.pub`
"intpc_id": "string" // the id issued by the INTP for a customer (INTPC)
"exp": 1667215913,
"iat": 1667215313
}
To create the signature, you have to use the encoded header, the encoded payload, the generated private key and the algorithm specified in the header (e.g., "RS256").
Create a new INTP Customer
Data about the INTPC
intpCustomerId required | string <uuid> (id) |
email required | string <email> (email) |
required | object (CreateWebsite) |
{- "intpCustomerId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "email": "mail@visitor-analytics.io",
- "website": {
- "intpWebsiteId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "intpCustomerId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "packageId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "domain": "bigstuff.visitoranalytics.io",
- "billingDate": "2023-08-22T08:14:03+00:00"
}
}
{- "payload": {
- "id": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "visaId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "intpCustomerId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "email": "mail@visitor-analytics.io",
- "intpId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "createdAt": "2023-08-22T08:14:03+00:00"
}
}
page required | number |
pageSize required | number |
{- "payload": [
- {
- "id": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "visaId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "intpCustomerId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "email": "mail@visitor-analytics.io",
- "intpId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "createdAt": "2023-08-22T08:14:03+00:00"
}
], - "meta": {
- "page": 1,
- "pageSize": 10,
- "pageTotal": 100,
- "total": 92
}
}
intpCustomerId required | string ID issued by INTP |
{- "payload": {
- "id": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "visaId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "intpCustomerId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "email": "mail@visitor-analytics.io",
- "intpId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "createdAt": "2023-08-22T08:14:03+00:00"
}
}
intpCustomerId required | string ID issued by INTP |
{- "payload": {
- "id": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "visaId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "intpCustomerId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "email": "mail@visitor-analytics.io",
- "intpId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "createdAt": "2023-08-22T08:14:03+00:00"
}
}
name required | string (name) |
price required | number (price) |
currency required | string (currency) Value: "EUR" |
touchpoints required | number (touchpoints) >= 400 |
period required | string (period) Enum: "monthly" "yearly" |
{- "name": "string",
- "price": 12.99,
- "currency": "EUR",
- "touchpoints": 400,
- "period": "monthly"
}
{- "payload": {
- "id": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "name": "string",
- "touchpoints": 400,
- "intpId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "price": 12.99,
- "currency": "EUR",
- "period": "monthly",
- "recommended": true,
- "createdAt": "2023-08-22T08:14:03+00:00"
}
}
{- "payload": [
- {
- "id": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "name": "string",
- "touchpoints": 400,
- "intpId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "price": 12.99,
- "currency": "EUR",
- "period": "monthly",
- "recommended": true,
- "createdAt": "2023-08-22T08:14:03+00:00"
}
]
}
packageId required | string ID issued by VisitorAnalytics |
{- "payload": {
- "id": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "name": "string",
- "touchpoints": 400,
- "intpId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "price": 12.99,
- "currency": "EUR",
- "period": "monthly",
- "recommended": true,
- "createdAt": "2023-08-22T08:14:03+00:00"
}
}
intpWebsiteId required | string <uuid> (id) |
intpCustomerId required | string <uuid> (id) |
packageId required | string <uuid> (id) |
domain required | string <uri> (domain) |
billingDate | string <date> (date) |
{- "intpWebsiteId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "intpCustomerId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "packageId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "domain": "bigstuff.visitoranalytics.io",
- "billingDate": "2023-08-22T08:14:03+00:00"
}
{- "payload": {
- "id": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "status": "string",
- "intpId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "intpWebsiteId": "string",
- "intpCustomerId": "string",
- "visaTrackingCode": "string",
- "domain": "bigstuff.visitoranalytics.io",
- "packageId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "packageName": "string",
- "billingInterval": "monthly",
- "lastPackageChangeAt": "2023-08-22T08:14:03+00:00",
- "plannedDowngradePackageId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "plannedDowngradePackageName": "string",
- "plannedDowngradeBillingInterval": "monthly",
- "inTrial": true,
- "hadTrial": true,
- "createdAt": "2023-08-22T08:14:03+00:00",
- "expiresAt": "2023-08-22T08:14:03+00:00",
- "stpResetAt": "2023-08-22T08:14:03+00:00",
- "consumption": {
- "stpLimit": 400,
- "stpConsumed": 400,
- "stpRateVisit": 400,
- "stpConsumedVisit": 400,
- "stpRateVisitEvent": 400,
- "stpConsumedVisitEvent": 400,
- "stpRateSessionRecording": 400,
- "stpConsumedSessionRecording": 400,
- "stpRateHeatmapIncrement": 400,
- "stpConsumedHeatmapIncrement": 400,
- "stpRatePollAnswer": 400,
- "stpConsumedPollAnswer": 400,
- "stpRateSurveyAnswer": 400,
- "stpConsumedSurveyAnswer": 400,
- "stpRateFunnelMatch": 400,
- "stpConsumedFunnelMatch": 400
}
}
}
{- "payload": [
- {
- "id": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "status": "string",
- "intpId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "intpWebsiteId": "string",
- "intpCustomerId": "string",
- "visaTrackingCode": "string",
- "domain": "bigstuff.visitoranalytics.io",
- "packageId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "packageName": "string",
- "billingInterval": "monthly",
- "lastPackageChangeAt": "2023-08-22T08:14:03+00:00",
- "plannedDowngradePackageId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "plannedDowngradePackageName": "string",
- "plannedDowngradeBillingInterval": "monthly",
- "inTrial": true,
- "hadTrial": true,
- "createdAt": "2023-08-22T08:14:03+00:00",
- "expiresAt": "2023-08-22T08:14:03+00:00",
- "stpResetAt": "2023-08-22T08:14:03+00:00",
- "consumption": {
- "stpLimit": 400,
- "stpConsumed": 400,
- "stpRateVisit": 400,
- "stpConsumedVisit": 400,
- "stpRateVisitEvent": 400,
- "stpConsumedVisitEvent": 400,
- "stpRateSessionRecording": 400,
- "stpConsumedSessionRecording": 400,
- "stpRateHeatmapIncrement": 400,
- "stpConsumedHeatmapIncrement": 400,
- "stpRatePollAnswer": 400,
- "stpConsumedPollAnswer": 400,
- "stpRateSurveyAnswer": 400,
- "stpConsumedSurveyAnswer": 400,
- "stpRateFunnelMatch": 400,
- "stpConsumedFunnelMatch": 400
}
}
]
}
intpWebsiteId required | string ID issued by INTP |
{- "payload": {
- "id": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "status": "string",
- "intpId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "intpWebsiteId": "string",
- "intpCustomerId": "string",
- "visaTrackingCode": "string",
- "domain": "bigstuff.visitoranalytics.io",
- "packageId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "packageName": "string",
- "billingInterval": "monthly",
- "lastPackageChangeAt": "2023-08-22T08:14:03+00:00",
- "plannedDowngradePackageId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "plannedDowngradePackageName": "string",
- "plannedDowngradeBillingInterval": "monthly",
- "inTrial": true,
- "hadTrial": true,
- "createdAt": "2023-08-22T08:14:03+00:00",
- "expiresAt": "2023-08-22T08:14:03+00:00",
- "stpResetAt": "2023-08-22T08:14:03+00:00",
- "consumption": {
- "stpLimit": 400,
- "stpConsumed": 400,
- "stpRateVisit": 400,
- "stpConsumedVisit": 400,
- "stpRateVisitEvent": 400,
- "stpConsumedVisitEvent": 400,
- "stpRateSessionRecording": 400,
- "stpConsumedSessionRecording": 400,
- "stpRateHeatmapIncrement": 400,
- "stpConsumedHeatmapIncrement": 400,
- "stpRatePollAnswer": 400,
- "stpConsumedPollAnswer": 400,
- "stpRateSurveyAnswer": 400,
- "stpConsumedSurveyAnswer": 400,
- "stpRateFunnelMatch": 400,
- "stpConsumedFunnelMatch": 400
}
}
}
intpWebsiteId required | string ID issued by INTP |
{- "payload": {
- "id": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "status": "string",
- "intpId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "intpWebsiteId": "string",
- "intpCustomerId": "string",
- "visaTrackingCode": "string",
- "domain": "bigstuff.visitoranalytics.io",
- "packageId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "packageName": "string",
- "billingInterval": "monthly",
- "lastPackageChangeAt": "2023-08-22T08:14:03+00:00",
- "plannedDowngradePackageId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "plannedDowngradePackageName": "string",
- "plannedDowngradeBillingInterval": "monthly",
- "inTrial": true,
- "hadTrial": true,
- "createdAt": "2023-08-22T08:14:03+00:00",
- "expiresAt": "2023-08-22T08:14:03+00:00",
- "stpResetAt": "2023-08-22T08:14:03+00:00",
- "consumption": {
- "stpLimit": 400,
- "stpConsumed": 400,
- "stpRateVisit": 400,
- "stpConsumedVisit": 400,
- "stpRateVisitEvent": 400,
- "stpConsumedVisitEvent": 400,
- "stpRateSessionRecording": 400,
- "stpConsumedSessionRecording": 400,
- "stpRateHeatmapIncrement": 400,
- "stpConsumedHeatmapIncrement": 400,
- "stpRatePollAnswer": 400,
- "stpConsumedPollAnswer": 400,
- "stpRateSurveyAnswer": 400,
- "stpConsumedSurveyAnswer": 400,
- "stpRateFunnelMatch": 400,
- "stpConsumedFunnelMatch": 400
}
}
}
intpWebsiteId required | string |
packageId required | string <uuid> (id) |
trial | boolean |
proRate | boolean Default: true |
{- "intpWebsiteId": "string",
- "packageId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "trial": true,
- "proRate": true
}
{- "payload": {
- "id": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "status": "string",
- "packageId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "websiteId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "intpId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "intpcId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "expiresAt": "2023-08-22T08:14:03+00:00",
- "stpResetAt": "2023-08-22T08:14:03+00:00",
- "lastPackageChangeAt": "2023-08-22T08:14:03+00:00",
- "createdAt": "2023-08-22T08:14:03+00:00",
- "billingInterval": "monthly",
- "type": "aaas",
- "inTrial": true,
- "hadTrial": true,
- "plannedDowngradePackageId": "7128840a-5347-49a4-8dfa-9022d8dad21a"
}
}
intpWebsiteId required | string |
packageId required | string <uuid> (id) |
{- "intpWebsiteId": "string",
- "packageId": "7128840a-5347-49a4-8dfa-9022d8dad21a"
}
{- "payload": {
- "id": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "status": "string",
- "packageId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "websiteId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "intpId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "intpcId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "expiresAt": "2023-08-22T08:14:03+00:00",
- "stpResetAt": "2023-08-22T08:14:03+00:00",
- "lastPackageChangeAt": "2023-08-22T08:14:03+00:00",
- "createdAt": "2023-08-22T08:14:03+00:00",
- "billingInterval": "monthly",
- "type": "aaas",
- "inTrial": true,
- "hadTrial": true,
- "plannedDowngradePackageId": "7128840a-5347-49a4-8dfa-9022d8dad21a"
}
}
intpWebsiteId required | string |
{- "intpWebsiteId": "string"
}
{- "payload": {
- "id": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "status": "string",
- "packageId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "websiteId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "intpId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "intpcId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "expiresAt": "2023-08-22T08:14:03+00:00",
- "stpResetAt": "2023-08-22T08:14:03+00:00",
- "lastPackageChangeAt": "2023-08-22T08:14:03+00:00",
- "createdAt": "2023-08-22T08:14:03+00:00",
- "billingInterval": "monthly",
- "type": "aaas",
- "inTrial": true,
- "hadTrial": true,
- "plannedDowngradePackageId": "7128840a-5347-49a4-8dfa-9022d8dad21a"
}
}
intpWebsiteId required | string |
{- "intpWebsiteId": "string"
}
{- "payload": {
- "id": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "status": "string",
- "packageId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "websiteId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "intpId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "intpcId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "expiresAt": "2023-08-22T08:14:03+00:00",
- "stpResetAt": "2023-08-22T08:14:03+00:00",
- "lastPackageChangeAt": "2023-08-22T08:14:03+00:00",
- "createdAt": "2023-08-22T08:14:03+00:00",
- "billingInterval": "monthly",
- "type": "aaas",
- "inTrial": true,
- "hadTrial": true,
- "plannedDowngradePackageId": "7128840a-5347-49a4-8dfa-9022d8dad21a"
}
}
intpWebsiteId required | string |
{- "intpWebsiteId": "string"
}
{- "payload": {
- "id": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "status": "string",
- "packageId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "websiteId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "intpId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "intpcId": "7128840a-5347-49a4-8dfa-9022d8dad21a",
- "expiresAt": "2023-08-22T08:14:03+00:00",
- "stpResetAt": "2023-08-22T08:14:03+00:00",
- "lastPackageChangeAt": "2023-08-22T08:14:03+00:00",
- "createdAt": "2023-08-22T08:14:03+00:00",
- "billingInterval": "monthly",
- "type": "aaas",
- "inTrial": true,
- "hadTrial": true,
- "plannedDowngradePackageId": "7128840a-5347-49a4-8dfa-9022d8dad21a"
}
}