检索用户档案是使用 GET 请求。
然后,您可以使用过滤器、排序和分页来优化搜索。 有关详细信息,请参见 其他操作 部分。
此外,Campaign StandardAPI允许您根据以下字段之一搜索用户档案:电子邮件、名字、姓氏或任何自定义字段。 如需详细信息,请参阅此部分。
示例请求
用于检索所有配置文件的示例GET请求。
-X GET https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Cache-Control: no-cache' \
-H 'X-Api-Key: <API_KEY>'
对请求的响应。
{
"content": [
{
"PKey": "<PKEY>",
"firstName": "John",
"lastName":"Doe",
"birthDate": "1980-10-24",
...
},
...
}
用于检索前10个电子邮件值的示例GET请求。
-X GET https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile/email?_lineCount=10 \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Cache-Control: no-cache' \
-H 'X-Api-Key: <API_KEY>'
对请求的响应。 “next”节点会返回用于访问10个下一个电子邮件值的URL。
{
"content": [
"amy.dakota@mail.com",
"kristen.smith@mail.com",
"omalley@mail.com",
"xander.harrys@mail.com",
"jane.summer@mail.com",
"gloria.boston@mail.com",
"edward.snow@mail.com",
"dorian.simons@mail.com",
"peter.paolini@mail.com",
"mingam+test08@adobe.com"
],
"next": {
"href": "https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile/email?_lineCount=10&_
lineStart=@Qy2MRJCS67PFf8soTf4BzF7BXsq1Gbkp_e5lLj1TbE7HJKqc"
}
}
此 filterType 参数允许您根据以下字段之一检索用户档案:电子邮件、名字、姓氏,或在扩展用户档案资源时已在高级筛选中添加的任何自定义字段。
搜索区分大小写,并且只对前缀执行。 例如,您将无法使用用户档案的姓氏查找用户档案。
示例请求
根据名字筛选用户档案的示例请求。
-X GET https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile/byText?text=John&filterType=firstName \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Cache-Control: no-cache' \
-H 'X-Api-Key: <API_KEY>'
根据姓氏筛选用户档案的示例请求。
-X GET https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile/byText?text=Miller&filterType=lastName \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Cache-Control: no-cache' \
-H 'X-Api-Key: <API_KEY>'
根据电子邮件筛选用户档案的示例请求。
-X GET https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile/byText?text=John%40gmail.com&filterType=email \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Cache-Control: no-cache' \
-H 'X-Api-Key: <API_KEY>'
根据“爱好”自定义字段筛选用户档案的示例请求。
-X GET https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServicesExt/profile/byText?cusHobby=Dancing&filterType=Hobby \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Cache-Control: no-cache' \
-H 'X-Api-Key: <API_KEY>'