From 9fc70acb4db441ac1615fa3d2c4bed348a2dd86b Mon Sep 17 00:00:00 2001 From: Julimiro Date: Mon, 19 Aug 2024 05:56:39 -0400 Subject: [PATCH] Update get_apps.py --- get_apps.py | 58 ++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/get_apps.py b/get_apps.py index 0f1215d..26ace2b 100644 --- a/get_apps.py +++ b/get_apps.py @@ -1,31 +1,29 @@ -import os -import requests -from dotenv import load_dotenv, dotenv_values - -load_dotenv() - - -baseurl = '' # replace with your actual URL -path = "/app/create" -url = os.getenv("baseurl")+path - -data = { - "name": "test", - "description": "test", - "permission": - ["read:drive","write:drive","write:messaging","write:notes"], -"callbackUrl": "http://example.com" -} - -# Define the headers, including the bearer token for authorization -headers = { - 'Authorization': f'Bearer {os.getenv("api_key")}', # replace YOUR_ACCESS_TOKEN with your actual token - 'Content-Type': 'application/json' -} - -# Send the POST request -response = requests.post(url, json=data, headers=headers) - -# Print the response (optional) -print(response.status_code) +import os +import requests +from dotenv import load_dotenv, dotenv_values + +load_dotenv() + +path = "/app/create" +url = os.getenv("baseurl")+path + +data = { + "name": "imagebot", + "description": "imagebot ", + "permission": + ["read:drive","write:drive","write:messaging","write:notes"], +"callbackUrl": "http://example.com" +} + +# Define the headers, including the bearer token for authorization +headers = { + 'Authorization': f'Bearer {os.getenv("api_key")}', # replace YOUR_ACCESS_TOKEN with your actual token + 'Content-Type': 'application/json' +} + +# Send the POST request +response = requests.post(url, json=data, headers=headers) + +# Print the response (optional) +print(response.status_code) print(response.json()) \ No newline at end of file