[英]How to call Salesforce REST API from external web forms
I am a bit confused.我有点困惑。 The requirement is that we need to create a REST API in Salesforce(Apex class) that has one POST method.
要求是我们需要在具有一个 POST 方法的 Salesforce(Apex 类)中创建一个 REST API。 Right now, I have been testing it with POSTMAN tool in 2 steps:
现在,我一直在用 POSTMAN 工具分两步测试它:
However, the REST API that I have in Salesforce would be called from various different web forms.但是,我在 Salesforce 中拥有的 REST API 会从各种不同的 Web 表单中调用。 So once someone fills out the webform, on the backend it would call this REST API in Salesforce and submits lead request.
因此,一旦有人填写了网络表单,它就会在后端调用 Salesforce 中的这个 REST API 并提交潜在客户请求。
I am wondering how would that happen since we can't use POSTMAN for that.我想知道这会如何发生,因为我们不能为此使用 POSTMAN。
Thanks谢谢
These "various different web forms" would have to send requests to Salesforce just like Postman does.这些“各种不同的 Web 表单”必须像 Postman 一样向 Salesforce 发送请求。 You'd need two POST calls (one for login, one to call the service you've created).
您需要两次 POST 调用(一次用于登录,一次用于调用您创建的服务)。 It'll be bit out of your control, you provided the SF code and proven it works, now it's for these website developers to pick it up.
它有点不受您的控制,您提供了 SF 代码并证明它有效,现在这些网站开发人员可以选择它。
What's exactly your question?你的问题是什么? There are tons of libraries to connect to SF from Java, Python, .NET, PHP... Or they could hand-craft these HTTP messages, just Google for "PHP HTTP POST" or something...
有大量的库可以从 Java、Python、.NET、PHP 连接到 SF……或者他们可以手工制作这些 HTTP 消息,只需谷歌搜索“PHP HTTP POST”或其他东西……
Depending how much time they'll have they can:根据他们有多少时间,他们可以:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.