使用postman建立Marketing Cloud的Contact

i042416發表於2019-05-25

首先在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":"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"}}
使用postman建立Marketing Cloud的Contact

狀態碼201,證明建立成功了:

使用postman建立Marketing Cloud的Contact

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

使用postman建立Marketing Cloud的Contact

要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":


使用postman建立Marketing Cloud的Contact


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2645495/,如需轉載,請註明出處,否則將追究法律責任。

相關文章