4 followers Follow

REST API example? Version 2.0 please

I'm looking for a REST API version 2 sample.

I have my session id and I see the documentation on commands. Now all I need is some sample code that will allow me to get data.

I'm expecting this sample code to be in two parts.

Part 1 - all the parameters that need to be set
Part 2 - the code that would include the sessionid and commands.

Much appreciated!

Tim Chandler Answered

Official comment


Hi Tim,

Please review the REST API 2.0 guide on here

The reference documentation also contains samples of REST API messages. I recommend you check the objects, EntityQuery & Query particularly.

You can also find numerous samples with the REST API in other posts in this forum.


Note that the session ID is to be sent in the authorization header of each message.

If you need further assistance, don't hesitate to post or comment again. Please specify what platform/language you use and what you want to achieve with the API so we can come up with answers that are most relevant to your scenario.

Hope this helps,



Ophir Kenig
Comment actions Permalink

Please sign in to leave a comment.



Thanks Ophir.

I've read that pages more than once and I have to tell you I do not see any examples of using the sessionIDparrameters and commands to read data. 

Could I ask of you to add to this post an example of REST API code that uses the seesionID, parameter settings and a simple command? Once I have your syntax down with the correct parameter settings I should be good to go.



Tim Chandler 0 votes
Comment actions Permalink

Hi Tim,

Not sure what kind of examples are you looking for, but the following should hopefully get you started (Examples are using 'curl' - if you expect something else, let me know)


curl -d "{userName:'YYY',password:'XXX'}"

respone is (sessionId is the important part):

"sessionId": "abcdefghijklmnopq_3422",
"userId": "xxx",
"organizationId": "yyy",
"serverTime": "2016-02-08T09:59:26.0510727Z",
"licenseType": "Full"

check that you are able to call the api under while authenticated:
curl -H "Authorization: Session abcdefghijklmnopq_3422"



perform a query that returns tasks in order of creation:

curl -H "Authorization: Session abcdefghijklmnopq_3422" -d "{q:'select name,CreatedOn from task order by CreatedOn desc'}"


Eyal Post 1 vote
Comment actions Permalink