Oi @joaosenna a extração é feita via Pyhton.
Abaixo o código para extração de todos os cards de um Pipe:
import requests
import pandas as pd
import json
token = 'X'
url = "https://api.pipefy.com/graphql"
nome_arquivo = 'pipefy'
payload = "{\"query\":\"{ allCards (pipeId:X) { edges { node { id title fields { name report_value updated_at value } } } }} \"}"
headers = {
"authorization": f"Bearer {token}",
"content-type": "application/json"
}
has_next_page = True
first_query = True
pipe_id = "X"
json_data = {}
records_df = pd.DataFrame()
while(has_next_page):
if first_query:
payload = {"query": "{ allCards (pipeId:\""+pipe_id+"\") { edges { node { id title fields { name report_value updated_at value } } } pageInfo {endCursor hasNextPage}}}"}
first_query = False
else:
payload = {"query": "{ allCards (pipeId:\""+pipe_id+"\",after:\""+end_cursor+"\") { edges { node { id title fields { name report_value updated_at value } } } pageInfo {endCursor hasNextPage}}}"}
response = requests.request("POST", url, json=payload, headers=headers)
json_data = json.loads(response.text)
end_cursor =json_data['data']['allCards']["pageInfo"]["endCursor"]
has_next_page = json_data["data"]["allCards"]["pageInfo"]["hasNextPage"]
total_records_pg = len(json_data["data"]["allCards"]["edges"])
for i in range(total_records_pg):
card_title = json_data["data"]["allCards"]["edges"][i]["node"]["title"]
card_data_d = json_data["data"]["allCards"]["edges"][i]["node"]["fields"]
card_data = {x['name']:x['value'] for x in card_data_d}
records_df = records_df.append(card_data, ignore_index=True)
records_df.info()
df = records_df
df.columns = df.columns.str.replace(' ', '_')
df.columns = df.columns.str.replace('ã', 'a')
df.columns = df.columns.str.replace('Á', 'A')
df.columns = df.columns.str.replace('é', 'e')
df.columns = df.columns.str.replace('ê', 'e')
df.columns = df.columns.str.replace('á', 'a')
df.columns = df.columns.str.replace('ç', 'c')
df.columns = df.columns.str.replace('í', 'i')
df.columns = df.columns.str.replace('ú', 'u')
df.columns = df.columns.str.replace('õ', 'o')
df.columns = df.columns.str.replace('ó', 'o')
df.columns = df.columns.str.replace('õ', 'o')
df.columns = df.columns.str.replace('.', '')
df = df.reset_index(drop=True)
Abaixo o código para extração de todos os registros de uma tabela (Link do Colab):
https://colab.research.google.com/drive/1iscCAFMzHw7B9uM4yuslIkealqlvaINI?usp=sharing