Unable to login using SysAid API

 
Author
Message
SysAider
13
 
Hi. I'm using postman to make a post call to https://mycompanyname.sysaidit.com/api/v1/login

and adding on the login parameters as,

https://mycompanyname.sysaidit.com/api/v1/login?user_name=GivenuserName&password=GivenPassword

and I keep getting this error. Any idea how can I get it to working? I'm using postman to make this test call.

HTTP Status 500 - Request failed.

type Status report

message Request failed.

description The server encountered an internal error that prevented it from fulfilling this request.

SysAid Server/17.1.60
SysAider
18
 
Make sure you have interceptor to hold on to the cookies for subsequent requests.

Also, ensure that you've specified that you're sending Text JSON format.
SysAider
13
 
Hi Thank you for your reply. I got it working by removing the username and the password from the request URL and instead making it a part of the request body.

Here's how it goes,

POST call to;
https://mycompanyname.sysaidit.com/api/v1/login

set the Headers to : "Content-Type: application/json"

Body:
{ "user_name": "AddUserNameHere",
"account_id": "AddAccountIDHere",
"password" : "AddPasswordHere"
}

Hope this helps!
Super SysAider
62
 
Qasim wrote:...POST call to;
https://mycompanyname.sysaidit.com/api/v1/login

set the Headers to : "Content-Type: application/json"

Body:
{ "user_name": "AddUserNameHere",
"account_id": "AddAccountIDHere",
"password" : "AddPasswordHere"
}
...
Thank you very much for sharing this here on the Community Qasim!
For the sake of anyone else looking to log in to the REST API, some more info:

Logging in to the REST API is performed in the manner Qasim has described - an HTTP POST request to the "/api/v1/login" endpoint for your SysAid Server instance, with the single header "Content-Type: application/json".
Example HTTP POST Request for login:
Upon a successful login, you will receive a HTTP 200 OK response and a "Set-Cookie" header will be in the Response Headers.
Example Response Headers:
The "JSESSIONID" component is your Session ID which must be sent along with each subsequent request to the REST API in your Request Headers as the "Cookie" header.
Example HTTP GET request for loading an SR (in this case ID #1234):

I hope this information is clear and helpful to any and all!

Cheers!
Cael
SysAider
2
 
i have tried these urls
https://mycompanyname.sysaidit.com/api/v1/login
https://mycompanyname.sysaidit.com/api/v1/login?us...serName&password=GivenPassword

i am getting the error:
HTTP Status 405 - Method Not Allowed

type: Status report
message: Method Not Allowed
description: The specified HTTP method is not allowed for the requested resource.

SysAid Server/17.4.50

please guide me for the troubleshoot.
Super SysAider
62
 
Neeraj wrote:...
i am getting the error:
HTTP Status 405 - Method Not Allowed
...
Hi Neeraj,

Considering the 405 you are encountering, I suspect that you are not sending the HTTP request using the POST method.

.../api/v1/login expects a POST HTTP request, with the Account ID, Username and Password values in the request body as a JSON string (see my previous post for more detailed explanation).
You can investigate further and speed up testing using a browser based HTTP Request Tester add-on/extension, such as Advanced REST Client (ARC), PostMan or other similar desktop/command line tools.

Hope this information assists you!
Cheers, Cael