Hi,
I am keep on trying to fix this error '500' when consume REST API from OutSystem. It's working in OutSystem test and postman but its not working when I run this app on browser.
Can anyone please suggest me how to fix this issue or I am doing anything wrong like apply filter in URL. I have attached the image from OutSystem test which is working.
Thanks
Hi Sanjay,
Look this document about parameter in URL REST
https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/REST/Expose_REST_APIs/Customize_REST_URLs
Corret format URL:
..items?IncludeA={IncludeA}&IncludeB={IncludeB}
Regards.
Agno Silveira wrote:
Hi Agno,
Thanks for replying to my question. I have tried the above URL format but its still giving me the same error '500' and in OutSystem test response, it shows nothing when I tried this format.
Can you please tell me how can I check the error message, I have tried to check the error message from service center but it wasn't helpful.
Sanjay kumar wrote:
Try check in service center, Monitoring > Integrations, to see the integration errors.
I had a question, are you using SAP integration?
I am using REST integration, should I use SAP integration for odata api call?
And I already check the error message from Integration, the error message is '500' and the in stack (HeContext heContext, ICc{url}Callbacks _callbacks, String inParamAuthorization, String inParamincludeVLSlink, String inParamincludeSurveys, STGetUserTodoLearningItemsResponseStructure& outParamResponse).
I am not understanding the error from the stack message.
You can use both (REST ou SAP integrations), but if you want use REST, look this document, maybe help you:
https://success.outsystems.com/Documentation/How-to_Guides/Integrations/How_to_consume_an_SAP_OData_service_in_OutSystems
https://www.sapoutsystems.com/SAPOutSystemsHowToConsumeODATA.aspx
I already get the details of error by using onAfterResponse and I know what is the problem you can see the screenshot below. The query $filter has the not-allowed value because outsystem automatically add + symbol for space in request URL during the runtime.
I have call this query parameter (link/%24filter=criteria/includeDeeplink eq true) in REST API and then OutSystem convert it like this (criteria/includeDeeplink+eq+true) as you can seen in below pic.
so can you suggest me is there anyway in OutSystem to maintain the space in request URL so that it wont have any + symbol and wont give any error.
Thanks for keep responding to me.
Hello,
Did you create this step? (2 Add on "OnBeforeRequest" )
It would be good to follow all the steps in this document.
Yes. I have used both onAfterRequest and onBeforeReauest as mentioned on document(how to consume SAP odata service).
But this is just for add the $ symbol before the filter query and it’s working for me.
How can we remove the + symbol on request URL so meaning the request URL can have either this %20 or space then I wont get error..
But when I tried to use %20 or space in query parameter then outsystem automatically change it to + symbol during runtime.
I know this is an old post, but we have a new way of exposing APIs for non-outsystems enterprise business application, which is the Hubway connect. This application has features including viewing and managing API's and tool for reports and dashboards . Hoping this will help.
https://www.outsystems.com/forge/component-overview/13087/hubway-connect
Youtube demo: https://www.youtube.com/watch?v=fNgd1D6eX9c
Please take note that this is a paid component with a 30-day free trial. :)
Let me know you have any queries.
Thank you and Regards,
Elizer