Hi there,
Please login using POST https://api2.clarizen.com/V2.0/services/authentication/Login first:
Then use the sessionId received in the headers of your API call like so:
I hope this helps.
Roland
Hello,
Has anyone tried accessing Clarizen REST API using APIKEY?
I am calling the following API using APIKEY in the header and getting login failure
https://api2.clarizen.com/v2.
Error message:
Please sign in to leave a comment.
Hi there,
Please login using POST https://api2.clarizen.com/V2.0/services/authentication/Login first:
Then use the sessionId received in the headers of your API call like so:
I hope this helps.
Roland
Hi Roland,
Thank you for your reply to my post. I followed the steps mentioned in your post and now I am getting this error... Is there another parameter or setting that I need to set or configure?
Thank you in advance.
{
Hi there,
Could you please provide screenshots of your authentication call (body and headers) and the subsequent query call (body and headers)?
Thank you,
Roland
Hi Roland,
Thank you again for your response.
On second try, I am able to login now. The issue was with the content-type. I was using JSON, whereas it needs to be text/plain. Once I changed the content type, login worked.
But when using Session ID, i tried to access Issue query as shown below and I am getting authorization error. I have also attached screen print for the same.
I am able to access Issues from front end
Can you please let me know if we are missing anything for the user setting to be able to query Issue via API?
https://api2.clarizen.com/v2.0/services/data/query?q=SELECT createdOn,title FROM Issue WHERE createdOn>2020-03-01
Hi there,
Please try this:
This is what my headers look like:
I hope this helps.
Roland
Hi Roland,
Removing APIKEY from Issues API call and appending Session in front of SessionID worked.
I am able to make calls now using V2 REST API.
Thank you for your responses.
Regards,
Kaustubh
@Roland,
If @Kaustubh has to remove the APIKEY attribute, and instead has to login with username and password and then use the Session ID from that call, what is the purpose of the APIKEY in the first place?
Can you please explain exactly how one is supposed to use the APIKEY to create a login session? I was under the impression from the documentation that you simply pass the APIKEY in each call to forego the need to login.
More detailed documentation would be greatly appreciated.
Hi Chad,
You can use API keys now. Initially we only had the Username/Password > Session authentication. If you want to use an API key instead, just add the following key/value pair to your headers: "Authorization": "ApiKey xxx" where xxx is your actual API key.
I hope this helps.
Roland
@Roland, thank you! That's the piece I was missing.
I had been trying this:
curl -X GET "https://api2.clarizen.com/v2.0/services/authentication/GetSessionInfo" -H "ApiKey: XXX"
Which would give me this error:
{"errorCode":"LoginFailure","message":"You are not authorized to access this service.","referenceId":"XXX"}
This was what I needed instead:
curl -X GET "https://api2.clarizen.com/v2.0/services/authentication/GetSessionInfo" -H "Authorization: ApiKey XXX"
Hopefully this helps others with the same issue.