cancel
Showing results for 
Search instead for 
Did you mean: 

Create group and tocken access

Former Member
0 Kudos

Hello

We are builiding an application to create group and add members in the group and we have the following questions.

Create a group

    • We will be using a Group Template to create a new group based on member’s division
    • We need an API for retrieving a correct template for group creation. Which API call should we use to retrieve the correct template? Does template id is enough

Access Token

Thank you

Elodie

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

To get a list of all templates available for any group (both system and custom template) you would call: [GET] /GroupTemplates


This returns a list of available templates.  To choose one of the templates while creating a group you pass it as a <link> while calling: [POST] /Groups


For authentication they'll want to follow the following link and pick one of the two authentication methods: http://help.sap.com/download/documentation/sapjam/developer/index.html#auth/concepts/intro.html

Answers (2)

Answers (2)

Yanbing
Advisor
Advisor
0 Kudos

Please try to setup "Alias Account" in your Jam as Jam administrator. The OAuth2 client can be added and generate the API token there.

RuedigerMueller
Advisor
Advisor
0 Kudos

Hello Elodie,

I am not sure why you are referring to the [POST] /oauth/access_token documentation that is part of the member sync documentation. The OAuth flow and how to get an access token is described here.
You either need to get an access token for each user that you want to use to call the SAP Jam API.
In order to retrieve group templates you can user [GET] /GroupTemplates, [GET] /CustomGroupTemplates etc as you can see here.
Best,
  Rüdiger
Former Member
0 Kudos

Hello Rudiger

Here are the issue that we are facing. We are not able to make a call for any of the API.

  • OAuth Authentication: We’ve created an OAuth Client in the Admin
    UI, which gives us the key and secret
  • We’re able to generate the access token, but by using the
    following API call:
    • https://<jam#>.sapjam.com/api/v1/auth/token.
      Using jam8 for the jam# and then client_id=consumer key that was generated,
      grant_type=”client_credentials” and client_secret=secret key that was
      generated.  We know that is this the old REST API documentation that this
      is coming from, so first question is, is grant type “client_credentials” even
      valid?
    • What’s the equivalent on the OData API side?  Guessing
      this: https://<jam#>.sapjam.com/api/v1/auth/token?client_id=<client_id>&grant_type=urn%3Aietf%3Aparams%3Ao...>.
      However, this requires us to also create a SAML IDP in the Admin UI, which I
      don’t think is relevant for our purposes.  Nothing will be initiated by
      user action.  These are all back-end application calls as mentioned
      above.  Essentially, we just need a way to authenticate the application
      (and not the end users) to be able to make these API calls
  • Once we’ve generated the token and we try to make any subsequent
    OData API call, we get a 403 or some other error.
  • We also attempted to test the single use token to see if that
    would be helpful, but also get a 403 error:

Thanks

Elodie

RuedigerMueller
Advisor
Advisor
0 Kudos

For OAuth 1.0a you need to do a [POST] /oauth/access_token for OAuth 2.0 it is [POST] /api/v1/auth/token. Details are available at http://help.sap.com/download/documentation/sapjam/developer/index.html#auth/concepts/SAMLOptionsForS...#
In case you are going for the SAML flow please also have a look at http://help.sap.com/download/documentation/sapjam/developer/index.html#auth/concepts/SAMLFormatRequi...

BTW: Have you tried going through the OAuth flow using a browser plug-in like Postmen for Chrome? This usually helps in debugging your code as the tool will show you how the correct requests should look like.

Best

  Rüdiger