Код: Выделить всё
import requests
TOKEN = “personal token”
FILE_KEY = “the string between “design” and /name of file”
HEADERS = {“Authorization”: f"Bearer {TOKEN}"}
url = f"https://api.figma.com/v1/files/{FILE_KEY}"
response = requests.get(url, headers=HEADERS)
if response.status_code == 200:
print(“OK”)
elif response.status_code == 403:
print(“Error 403: Invalid token.”)
elif response.status_code == 401:
print(“Error 401”)
else:
print(f"Error {response.status_code}: {response.text}")
Подробнее здесь: https://stackoverflow.com/questions/792 ... le-problem