美文网首页SAP札记SAP 修行SAP 实用篇
使用postman创建Marketing Cloud的Conta

使用postman创建Marketing Cloud的Conta

作者: _扫地僧_ | 来源:发表于2019-05-22 12:05 被阅读3次

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

    clipboard1

    观察Chrome开发者工具network标签页里的HTTP请求:

    https://jerry.gcdemo.hybris.com/sap/opu/odata/sap/CUAN_COMMON_SRV/?sap-client=100

    这个请求用于读取CSRF token:

    clipboard2

    点击保存,会发送一个新的HTTP post请求:

    clipboard3

    请求url:
    https://jerry.hybris.com/sap/opu/odata/sap/CUAN_COMMON_SRV/ContactPersons?sap-client=100
    再看下重要的请求头部字段:

    clipboard4

    把第一步获得的CSRF token填到Postman里的header字段里,如图:

    clipboard5

    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"}}
    
    clipboard6

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

    clipboard7

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

    clipboard8

    要获取更多Jerry的原创文章,请关注公众号"汪子熙":


    相关文章

      网友评论

        本文标题:使用postman创建Marketing Cloud的Conta

        本文链接:https://www.haomeiwen.com/subject/mhvyzqtx.html