Skip to Content

How to use POST method in Consume API service?

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Jul 15, 2020 at 06:36 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.