30.03.2014 Views

Database.com Chatter REST API Developer's Guide - Salesforce.com

Database.com Chatter REST API Developer's Guide - Salesforce.com

Database.com Chatter REST API Developer's Guide - Salesforce.com

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Introducing <strong>Chatter</strong> <strong>REST</strong> <strong>API</strong><br />

Using <strong>Chatter</strong> <strong>API</strong> Inputs<br />

--0HWq8x4y4DSQ4fqjXt6MinVMyqbf1r<br />

Content-Disposition: form-data; name="xml"<br />

Content-Type: application/xml; charset=UTF-8<br />

<br />

<br />

<br />

<br />

High priority content <br />

Text<br />

<br />

<br />

important<br />

Hashtag<br />

<br />

<br />

Please review this as soon as possible<br />

Text<br />

<br />

<br />

<br />

<br />

Quarterly review 2012 Q1<br />

2012_q1<br />

<br />

<br />

--0HWq8x4y4DSQ4fqjXt6MinVMyqbf1r<br />

Content-Disposition: form-data; name="feedItemFileUpload"; filename="foo"<br />

Content-Type: application/octet-stream; charset=ISO-8859-1<br />

This is the content of the file.<br />

--0HWq8x4y4DSQ4fqjXt6MinVMyqbf1r--<br />

The following example posts a <strong>com</strong>ment to a feed item and uploads a binary attachment:<br />

POST /services/data/v27.0/chatter/feed-items/0D5x00000000RryCAE/<strong>com</strong>ments HTTP/1.1<br />

Authorization: OAuth 00DD0000000Jhd2!AQIAQC.lh4qTQcBhOPm4TZom5IaOOZLVPVK4wI_rPYJvmE8r2VW8XA.<br />

OZ7S29JEM_7Ctq1lst2dzoV.owisJc0KacUbDxyae<br />

Accept: application/json<br />

User-Agent: Jakarta Commons-HttpClient/3.0.1<br />

Host: instance_name<br />

Content-Length: 978<br />

Content-Type: multipart/form-data; boundary=F9jBDELnfBLAVmLNbnLIYibT5Icp0h3VJ7mkI<br />

--F9jBDELnfBLAVmLNbnLIYibT5Icp0h3VJ7mkI<br />

Content-Disposition: form-data; name="json"<br />

Content-Type: application/json; charset=UTF-8<br />

{ "body":<br />

{<br />

"messageSegments" : [<br />

{<br />

"type" : "Text",<br />

"text" : "Here's another file for review."<br />

}, {<br />

"type" : "Hashtag",<br />

"tag" : "important"<br />

}, {<br />

"type" : "Text",<br />

"text" : "Again, please review this as soon as possible."<br />

}<br />

]<br />

},<br />

"attachment":<br />

11

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!