Login using REST API

  • 18 May 2016
  • 6 replies
  • 543 views

Hi,

We try to communicate with Sysaid using the REST API.
We found out that in order to query a SR we need to call the URL http://srvsysaid04:8080/api/v1/sr/1234567 and provide it with the TOKEN in the Authorization property of the headers.
In order to get that TOKEN, we need to perform a login.
We try using http://srvsysaid04:8080/api/v1/login/ and passing our user_name and password as parameters as described in the API.
We don't receive an answer but rather a server error (500 - The server encountered an internal error (Request failed.) that prevented it from fulfilling this request) without more details.

Has someone here already experienced this as well ?
How to perform a REST login and get the TOKEN needed for further requests ?

Thanks,

Stephane

6 replies

Hi Stephane,

I have forwarded this to the team and will get back to you once there is an answer.

Cheers,
Danny
The information I have received: you cannot get the TOKEN from Sysaid API since this functionality does not exist yet. You can see in SysAid Help API page that it's still TBD.

In order to make it communicate with Sysaid using the REST API, you need to call login API like are doing.
Then after getting a success response from login API, you should get the cookie and pass it to the second API for SR query.

If you're still having trouble with this, I suggest contacting our customer support helpdesk for a thorough investigation. Once a solution is found, please post it here for other users, should they encounter a similar issue and stumble upon this thread.

Thanks,
Danny
Hi Danny,

Any update on this? We are using the On-Prem version of Sysaid MSP v17.2.02 b30 and I am not able to use the Login method. Any idea when this will be implemented? I see in the documentation that it is still TBD.

Regards,
Hi holytoutant,

No, TOKEN will be supported in API V2, but we don't yet have an ETA for its release. If you can't use the available methods to achieve something, I suggest contacting our support team to investigate how it can be achieved using these methods.

Cheers,
Danny
So, i'm not sure this is the correct thread - but i wanted to ask:

is it possible top log in via the Rest API (i've done this part),
and then send a get request via Rest API ?

i've tried getting the session cookie and re-sending it (while lacking the knowledge of how to do so) as is written in the documentation - but i allways get the response of :

status: 401,
message: 'Non authenticated user',
solution: 'First you need to login to SysAid'
Hi Johnatia23,

Once you receive the cookie, for the following requests you make, you will put this cookie in the header of the Request.

Hope this helps.

Reply