Solved

Trying to get all Cards

  • 28 August 2020
  • 1 reply
  • 300 views

Userlevel 4

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

icon

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

Reply