PartnerUpsert

Sample Request Message-upsert Call-Partner API

POST https://na1.salesforce.com/services/Soap/u/10.0 HTTP/1.1 
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol
1.1.4322.573) 
Content-Type: text/xml; charset=utf-8  
SOAPAction: "" 
Content-Length: 510 
Expect: 100-continue 
Host: na1.salesforce.com 

<?xml version="1.0" encoding="utf-8"?>   
<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>QwWsHJyTPW.1pd0_jXlNKOSU</urn:sessionId>
     </urn:SessionHeader>
  </soapenv:Header>
  <soapenv:Body>
     <urn:upsert>
        <!--Custom Field defined in Setup as the External ID-->
        <urn:externalIDFieldName>External_Id__c</urn:externalIDFieldName>
        <urn:sObjects> <!--Zero or more repetitions:-->
           <urn1:type>Account</urn1:type>
           <!--Existing Id, this record will be updated-->
           <External_Id__c>ars1</External_Id__c>
           <Name>Acme Rocket Superstore</Name>
           <!--You may enter ANY elements at this point-->
           <NumberOfEmployees>340</NumberOfEmployees>
        </urn:sObjects>
        <urn:sObjects>
           <urn1:type>Account</urn1:type>
           <!--New External Id, this record will be created (ensure required fields are present)-->
           <External_Id__c>ams1</External_Id__c>
           <Name>Acme Medical Supplies</Name>
           <NumberOfEmployees>17</NumberOfEmployees>
        </urn:sObjects>
     </urn:upsert>
  </soapenv:Body>
</soapenv:Envelope>

Sample Response Message-upsert Call-Partner API

HTTP/1.1 200 OK 
Server: sfdc 
Content-Type: text/xml; charset=utf-8 
Transfer-Encoding: chunked 
Date: Wed, 30 May 2007 00:52:19 GMT
  
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns="urn:partner.soap.sforce.com">
  <soapenv:Body>
     <upsertResponse>
        <result>
           <created>false</created>
           <id>001D000000HRzKDIA1</id>
           <success>true</success>
        </result>
        <result>
           <created>true</created>
           <id>001D000000HSDQZIA5</id>
           <success>true</success>
        </result>
     </upsertResponse>
  </soapenv:Body>
</soapenv:Envelope>


Back to Sample SOAP Messages