29 lines
537 B
Python
29 lines
537 B
Python
import os
|
|
import requests
|
|
import json
|
|
from dotenv import load_dotenv
|
|
|
|
load_dotenv()
|
|
token = os.getenv("BUFFER_ACCESS_TOKEN")
|
|
url = "https://api.buffer.com/graphql"
|
|
headers = {"Authorization": f"Bearer {token}", "Content-Type": "application/json"}
|
|
|
|
query = """
|
|
query {
|
|
__type(name: "AssetsInput") {
|
|
inputFields {
|
|
name
|
|
type {
|
|
name
|
|
kind
|
|
ofType { name kind }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
"""
|
|
|
|
resp = requests.post(url, headers=headers, json={'query': query})
|
|
print(json.dumps(resp.json(), indent=2))
|