cancel
Showing results for 
Search instead for 
Did you mean: 

How to obtain my S4HC APIKey

peter_munt4
Participant
667

Hi

I started to write this question as I thought I needed the APIKey for a call to this API below.  I am still wanting to know that.

I want to update an element via the API_BUSINESS_PARTNER ... I have set up the comms arrangement sap_com_008 with basic authentication for this test.

According to the API Hub an APIKey is needed - that is in fact not true !!!.🙄 As I can call the API without it and it does the PATCH just fine.  But out of interest How can I get my SAP systems APIKey?🤔

In case you are interested in this part : Here is the API I am calling https://<my sap system>-api.s4hana.ondemand.com:443/sap/opu/odata/sap/API_BUSINESS_PARTNER/A_BusinessPartner('9980000760').     This has in the Authorization tab my communication arrangements userid/password credentials.  The Headers have the CSRF token that I have obtained and it does not care about the APIKey.   The thing does post/patch just fine without it.

peter_munt4_4-1724742824134.png

 

 

Here are the steps etc I took so far to obtain my APIKey

I have set a clientid/secret for OAUTH calls to S4HC API in our SAP IAS Application for our S4HANA Cloud- Test Tenant (i,e, the S4HC D5X system) and the Client Authentication attribute tab - The ClientID was already there and I have added a Secret.

peter_munt4_0-1724741362559.png

I then attempt to obtain the APIKey via https://<mysapsystem>-api.s4hana.ondemand.com:443/oauth/token

but I get a 403 - so how can I get my dang APIKey ?

peter_munt4_1-1724741541412.png

 

 

 

View Entire Topic
AndreasMuno
Product and Topic Expert
Product and Topic Expert
0 Kudos

Thank you and congratulations for answering your own question, @peter_munt4

Here is what I found on obtaining and managing API keys: 

The latter contains some information om OAuth v API Key. They appear to be alternative ways to authenticate:  Screenshot 2024-08-30 API Key.png

 

 

When you're finding your own answers, please share them by replying to your own post with an answer and mark that answer as resolving your question. This way, the only somewhat smart (AI, yes, there, I said it) algorithms will recognize your answer as such and suggest your response to other community members who might be looking for a clue about the API key. Thank you for being such a good sport, Peter!   

peter_munt4
Participant
0 Kudos
Hi
peter_munt4
Participant
0 Kudos

Hi thanks for your reply but my question really is about how to obtain my APIKey for my company's S4HC SAP system. Are you saying that the ONLY way to obtain the APIKey is from the SAP API Hub page and hence will be the same for both my DEV/QAS and PROD S4HC SAP system? The API documentation as you can see here has it as a required Header - let's assume that really is true - so wondering how to obtain it or is that just a requirement when executing it just from this particular page ?  

peter_munt4_0-1725247365165.png