Jump to content

How to call external REST API using oAuth2 authentication


Recommended Posts

Hello All,

I am new to Sage X3 REST web services. I need to call external REST API of SAP CONCUR application using oAuth2 authentication method. Is there any help guide on how I can achieve this.

I am trying to read the data from SAP Concur system using REST API.

I tried to create a REST call from Sage X3 but there is no option on how i can set oAuth authentication. Attached is the screenshot.


Any sort of help is highly appreciable.

Thanks and Regards.


Link to comment
Share on other sites

  • 2 weeks later...

Hi Chitrans,

As far as I know, there is no oAuth2 authentication for external REST web services, but maybe you could pass some information on the code call that could embed that (not sure, just an option). You can look at the online help here with some sample calls:


Hope it helps!


Link to comment
Share on other sites

Hi Alex,

Thank you for the valuable comment!

I tried to pass the body with client connection details (client_id, client_secret, username, password, grant_type) in CDATA variable but it is not working.

Not sure but I think that I need to create an external connector out of Sage X3 which could authenticate external REST web services with oAuth2.

Warm Regards,


  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

Hi Chitransh,

from our experience, currently it's not possible to use OAuth2 with the EXEC_REST_WS function from ASYRRESTCLI library. The header parameters used in this library are to short to hold a bearer token. You can't fix that without changing the standard library. 

Another option (not so easy to implement) is to write a nodejs module that makes the external authentication and call. Then you execute the nodejs module from 4gl script with this library: https://online-help.sageerpx3.com/erp/12/staticpost/asyrwebser-api 


Link to comment
Share on other sites

  • 1 year later...

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

  • Create New...