Solved

Python Query

  • 28 September 2020
  • 1 reply
  • 373 views

Userlevel 4

Hi, could you show me what is wrong? 
import requests

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

payload = """{ "query": "{ pipe (id: 549212) {name}}"}"""
headers = {
'authorization': "Bearer xxxxxx",
'content-type': "application/json"
}

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

print(response.text)

When I executed this, give me the error:
{"errors":[{"message":"no \"data\" or \"errors\" in response from origin"}]}

Thank you

icon

Best answer by Marcos Carvalho 28 September 2020, 19:59

View original

1 reply

Userlevel 6
Badge +6

Hey Paulo, how are you? 

 

The escaping in your request is not correct. 

 

Here the request in Python: 

 

import requests

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

payload = {"query": "{ pipe (id: 549212) {name}}"}
headers = {
"authorization": "Bearer YOUR_TOKEN",
"content-type": "application/json"
}

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

print(response.text)

 

 

We have a console in our developers page to help you with Pipefy API requests in cURL, Node, Ruby, JS and Python.

 

 

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

Reply