Trying to get all Cards

  • 28 August 2020
  • 1 reply

Userlevel 5


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 3 September 2020, 15:27

View original

1 reply

Userlevel 6
Badge +6

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 = ""

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)




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.



Hope it helps you =D