Tech Note: The API response only contains data from one application in my subscription
Issue
By default, the Pendo API will only return data for the default application in the subscription. This is typically the original web application that is generated when a subscription is first created.
If the Pendo subscription has only one web application, you will never have this issue when pulling data via the API because you will always be requesting data from the default application.
However, if you have a multi-app subscription, which is a subscription with more than one application, you will need to modify your API request to get the desired data. You will also need to take these steps if you have only one mobile application, since a mobile application will never be the default application in a subscription.
In this post, we’ll explain how to:
- Request data from all applications in the subscription
- Request data from only a specific application in the subscription
Please note that all examples below use the Pendo US instance endpoints of https://app.pendo.io. If your subscription is in the Pendo EU instance, you will need to use https://app.eu.pendo.io instead.
Requesting data from all applications
Requesting page/feature/guide information
Add ?expand=* to the end of each endpoint to get a list of all pages, features or guides from all applications in the subscription.
- https://app.pendo.io/api/v1/page?expand=*
- https://app.pendo.io/api/v1/feature?expand=*
- https://app.pendo.io/api/v1/guide?expand=*
Requesting event data (aggregation endpoint)
When using the aggregation endpoint (https://app.pendo.io/api/v1/aggregation), add "appId": "expandAppIds(\"*\")" to the request body within the rowSource. This will request event data from all applications in the subscription. Below is an example request for page events:
{
"channelId": "",
"response": {
"location": "request",
"mimeType": "application/json"
},
"request": {
"name": "",
"pipeline": [{
"source": {
"pageEvents": {
"appId": "expandAppIds(\"*\")"
},
"timeSeries": {
"period": "dayRange",
"first": "now()",
"count": -1
}
}
}],
"requestId": ""
}
}
Requesting data from a specific application
You will need to find your application ID using the instructions in the last section of this post. Use that application ID to replace {{applicationId}} in the instructions below.
Requesting page/feature/guide information
Add ?appId={{applicationId}} to the end of each endpoint to get a list of all pages, features or guides from a specific application in the subscription.
- https://app.pendo.io/api/v1/page?appId={{applicationId}}
- https://app.pendo.io/api/v1/feature?appId={{applicationId}}
- https://app.pendo.io/api/v1/guide?appId={{applicationId}}
Requesting event data (aggregation endpoint)
When using the aggregation endpoint (https://app.pendo.io/api/v1/aggregation), add "appId": {{applicationId}} to the request body within the rowSource. Below is an example request for page events using the applicationId of 1111111111111111.
{
"channelId": "",
"response": {
"location": "request",
"mimeType": "application/json"
},
"request": {
"name": "",
"pipeline": [{
"source": {
"pageEvents": {
"appId": 1111111111111111
},
"timeSeries": {
"period": "dayRange",
"first": "now()",
"count": -1
}
}
}],
"requestId": ""
}
}
Finding the application ID
Finding the application ID is necessary if you want to request data from only a specific application, instead of all applications in your subscription. Within Pendo, go to Settings > Subscription Settings, and click on View App Details for the specific application. When the new page loads, the URL will look something like this:
https://app.pendo.io/s/{{subscriptionId}}/admin/app/{{applicationId}}?tab=details
The {{applicationId}} value is what you are looking for. For the default app, it will always be -323232. For other applications, it will be a longer number such as '1111111111111111'
Other things to be aware of:
- Please note that the application ID is not the same as your application key.
- The URL domain could be different if you are in another Pendo instance, such as Pendo EU Instance (app.eu.pendo.io)
- Each subscription has a unique value for {{subscriptionId}}. Don’t mix this up with the application ID. The subscription ID value will be the same as you click ‘View App Details’ for different applications in your subscription.
Additional Documentation
This is meant to supplement the Multi-App section of our official Developer Documentation: https://engageapi.pendo.io/
Comments
Post is closed for comments.