Skip to content

Instantly share code, notes, and snippets.

@espl-saket
Last active January 3, 2016 06:31
Show Gist options
  • Save espl-saket/322c6566adc0ba68802e to your computer and use it in GitHub Desktop.
Save espl-saket/322c6566adc0ba68802e to your computer and use it in GitHub Desktop.
Sample request information to create metadata using SFDC REST APIs
Headers - Authorization: OAuth <YOUR_SESSION_ID>
Content-Type: text/xml
SOAPAction: createMetadata
URL - /services/Soap/m/35.0
Body -
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Header>
<SessionHeader
xmlns="http://soap.sforce.com/2006/04/metadata">
<sessionId>YOUR_SESSION_ID</sessionId>
</SessionHeader>
</env:Header>
<env:Body>
<createMetadata
xmlns="http://soap.sforce.com/2006/04/metadata">
<metadata xsi:type="CustomObject">
<fullName>MyCustomObject2__c</fullName>
<label>MyCustomObject2</label>
<pluralLabel>MyCustomObject2</pluralLabel>
<deploymentStatus>Deployed</deploymentStatus>
<sharingModel>ReadWrite</sharingModel>
<nameField>
<label>ID</label>
<type>AutoNumber</type>
</nameField>
</metadata>
</createMetadata>
</env:Body>
</env:Envelope>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment