Hi, Can't figure what is wrong with my code in Python, I'm trying to get all the pipes from a company, my code is the following and the response I getting is 404, I already tried different things like make the "query" in a single row using "\" to escape the caracteres: import requests
url = "https://api.pipefy.com/graphql"
headers = {
'authorization': "Bearer company_token",
'content-type': "application/json"
} query = """
{
"query": "{organization(id: 16094){pipes{id}}}"
}
""" response = requests.get(url, data=query, headers=headers) print(response.text)
Solved
Trying to get all pipes using Python
Best answer by Marcos Carvalho
Hey Nigel,
Some escaping is missing in your request.
Here the query in Python to get the pipes in a organization:
import requests
url = "https://api.pipefy.com/graphql"
payload = "{\"query\":\"{ organization(id: 307747) { pipes { id name } } }\"}"
headers = {
"authorization": "Bearer YOUR_TOKEN",
"content-type": "application/json"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
If you have any doubts on converting the query for Python, you can check our console with some examples in cURL, Node, Ruby, JS and Python :)
https://developers.pipefy.com/reference#graphql-endpoint
Reply
Join us in the Pipefy Community! 🚀
No account yet? Create an account
Login with your Pipefy credentials
or
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.