Skip to Content
Jan 28, 2021 at 11:36 AM

SAP CPI issue HTTP operation failed invoking https://xyz/graphql with statusCode: 400

2444 Views Last edit Feb 01, 2021 at 10:51 AM 2 rev

Hello All,

Our requirement is to query a GraphQL based api from CPI and push the response to C4C for ticket creation and customer creation.

So we are able to fetch the Bearer token for OAuth based authentication in CPI but when I try to push the same graphql request payload from CPI to the Rest API endpoint which is very much working and giving the response back from Postman, it gives the underlying error

"Error Details

org.apache.camel.component.ahc.AhcOperationFailedException: HTTP operation failed invoking https://xyz/graphql with statusCode: 400 "This API request in GraphQL would give a JSON response and the same can be handled by CPI using standard convertors available.

But the API not being able to comprehend my GraphQL request itself is the issue.

Update to clarify:

When I say that exactly the same payload worked with postman successfully but did not work with CPI HTTP adapter. The only difference there is as per my observation has been the radio button that we select to announce the request content type in POSTMAN.

I havnt found a way to tell my CPI editor that this is a GraphQL request payload that i am posting.

Not sure what header/parameter do I need to update to replicate this setting in CPI.

Note: I have maintained each and every header as postman in CPI too. But none states anything about GraphQL content type.

How should I handle the scenario here. Any suggestions ?