cancel
Showing results for 
Search instead for 
Did you mean: 

How to use POST method in Consume API service?

former_member689996
Discoverer
0 Kudos

Hi,

I am trying to use POST method with Consume API service. I tried to pass the Request parameters in the Body in JSON format. However, I am getting status code 500 INTERNAL_SERVER_ERROR.Any help will be great!

Regards,
Abhishek

Accepted Solutions (0)

Answers (1)

Answers (1)

johannes1
Advisor
Advisor

Hi Abhishek,

so basically Consume API Service is construction out of your configuration an HTTP request to your desired location, meaning backend server. As you already stated the body you were specifying is sent as JSON payload to the respective backend / external service.

The 500 Internal Server Error you are receiving from the external service you were calling is most probably not specific to how SAP Conversational AI works, but rather that you either have some error in the configuration for this call or the external service is actually having an issue. Unfortunately with the information you provided it is not possible to suppose the actual problem, as the backend – as already stated – is sending this error response and there can be various causes for this.

Which service do you try to call? Is this your own service or a publicly available service? To see the full response from you called service you could check the api_service_response. Therefor simply add a message after the service api call and add there {{api_service_response.default}} (default is the namespace for the service api call, you could change it in the Response tab).

To further debug your specific use case I would recommend to model the call to this external service within an API Testing Tool like Postman or cURL. Hopefully you are either able to reproduce the error to find its root cause or having built a working configuration in Postman which then you can rebuild within SAP Conversational AI.

I hope this helps solving your issue.

Thanks and best regards,

Johannes