User Export API
Use the User Export API to export user data such as segments, engagement scores, changes in engagement scores, and user activity from Marketing Cloud Personalization datasets for use in other systems.
Your Personalization contract defines the volume of records you can export using the User Export API. For more information, refer to your contract or contact your account representative.
GET
/api/dataset/<datasetId>/users.< json | csv >
https://<accountName>.<instance>.evergage.com/api/dataset/<datasetId>/users.< json | csv >
URL Parameter | Required? | Description |
---|---|---|
accountName | Yes | The Personalization account name. You can find the accountName by accessing Gears from the Personalization UI and reviewing the URL. For example, if the Gears URL is https://demo.us-1.evergage.com/ , then the account name is demo . |
instance | Yes | The Personalization instance identifier. You can find this value by accessing Gears from the Personalization UI and reviewing the URL. For example, if the Gears URL is https://demo.us-1.evergage.com/ , then the instance identifier is us-1 . |
datasetId | Yes | The name or identifier of the Personalization dataset you’re exporting user data from. |
filter | No | Optional Segment name or ID |
start | No | Optional start time in epoch milliseconds used for engagement statistics |
end | No | Optional end time in epoch milliseconds used for engagement statistics |
segmentationId | No | Optional segmentation identifier |
segmentId | No | Optional segment identifier |
pageSize | No | Number of records to return. Returns all records unless specified. |
page | No | Page number of records to show, starting at zero for the first page. Starts at zero unless specified. |
includeGeo | No | Set as true to include user location details |
Authorization: Basic <base64-encoded-API-token>
The User Export API uses API tokens to authenticate requests. Your API token must be a strict Base64 encoding of your API Key ID and its API Secret Key, separated by a colon. You can use an existing API token if it has the required permissions. Alternatively, you can ask an account administrator to generate a new one from the Personalization UI. For more information on API tokens, see Personalization API Tokens on Salesforce Help.
Alternatively, if you use cURL to interact with the API, you can send your API Key ID and its API Key Secret using the -u "apiKeyId:apiKeySecret"
command-line option. cURL automatically converts the apiKeyId:apiKeySecret
pair into a Base64-encoded string and adds the Authorization: Basic <base64-encoded-API-token>
to the request header. For an example of how to pass your API credentials in a cURL request, refer to the Example section in this article.
The following is an example GET request sent using cURL that retrieves user data in the JSON format from the specified Personalization dataset.
The following example request passes API credentials using the -u
command-line option.
The preceding example cURL request generates this example response in the JSON format.
Here's an example in Node.js of how you can use the User Export API. In this example, the fetchEvergageData()
function is called with the appropriate parameters to log user data from the specified Personalization dataset to the console.
Exporting a large number of users can result in duplicate entries for the same user, especially if the user is updated just before or while the export is being processed. In such cases, the most current record for that user is always the last one in the export.
- Salesforce Help: Personalization API Tokens