如何使用SAP Cloud for Customer OData服务创建Lead

简介:

一共需要两次OData消费来创建Lead.

请求1

url:https://xxxx/sap/c4c/odata/v1/c4codata/LeadCollection/$count

HTTP GET,basic Authorization:

HTTP头部字段,x-csrf-token维护为fetch:

在Postman里执行该请求,在响应里拿到服务器颁发的csrf token:hJ0QsjApzcF6pMy2ttLILQ==

请求2

url:https://xxx.cn/sap/c4c/odata/v1/c4codata/LeadCollection

HTTP Post

将请求1得到的csrf token维护到这个请求的HTTP头部:

在Post请求的正文,维护如下json格式的内容:

执行之后,HTTP状态码201代表创建成功,成功创建的LeadID包含在服务器返回的结果里:

登录C4C前台:
之前在postman HTTP post请求正文里维护的Lead Name和Account内容,以及成功创建后在服务器端自动生成的Lead ID,在下图高亮如下:

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

相关文章
|
7天前
|
前端开发 数据库 开发者
如何在 SEGW 事务码里为 SAP ABAP OData 服务实现 Function Import 试读版
如何在 SEGW 事务码里为 SAP ABAP OData 服务实现 Function Import 试读版
9 1
|
7天前
SAP ABAP OData 服务里需要指定 guid 类型的请求参数时,正确语法是什么?
SAP ABAP OData 服务里需要指定 guid 类型的请求参数时,正确语法是什么?
8 1
|
7天前
|
安全 API 数据库
SAP ABAP OData 中 Function import 的概念介绍
SAP ABAP OData 中 Function import 的概念介绍
17 2
|
8天前
|
UED
什么是 SAP Commerce Cloud SmartEdit Product Carousel Component Editor
什么是 SAP Commerce Cloud SmartEdit Product Carousel Component Editor
14 6
|
8天前
|
机器学习/深度学习 搜索推荐 UED
SAP Commerce Cloud Context Driven Services 概述
SAP Commerce Cloud Context Driven Services 概述
10 0
|
8天前
|
监控 搜索推荐 安全
SAP Commerce Cloud Context Driven Services 里 profile-tag.js 的作用介绍
SAP Commerce Cloud Context Driven Services 里 profile-tag.js 的作用介绍
9 0
|
8天前
|
前端开发 搜索推荐 开发者
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
33 0
|
8天前
|
JavaScript 前端开发 开发者
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
19 0
|
8天前
|
Web App开发 数据采集 前端开发
纯技术讨论:如何让 SAP UI5 应用无法被别人在浏览器里调试 - 这种做法不推荐试读版
纯技术讨论:如何让 SAP UI5 应用无法被别人在浏览器里调试 - 这种做法不推荐试读版
28 0
|
8天前
|
XML 存储 数据格式
SAP UI5 控件 customData 属性的应用介绍
SAP UI5 控件 customData 属性的应用介绍
38 0