使用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