on 12-02-2015 11:37 AM
Hello everyone,
I am trying to access the JAM API. For a few months ago I created an account in my hanatrial account and I could call the API and get my user Data without problems using the URL:
https://developer.sapjam.com/api/v1/OData/Self
But since a few days ago I get a error: "Your account is either not authorized, or not enabled to use the API." when I try to access. I checked in Admin->Features and the API ist active and my user is the administrator, so I do not understand why i am not authorized.
Can someone give me a hint? Thank you in advance.
Thanks everyone for the help. The problem is solved.
I had copied the "secret" key instead of the "key" key in the "client key" of my destination, no wonder it was not working...Now I've copied the right key.
Besides that, I also added the relative path "/api/v1/OData" to my entry path.
Thanks again,
Nei Li
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
It sounds like you either don't have the Authorization header set, or it is set incorrectly. If you disabled the API entirely for your company, the error message would be along the lines of:
"The API has not been enabled. This is a setting available to your SAP Jam company administrator."
How are you setting your Authorization header?
If you are on the HANA Cloud Platform, I highly recommend using the HCP's built-in OAuth2SAMLBearerAssertion mechanism, which will manage the header for you based on the user currently logged into the HCP application. Setting this up with Jam is described in the following section of the guide:
Let me know how it goes!
-- Geoff
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Geoffrey,
Thank you for your reply, I already had the Destination set on HCP. It was working just fine until a few months ago. Now, when I run the Java servlet, it Returns "Service unavailable", I thought it was down for maintenance, but I still can not Access the Jam API after months. Do you know why could it be?
regards,
Neili
Hi Neili,
Is this still an issue? I'm not clear on where the error is coming from based on your description. Is it on the response of the request being made in the application, or is it just when hitting the servlet as a whole?
Can you also hit the try button on this page. You can create the OAuth token to provide in the upper left corner by going to the OAuth Clients page on your Jam Developer. Click view on the client you want to use, and there is a create OAuth token button that you can then copy and paste that into these docs.
Thanks,
Adam
Hi Adam,
Thank you for asking. I still have the issue. My Problem is with the Jam OData Service. When I try to call:
https://developer.sapjam.com/api/v1/OData/Self
to get my user info, I get the following error:
"Your account is either not authorized, or not enabled to use the API"
As I said, it was working before, but now I can not Access anymore. Did they changed the URL or the Jam account on Hanatrial has a expery time?
regards,
Neili
Hi Neili,
The error that you are getting is saying that you aren't authorized. The URL is fine, but you are missing your authentication header. If you had a previous token that you are using, it may have expired and you need to get a new one. If you weren't passing a header before, it is possible that it may have tried to use an existing session that your application had access to. Only question I have is how are you doing authentication in your app?
-Adam
Hi Neili,
This is expected behavior, it should never have worked directly through the browser, it was not intended that browser sessions would work through the API. You need to call this directly through an application that can pass this OAuth header, be it an application, our api docs, or other test clients such as Postman.
Thanks,
Adam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.