使用postman创建Marketing Cloud的Contact
2023-09-14 09:02:52 时间
首先在Marketing Cloud的UI上创建一个contact:
![](https://user-images.githubusercontent.com/5669954/57500773-3c065200-7317-11e9-9a63-6caba654e4df.png)
观察Chrome开发者工具network标签页里的HTTP请求:
https://jerry.gcdemo.hybris.com/sap/opu/odata/sap/CUAN_COMMON_SRV/?sap-client=100
这个请求用于读取CSRF token:
![](https://user-images.githubusercontent.com/5669954/57500766-3a3c8e80-7317-11e9-90e0-c5f7d1a60b0a.png)
点击保存,会发送一个新的HTTP post请求:
![](https://user-images.githubusercontent.com/5669954/57500767-3a3c8e80-7317-11e9-851c-39fcb182a037.png)
请求url:
https://jerry.hybris.com/sap/opu/odata/sap/CUAN_COMMON_SRV/ContactPersons?sap-client=100
再看下重要的请求头部字段:
![](https://user-images.githubusercontent.com/5669954/57500768-3ad52500-7317-11e9-8aea-6d9a54b1a404.png)
把第一步获得的CSRF token填到Postman里的header字段里,如图:
![](https://user-images.githubusercontent.com/5669954/57500769-3ad52500-7317-11e9-914f-afa47163a0df.png)
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"}}
![](https://user-images.githubusercontent.com/5669954/57500770-3ad52500-7317-11e9-82cc-6938c3b3e95b.png)
状态码201,证明创建成功了:
![](https://user-images.githubusercontent.com/5669954/57500771-3b6dbb80-7317-11e9-9bee-a25da1fae03b.png)
可以在前端看到创建成功的contact:
![](https://user-images.githubusercontent.com/5669954/57500772-3b6dbb80-7317-11e9-8791-2ac6156e8d99.png)
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
相关文章
- 使用postman调用Cloud for Customer自定义的OData创建sales order销售订单
- 如何在 ABAP Development Tool 创建新的 ABAP Cloud 项目
- 使用postman消费Marketing Cloud的contact读取API
- SAP Cloud for Customer使用postman读取user profile的web service
- 如何在 SAP Commerce Cloud Portal 构建和部署 SAP Spartacus Storefront
- SAP Cloud Application Programming 编程模型(CAP)的设计准则
- SAP Marketing Cloud里获取Contact Interaction的postman请求
- 【项目实战】Spring Cloud Gateway中RequestRateLimiter限流过滤器介绍
- Cloud Card是否能干掉App
- Oracle cloud control 12c 怎样改动sysmanpassword
- Spring Cloud Alibaba | 微服务分布式事务之Seata
- HCIE-Cloud Computing LAB备考第二步:逐题攻破--第一题:FusionCompute--“扩容CNA与对接共享存储”的理论解读和解题详述
- Spring Cloud Alibaba微服务第24章之Docker部署
- Spring Cloud Alibaba微服务第19章之分布式事务