Show Menu
主题×

获取/发布/修补/删除动词

对资源执行操作的可用动词有:
  • GET :检索一个元素或元素集合
  • POST :使用参数创建资源。
  • PATCH :使用参数更新资源。
  • DELETE :删除资源。
示例请求
  • 配置文件集合上的示例GET请求。
    $curl  
    -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": "Olivia",
                "lastName": "Varney",
                "birthDate": "1977-09-°4",
                "email": "o.varney@mail.com",
            },
            {
                "PKey": "<PKEY>",
                "firstName": "John",
                "lastName": "Doe",
                "birthDate": "1985-08-17",
                "email": "johndoe@mail.com",
            }
        ],
    }
    
    
  • 特定配置文件上的示例GET请求。
    $curl  
    -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>'
    
    
    它返回所请求的配置文件。
    {
        "PKey": "<PKEY>",
        "firstName": "John",
        "lastName": "Doe",
        "birthDate": "1985-08-17",
        "email": "johndoe@mail.com",
        ...
    }
    
    
  • 创建配置文件的POST请求示例。
    -X POST 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>' \
    -d '{"lastName":"Doe"}'
    
    
    它返回带有默认字段的配置文件。
    {
        "PKey": "<PKEY>",
        "firstName": "John",
        "lastName": "Doe",
        "birthDate": "1985-08-17",
        "email": "johndoe@mail.com",
    }
    
    
  • 用于更新配置文件的示例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 '{"firstName":"Mark"',"lastName":"Smith"}'
    
    
    它返回PKEY和URL以检索更新的配置文件。
    {
        "PKey": "<PKEY>",
        "href": "https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile/<PKEY>"
    }
    
    
  • 删除配置文件的DELETE请求示例。
    -X DELETE 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>'
    
    
    请求返回200个响应,确认已删除配置文件。