使用来自 Postman 的 HTTP 或 API 调用合并记录并恢复 Salesforce 的已删除记录?

阿什·普拉萨德

我正在尝试查看是否可以使用 API 调用(读取 REST 或 SOAP 调用)进行合并记录调用或恢复已删除的记录。尝试围绕它进行研究,但大多数示例需要用 Java 或 .NET 编写的自定义代码。

我想看看它是否可以在没有自定义代码的情况下使用 HTTP 请求本身来完成。在最坏的情况下,我想可以编写与 Apex Web 服务相关的调用,但我试图找到一种使用 HTTP 请求本身的方法。

我已经阅读了 API 文档,但我对如何实现仍存疑虑。在 Salesforce API 中,我找不到合适的调用。

提前致谢。

眼霜

SOAP API 具有合并操作。将 WSDL 导入到您的项目中。login首先调用,获取serverUrland sessionId,然后:

合并

要求

POST https://{redacted}.my.salesforce.com/services/Soap/u/52.0/{redacted} HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
Content-Length: 882
Host: {redacted}
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.5 (Java/12.0.1)

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:partner.soap.sforce.com" xmlns:urn1="urn:sobject.partner.soap.sforce.com">
   <soapenv:Header>
      <urn:SessionHeader>
         <urn:sessionId>00D{redacted}</urn:sessionId>
      </urn:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <urn:merge>
         <urn:request>
            <urn:masterRecord>
               <urn1:type>Lead</urn1:type>
               <urn1:Id>00Q3O000003aFYtUAM</urn1:Id>
            </urn:masterRecord>
            <urn:recordToMergeIds>00Q3O000003aFYuUAM</urn:recordToMergeIds>
             <urn:recordToMergeIds>00Q3O000003aFYyUAM</urn:recordToMergeIds>
         </urn:request>
      </urn:merge>
   </soapenv:Body>
</soapenv:Envelope>

回复

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:partner.soap.sforce.com">
   <soapenv:Header>
      <LimitInfoHeader>
         <limitInfo>
            <current>65</current>
            <limit>5000000</limit>
            <type>API REQUESTS</type>
         </limitInfo>
      </LimitInfoHeader>
   </soapenv:Header>
   <soapenv:Body>
      <mergeResponse>
         <result>
            <id>00Q3O000003aFYtUAM</id>
            <mergedRecordIds>00Q3O000003aFYuUAM</mergedRecordIds>
            <mergedRecordIds>00Q3O000003aFYyUAM</mergedRecordIds>
            <success>true</success>
         </result>
      </mergeResponse>
   </soapenv:Body>
</soapenv:Envelope>

取消删除也有。

POST https://{redacted}.my.salesforce.com/services/Soap/u/52.0/{redacted} HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
Content-Length: 568
Host: {redacted}
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.5 (Java/12.0.1)

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:partner.soap.sforce.com">
   <soapenv:Header>
      <urn:SessionHeader>
         <urn:sessionId>00D{redacted}</urn:sessionId>
      </urn:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <urn:undelete>
         <urn:ids>a141q000001RfNeAAK</urn:ids>
         <urn:ids>a141q000001RfOVAA0</urn:ids>
      </urn:undelete>
   </soapenv:Body>
</soapenv:Envelope>

不要认为 REST API 有匹配操作。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

有什么方法可以使用REST API从Salesforce检索已删除的记录?

来自 android 的 Http 调用来自 Rest API

如何使用来自 Gatling 的 HTTP 代理记录获取标头响应

使用REST API从Salesforce.com调用“获取更新”记录时出现问题

Salesforce REST API获取更新记录的列表

使用来自Lambda函数的HTTP API阶段变量

使用来自 Postman 的文件导出 HTTP POST 请求不起作用

无法使用原生 android salesforce SDK 编辑 salesforce 记录

如何在Postman上使用Salesforce Tooling API为Salesforce客户对象的POST方法创建CURL命令?

无法使用 Spring RestTemplate 调用 Salesforce API

如何使用客户端事件 API 在 elFinder 中记录已删除的文件名?

使用来自JavaScript的Twilio API进行调用

使用来自 api 调用的 reducer 异步更新状态

使用来自 R 的标头调用 API

使用来自MYSQL中先前COUNT()的值选择记录

如何使用来自另一个 Dataset<Row> 的记录更新 Dataset<Row>,这些记录在 Spark 中使用 JAVA API 具有相同的架构?

从.Net更新Salesforce记录

使用Postman测试API,Postman调用在哪里?

Salesforce-HubSpot API调用

记录已删除的消息

从备份中恢复已删除的记录

CSV文件到Salesforce记录

如何使用 Pandas 优雅地删除已识别的记录?

如何使用JDBC查找已删除记录的主键?

如何使用JDBC查找已删除记录的主键?

如何使用 REST API 删除多条记录

在laravel中使用fetch api删除记录?

从Postman调用shopify API

使用pax记录的log4j2:无法使用来自StructuredDataMessage的值