天天看点

使用postman创建Marketing Cloud的Contact

首先在Marketing Cloud的UI上创建一个contact:

使用postman创建Marketing Cloud的Contact
观察Chrome开发者工具network标签页里的HTTP请求: https://jerry.gcdemo.hybris.com/sap/opu/odata/sap/CUAN_COMMON_SRV/?sap-client=100 这个请求用于读取CSRF token:
使用postman创建Marketing Cloud的Contact
点击保存,会发送一个新的HTTP post请求:
使用postman创建Marketing Cloud的Contact
请求url: https://jerry.hybris.com/sap/opu/odata/sap/CUAN_COMMON_SRV/ContactPersons?sap-client=100 再看下重要的请求头部字段:
使用postman创建Marketing Cloud的Contact
把第一步获得的CSRF token填到Postman里的header字段里,如图:
使用postman创建Marketing Cloud的Contact
body:

{"CountryCode":"CN","City":"Chengdu","FirstName":"Jerry1","LastName":"Wang1","PostalCode":"610093","RegionCode":"","Street":"天府软件园","HouseNumber":"天府软件园","DateofBirth":null,"ContactPersonFacets":[{"Id":"[email protected]","IdOrigin":"EMAIL","Obsolete":false,"Invalid":false},{"Id":"","IdOrigin":"PHONE","Obsolete":false,"Invalid":false},{"Id":"","IdOrigin":"MOBILE","Obsolete":false,"Invalid":false},{"Id":"","IdOrigin":"FAX","Obsolete":false,"Invalid":false}],"IsConsumer":true,"Filter":{"MarketingAreaId":"CXXGLOBAL"}}           
使用postman创建Marketing Cloud的Contact

状态码201,证明创建成功了:

使用postman创建Marketing Cloud的Contact

可以在前端看到创建成功的contact:

使用postman创建Marketing Cloud的Contact

本文来自云栖社区合作伙伴“汪子熙”,了解相关信息可以关注微信公众号"汪子熙"。

继续阅读