Skip to main content
Solved

Python Query

  • September 28, 2020
  • 1 reply
  • 572 views

Paulo Ribas
Pipefy Staff

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

Best answer by Marcos Carvalho

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

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

1 reply

Marcos Carvalho
Pipefy Staff
Forum|alt.badge.img+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


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