首先在 Marketing Cloud 的 UI 上创建一个 contact:
观察 Chrome 开发者工具 network 标签页里的 HTTP 请求:
https://jerry.gcdemo.hybris.c…
这个请求用于读取 CSRF token:
点击保存,会发送一个新的 HTTP post 请求:
请求 url:
https://jerry.hybris.com/sap/…
再看下重要的请求头部字段:
把第一步获得的 CSRF token 填到 Postman 里的 header 字段里,如图:
body:
{"CountryCode":"CN","City":"Chengdu","FirstName":"Jerry1","LastName":"Wang1","PostalCode":"610093","RegionCode":"","Street":" 天府软件园 ","HouseNumber":" 天府软件园 ","DateofBirth":null,"ContactPersonFacets":[{"Id":"jerry1@sap.com","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"}}
状态码 201,证明创建成功了:
可以在前端看到创建成功的 contact:
要获取更多 Jerry 的原创文章,请关注公众号 ” 汪子熙 ”: