cancel
Showing results for 
Search instead for 
Did you mean: 

Access to SAP JAM API

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

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

Answers (1)

Answers (1)

former_member47845
Discoverer
0 Kudos

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:

SAP Jam Developer Guide

Let me know how it goes!

-- Geoff

Former Member
0 Kudos

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

Adam_Stone
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Adam_Stone
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi Adam

Here is the destication I set and it was working:

But what I was trying, is to call the API directly by typing the URL on browser. Before, when it was working, it asked for the user name and password but now comes the error without asking for identification.

Neili

Adam_Stone
Active Contributor
0 Kudos

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