Human Capital Management REST API Developer Reference

Creating Attachments

POST

URI /services/data/vXX.X/sobjects/attachment/
Description Insert new attachments

Input Parameters

For information about the supported attributes of the Attachment standard object that you can use in the POST request, see the online Force.com SOAP API Developer Guide.

Sample Code


// POST Request
{
 "Name":"resume.txt",
 "ParentId":"a0nj000000Menwz",
 "Description":"Candidate Resume",
 "Body":" Zm9vIGJhcg==",
 "IsPrivate":false,
 "ContentType":"text/plain"
}

// POST Response
{
  "id" : "00Pj000000DwGFXEA3",
  "success" : true,
  "errors" : [ ]
}
Note:
This example shows creating an attachment using base64-encoded data for the attachment body. For an example of creating an attachment along with providing blob data for the record, see the Insert or Update Blob Data topic in the Force.com REST API Developer Guide.

Tip:

You can access the REST Explorer by logging in to Salesforce Developer Workbench and browsing to Utilities | Rest Explorer.

© Copyright 2009–2018 FinancialForce.com, inc. All rights reserved. Various trademarks held by their respective owners.