Skip to main content
Solved

Trying to get all Cards

  • August 28, 2020
  • 1 reply
  • 457 views

Paulo Ribas
Pipefy Staff

Hi.

Using Python to make requests, what is wrong with the query bellow?pipeId = '171258'
query =""""""
{
""query"": ""{allCards(pipeId: %s, first: 30, after: 'WyIxLjAiLCI1ODAuMCIsMzI0OTU0NF0'){pageInfo{endCursor hasNextPage}edges{node{id title}}}}""
}
""""""%(pipeid)The query worked pretty well until I added the ""after"" parameter.
I already tried variations like:
after: ""WyIxLjAiLCI1ODAuMCIsMzI0OTU0NF0""
after: \""WyIxLjAiLCI1ODAuMCIsMzI0OTU0NF0\""
after: \n""WyIxLjAiLCI1ODAuMCIsMzI0OTU0NF0\n""but without success, any help here will be immensely handful! Thanks

Best answer by Marcos Carvalho

Hey Paulo, how are you? 

You’re missing some escaping in your query.

 

Here an example in Python with the after parameter:

 



import requests

url = "https://api.pipefy.com/graphql"

payload = {"query": "{ allCards(pipeId: 301315434, after:\"WyIyLjAiLCI0LjAiLDM3NDc2MjcyNV0\") { edges { node { id title fields { name report_value updated_at value } } } pageInfo { endCursor } } }"}
headers = {
"authorization": "Bearer YOUR_TOKEN",
"content-type": "application/json"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text

 

 

If you have doubts about escaping, we have a console in Pipefy Developers page where you can input a query and have examples in Python, Ruby, JS, Node, cURL with it’s respective escaping. 

 

https://developers.pipefy.com/reference#graphql-endpoint

 

 

Hope it helps you =D 

1 reply

Marcos Carvalho
Pipefy Staff
Forum|alt.badge.img+6
  • Pipefy Staff
  • Answer
  • September 3, 2020

Hey Paulo, how are you? 

You’re missing some escaping in your query.

 

Here an example in Python with the after parameter:

 



import requests

url = "https://api.pipefy.com/graphql"

payload = {"query": "{ allCards(pipeId: 301315434, after:\"WyIyLjAiLCI0LjAiLDM3NDc2MjcyNV0\") { edges { node { id title fields { name report_value updated_at value } } } pageInfo { endCursor } } }"}
headers = {
"authorization": "Bearer YOUR_TOKEN",
"content-type": "application/json"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text

 

 

If you have doubts about escaping, we have a console in Pipefy Developers page where you can input a query and have examples in Python, Ruby, JS, Node, cURL with it’s respective escaping. 

 

https://developers.pipefy.com/reference#graphql-endpoint

 

 

Hope it helps you =D