使用API更新用户档案 updating-profiles-api

更新配置文件是通过​ PATCH ​请求执行的。

https://mc.adobe.io/<ORGANIZATION>/campaign/<apiName>/<resourceName>/<PKEY>

  1. 第一步是​ 检索配置文件

  2. 在第二个请求中,对有效负荷中具有已完成信息的配置文件执行​ PATCH请求

  3. 要检查PATCH请求是否已更新配置文件,我们可以执行最终的GET请求。

示例请求

用于检索配置文件的示例GET请求。

-X GET https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile/<PKEY>\
-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": "Amy",
            "lastName":"Dakota",
            "birthDate": "1980-10-24",
            ...
        }
    ]
}

更新“phone”属性的PATCH请求。

-X PATCH https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile/<PKEY> \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Cache-Control: no-cache' \
-H 'X-Api-Key: <API_KEY>' \
-d '{"phone":"3301020304"}'

它会返回PKEY和URL以检索更新的配置文件。

{
    "PKey": "<PKEY>",
    "href": "https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile/@2v1dr3ZKJveMDhAdh0MPnh9hNQQ93qb7AW6BNVVKknjwXvTZRBAgUqz1SNcB4ZndgjqOofx3BwBZYBftlmObISoM3rs"
}
recommendation-more-help
3ef63344-7f3d-48f9-85ed-02bf569c4fff