Download scores in Customer AI
This document serves as a guide for downloading scores for Customer AI.
Getting started
Customer AI allows you to download scores in the Parquet file format. This tutorial requires that you have read and finished the downloading Customer AI scores section in the getting started guide.
Additionally, in order to access scores for Customer AI, you need to have a service instance with a successful run status available. To create a new service instance, visit Configuring a Customer AI instance. If you recently created a service instance and it is still training and scoring, please allow 24 hours for it to finish running.
Currently, there are two ways to download Customer AI scores:
- If you want to download the scores at the individual level and/or do not have Real-Time Customer Profile enabled, start by navigating to finding your dataset ID.
- If you have Profile enabled and want to download segments that you have configured using Customer AI, please navigate to download a segment configured with Customer AI.
Find your dataset ID dataset-id
Within your service instance for Customer AI insights, click the More actions dropdown in the top-right navigation then select Access scores.
A new dialog appears, containing a link to the downloading scores documentation and the dataset ID for your current instance. Copy the dataset ID to your clipboard and proceed to the next step.
Retrieve your batch ID retrieve-your-batch-id
Using your dataset ID from the previous step, you need to make a call to the Catalog API in order to retrieve a batch ID. Additional query parameters are used for this API call in order to return the latest successful batch instead of a list of batches belonging to your organization. To return additional batches, increase the number for the limit query parameter to the desired amount you wish to be returned. For more information on the types of query parameters available, visit the guide on filtering Catalog data using query parameters.
API format
GET /batches?&dataSet={DATASET_ID}&createdClient=acp_foundation_push&status=success&orderBy=desc:created&limit=1
{DATASET_ID}
Request
curl -X GET 'https://platform.adobe.io/data/foundation/catalog/batches?dataSet=5cd9146b31dae914b75f654f&createdClient=acp_foundation_push&status=success&orderBy=desc:created&limit=1' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
Response
A successful response returns a payload containing a batch ID object. In this example, the key value to the object returned is the batch ID 01E5QSWCAASFQ054FNBKYV6TIQ
. Copy your batch ID to use in the next API call.
{
"01E5QSWCAASFQ054FNBKYV6TIQ": {
"status": "success",
"tags": {
"Tags": [ ... ],
},
"relatedObjects": [
{
"type": "dataSet",
"id": "5cd9146b31dae914b75f654f"
}
],
"id": "01E5QSWCAASFQ054FNBKYV6TIQ",
"externalId": "01E5QSWCAASFQ054FNBKYV6TIQ",
"replay": {
"predecessors": [
"01E5N7EDQQP4JHJ93M7C3WM5SP"
],
"reason": "Replacing for 2020-04-09",
"predecessorListingType": "IMMEDIATE"
},
"inputFormat": {
"format": "parquet"
},
"imsOrg": "412657965Y566A4A0A495D4A@۶ƵOrg",
"started": 1586715571808,
"metrics": {
"partitionCount": 1,
"outputByteSize": 2380339,
"inputFileCount": -1,
"inputByteSize": 2381007,
"outputRecordCount": 24340,
"outputFileCount": 1,
"inputRecordCount": 24340
},
"completed": 1586715582735,
"created": 1586715571217,
"createdClient": "acp_foundation_push",
"createdUser": "sensei_exp_attributionai@۶ƵID",
"updatedUser": "acp_foundation_dataTracker@۶ƵID",
"updated": 1586715583582,
"version": "1.0.5"
}
}
Retrieve the next API call with your batch ID retrieve-the-next-api-call-with-your-batch-id
Once you have your batch ID, you are able to make a new GET request to /batches
. The request returns a link thats used as the next API request.
API format
GET batches/{BATCH_ID}/files
{BATCH_ID}
Request
Using your own batch ID, make the following request.
curl -X GET 'https://platform.adobe.io/data/foundation/export/batches/035e2520-5e69-11ea-b624-51evfeba55d1/files' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
Response
A successful response returns a payload containing a _links
object. Within the _links
object is an href
with a new API call as its value. Copy this value to proceed to the next step.
{
"data": [
{
"dataSetFileId": "035e2520-5e69-11ea-b624-51ecfeba55d0-1",
"dataSetViewId": "5e3b2fe3fe4b9f18a8b7a3db",
"version": "1.0.0",
"created": "1583361894479",
"updated": "1583361894479",
"isValid": false,
"_links": {
"self": {
"href": "https://platform.adobe.io:443/data/foundation/export/files/035e2520-5e69-11ea-b624-51ecfeba55d0-1"
}
}
}
],
"_page": {
"limit": 100,
"count": 1
}
}
Retrieve your files retrieving-your-files
Using the href
value you got in the previous step as an API call, make a new GET request to retrieve your file directory.
API format
GET files/{DATASETFILE_ID}
{DATASETFILE_ID}
href
value from the previous step. It is also accessible in the data
array under the object type dataSetFileId
.Request
curl -X GET 'https://platform.adobe.io:443/data/foundation/export/files/035e2520-5e69-11ea-b624-51ecfeba55d0-1' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
Response
The response contains a data array that may have a single entry, or a list of files belonging to that directory. The example below contains a list of files and has been condensed for readability. In this scenario, you need to follow the URL of each file in order to access the file.
{
"data": [
{
"name": "part-00000-tid-7597930103898538622-a25f1890-efa9-40eb-a2cb-1b378e93d582-528-1-c000.snappy.parquet",
"length": "16214531",
"_links": {
"self": {
"href": "https://platform.adobe.io:443/data/foundation/export/files/035e2520-5e69-11ea-b624-51ecfeba55d0-1?path=part-00000-tid-7597930103898538622-a25f1890-efa9-40eb-a2cb-1b378e93d582-528-1-c000.snappy.parquet"
}
}
},
{
"name": "...",
"length": "16235375",
"_links": {
"self": {
"href": "..."
}
}
}
],
"_page": {
"limit": 100,
"count": 100
},
"_links": {
"next": {
"href": "..."
},
"page": {
"href": "...",
"templated": true
}
}
}
_links.self.href
Copy the href
value for any file object in the data
array, then proceed to the next step.
Download your file data
To download your file data, make a GET request to the "href"
value you copied in the previous step retrieving your files.
--output {FILENAME.FILETYPE}
.API format
GET files/{DATASETFILE_ID}?path={FILE_NAME}
{DATASETFILE_ID}
href
value from a previous step.{FILE_NAME}
Request
curl -X GET 'https://platform.adobe.io:443/data/foundation/export/files/035e2520-5e69-11ea-b624-51ecfeba55d0-1?path=part-00000-tid-7597930103898538622-a25f1890-efa9-40eb-a2cb-1b378e93d582-528-1-c000.snappy.parquet' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-O 'filename.parquet'
Response
The response downloads the file you requested in in your current directory. In this example the filename is “filename.parquet”.
Download a segment configured with Customer AI segment
An alternative way to download your score data is by exporting your audience to a dataset. After a segmentation job has successfully completed (the value of the status
attribute is “SUCCEEDED”), you can export your audience to a dataset where it can be accessed and acted upon. To learn more about segmentation, visit the segmentation overview.
The export a segment section in the segment evaluation guide covers the required steps to export an audience dataset. The guide outlines and provides examples of the following:
- Create a target dataset: Create the dataset to hold audience members.
- Generate audience profiles in the dataset: Populate the dataset with XDM Individual Profiles based on the results of a segment job.
- Monitor export progress: Check the current progress of the export process.
- Read audience data: Retrieve the resulting XDM Individual Profiles representing the members of your audience.
Next steps
This document outlined the steps required for downloading Customer AI scores. You can now continue to browse the other Intelligent Services and guides that are offered.