This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
Im trying to access an API that contains training information on individuals in my company - the API is using OAuth2 to issue a token but I cant get it to do that! The developer that Im working with, has Postman installed on his machine and can request and get a token without issue but I get the following error:
<cornerstoneApi> <status>405</status> <timeStamp>2020-10-28T16:13:44+0000</timeStamp> <error> <errorId>6c519deb-4e9a-4dc7-9fab-84c29122b4a8</errorId> <message>Method not allowed</message> <code>405</code> <description>Method not allowed. Please see the service help page for constructing valid requests to the service.</description> </error> </cornerstoneApi>
OK - I got the token, I had to change the payload - rather than me adding them in, I had to include them as fields in the input text file and then in the 'add values from these fields' section, I ticked those fields that were in the text input file:
Now I can get an access token and its set to expire in 3600 seconds so should be valid for an hour, so..... I then have a new download tool on a separate workflow (as I'm still getting it working, Im not passing the token to the next download or anything yet) which has the URL that I want to download from, I have changed the Payload to GET and in the headers, I pass in Authentication and my access token but I get 'CSOD Unauthorized Exception:Check your credentials.'
The API might require you to do something with the token like base64 encoding it or adding Bearer in front of it. It might also be called something other than Authorization depending on what they specify. This ultimately comes down to how the vendor has implemented their API. Take a look at this link that I just found: https://anymule.com/watch-out-for-base64-encoded-api-secret-keys.html
Have you tried the subsequent request in Postman yet?
I did read that thread and so tried the Alteryx Base64 encoder tool to see if that would work but I still get the same error. The Dev can connect with no problem using Postman and he is not doing anything to encode as Base 64 either. Kind of stumped now! But feel we are so close....
Is there a Status or LOID payload value that it asks for? Also sometimes the case of the payload values can be important depending on how picky the API is so Status or status could potentially make a difference. It would appear that either one is not being provided or the value being passed isn't one that is valid.
I was having the same issue. Postman would get the Oauth2 token very simply by selecting the configuration option from the dropdown menu. When passing the client id and secret via input tool, it worked. Works great now.