Skip to main content
Solved

Response 400 when trying to use pagination for all cards

  • November 27, 2024
  • 2 replies
  • 60 views

AbelM

Hey guys, I’m trying to use the following query to get all cards by paginating my info with the following line of code but I’m getting a Response 400 as a response, if I remove the “after: endCursor” part it works perfect for my first 50 cards - any suggestions? 

payload = "{\"query\":\"{ allCards(pipeId: 304500848, after: \"WyI4LjAiLCIzMzEuMCIsMTAxMTE3MjI1N10\") { edges { node { id title fields { name report_value updated_at value } } } pageInfo { endCursor } } }\"}"

 

Best answer by natalia-manffre

Hi ​@AbelM! Could you try this one?

payload = "{\"query\":\"{ allCards(pipeId: 304500848, after: \\\"WyI4LjAiLCIzMzEuMCIsMTAxMTE3MjI1N10\\\") { edges { node { id title fields { name report_value updated_at value } } } pageInfo { endCursor } } }\"}"
 

I believe, the issue is related to how you are formatting the query string, specifically the escaping of quotes around the after value. Since you're nesting quotes within a JSON string, you need to escape them properly.

View original
Did this topic help you find an answer to your question?

2 replies

natalia-manffre
Pipefy Staff
Forum|alt.badge.img+1
  • Customer Support
  • 67 replies
  • Answer
  • November 28, 2024

Hi ​@AbelM! Could you try this one?

payload = "{\"query\":\"{ allCards(pipeId: 304500848, after: \\\"WyI4LjAiLCIzMzEuMCIsMTAxMTE3MjI1N10\\\") { edges { node { id title fields { name report_value updated_at value } } } pageInfo { endCursor } } }\"}"
 

I believe, the issue is related to how you are formatting the query string, specifically the escaping of quotes around the after value. Since you're nesting quotes within a JSON string, you need to escape them properly.


marcelo.shiba
Pipefy Staff
  • Pipefy Staff
  • 9 replies
  • November 28, 2024

I guess you have to “double-escape” the quote containing the end cursor (ie, add `\\`  before it):

payload = "{\"query\":\"{ allCards(pipeId: 304500848, after: \\\"WyI4LjAiLCIzMzEuMCIsMTAxMTE3MjI1N10\\\") { edges { node { id title fields { name report_value updated_at value } } } pageInfo { endCursor } } }\"}"

 

PS: ops… ​@natalia-manffre  was faster 🏃


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings