Examples of REST API

26 views
Skip to first unread message

alaninmcr

unread,
Nov 10, 2015, 7:57:04 AM11/10/15
to gd-...@googlegroups.com
Hello everybody,

I was wondering if there are any examples of use of the REST API
available. I cannot see how to get the authentication working.

Thanks,

Alan

alaninmcr

unread,
Nov 10, 2015, 8:28:47 AM11/10/15
to gd-...@googlegroups.com
It's OK everybody I figured it out (with Donal Fellows's help).

In case anyone else gets stuck:

You need to POST to your_site/rest/accesstoken with the Content-Type set
to application/json. In the body have a JSON document with the email
(user account) and password, such as:

{
'email' : 'Administrator',
'password' : 'AdminPassword'
}

This then returns a JSON document which includes

{
...
"sessionId": "SessionId",
...
}

You take the sessionId and use it as the X-ICE-Authentication-SessionId
header in subsequent calls.

> Thanks,
>
> Alan

Alan

o...@lbl.gov

unread,
Nov 11, 2015, 5:44:17 PM11/11/15
to gd-ice
Here's a shell script for getting the sessionid

Reply all
Reply to author
Forward
0 new messages