Chitransh Posted March 25, 2021 Posted March 25, 2021 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.
Lamarca Tio, Alex Posted April 9, 2021 Posted April 9, 2021 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: https://online-help.sageerpx3.com/erp/12/staticpost/api-asyrrestcli/?highlight=asyrrestcli Hope it helps! Alex
Chitransh Posted April 9, 2021 Author Posted April 9, 2021 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, Chitransh 1
Delbert Friesen Posted May 3, 2021 Posted May 3, 2021 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 1
Perrins, Reggie Posted January 12, 2023 Posted January 12, 2023 Hi, you may be interested in this Knowledge Base Article I wrote recently: View Document - Sage Knowledgebase
Gonzalez, Bruno Posted April 2 Posted April 2 On 5/3/2021 at 2:57 PM, Delbert Friesen said: 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 Hi This is correct. There is a limitation at the moment in the X3 supervisor where the system building the HTTP header cannot have more than 255 characters. Having an oauth2 token will probably go beyond that. An option is to build a simple middleware in nodejs for example, that X3 will call to pass parameter values and nidejs will make the actual call to SAP.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now