Skip to main content

I am trying to get data using pipefy API
following is the query which i am using in my java code to execute post request on pipefy but i am getting following error 

query-:
query allCardUpdatedYesterday {
card(id: "785258522") {
current_phase {
name
}
}

error-:
{"errors":s{"message":"Unexpected end of document","locations":s]}]}

(note -: using spring boot 2.5.5 with java 11)

Hello @rahil-khan, I was hoping you could provide me with the complete code snippet for the request you mentioned earlier. My main concern is whether or not you included the `Content-Type` header in the request and set it to `application/json`. Although the query itself appears to be fine, I'd like to confirm this aspect to ensure everything is working as intended.

 

Thank you.


Hi @gabriel-custodio , Kindly go through the code snippet I have attached and as required I have included the content-type and getting the below exception.

HttpHeaders headers = new HttpHeaders();

headers.set(HttpHeaders.AUTHORIZATION, "Bearer " + apiKey);

headers.setContentType(MediaType.APPLICATION_JSON);

 

HttpEntity<String> requestEntity = new HttpEntity<>(testQuery, headers);

 

ResponseEntity<String> responseEntity = restTemplate.exchange(apiUrl, HttpMethod.POST, requestEntity,

String.class);

 

return requestEntity.getBody()+" "+responseEntity;

exception:

{
    "timestamp": "2024-04-17T05:05:53.241+00:00",
    "status": 500,
    "error": "Internal Server Error",
    "path": "/payment-export-reports/api/esb/v1/data"
}


Hello @rahil-khan!

To make the first appointment, could you try this way?

query allCardUpdatedYesterday {
card(id: "785258522") {
current_phase {
name
}
}

 

Let me know if it worked :)


Hello @rahil-khan,

 

I noticed that according to the error message you provided, that you were trying to use an endpoint named `/payment-export-reports/api/esb/v1/data`. However, this endpoint is not exposed by Pipefy, is it? I am wondering if you meant to use `/graphql` instead? 


Hi @rahil-khan!

Were you able to execute this?

 

If you're still having problems, could you give us the information that Gabriel asked about, please?


Hello @rahil-khan,

 

I noticed that according to the error message you provided, that you were trying to use an endpoint named `/payment-export-reports/api/esb/v1/data`. However, this endpoint is not exposed by Pipefy, is it? I am wondering if you meant to use `/graphql` instead? 

Good!


Hello Pipefy community, after exhausting all possible solutions, I finally managed to resolve the issue by upgrading to Spring Boot version 17. This version includes GraphQL starter dependencies, making it much easier to access GraphQL APIs. Thank you to everyone for your assistance and suggestions.


Thank you for sharing with us @rahil-khan 


Reply