Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
4,930

Introduction:


SAP Logon inbuilt gateway client is an out-of-box tool to test OData API, but if you want to be more efficient, a better tool is needed.

According to official introduction, postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster. So how can we use postman test our OData API faster and easier.

Backend configuration:


First of all, you need authorization to access the API which is not needed in gateway client. Gateway client will directly use your developer user to access the API, this is obviously not appropriate especially when you want to do some authorization test. Let’s start with creating a role.

  • Create a role named ZPOSTMAN




  • Add Authorization Default in Menu tab




  • Select authorization type based on your service




  • Find you API service




  • Then move to Authorizations tab





  • Add all the authorization you need to access your API, these authorization objects can be various according your API.




  • Generate and save your role.





  • After we have the role, we need to create an user





  • Change User type to B System and provide a password in Logon Data tab.





  • The most important thing is to assign your role created before to this user



Then save your user. Now we can move to Postman.

Postman:



  • Create a new collection and add a new request in.





  • You can copy and paste your URL from gateway client.





  • In Auth tab, select type Basic Auth and enter your created user and password.



Then we are good to go!

Note that you may need to explicit assign client in your URL if you get a 401 unauthorized error when sending request. Append “?$sap-client=001” after your URL.

Leave you comments below if you have any questions, and you can also refer to this blog: S/4HANA Cloud API Consumption 101 – Using Postman to Test | SAP Blogs for cloud usage.
1 Comment