Update get_apps.py
This commit is contained in:
parent
325fe0d80e
commit
9fc70acb4d
1 changed files with 28 additions and 30 deletions
58
get_apps.py
58
get_apps.py
|
@ -1,31 +1,29 @@
|
||||||
import os
|
import os
|
||||||
import requests
|
import requests
|
||||||
from dotenv import load_dotenv, dotenv_values
|
from dotenv import load_dotenv, dotenv_values
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
|
path = "/app/create"
|
||||||
baseurl = '' # replace with your actual URL
|
url = os.getenv("baseurl")+path
|
||||||
path = "/app/create"
|
|
||||||
url = os.getenv("baseurl")+path
|
data = {
|
||||||
|
"name": "imagebot",
|
||||||
data = {
|
"description": "imagebot <https://git.gay/Julimiro/imagebot/>",
|
||||||
"name": "test",
|
"permission":
|
||||||
"description": "test",
|
["read:drive","write:drive","write:messaging","write:notes"],
|
||||||
"permission":
|
"callbackUrl": "http://example.com"
|
||||||
["read:drive","write:drive","write:messaging","write:notes"],
|
}
|
||||||
"callbackUrl": "http://example.com"
|
|
||||||
}
|
# Define the headers, including the bearer token for authorization
|
||||||
|
headers = {
|
||||||
# Define the headers, including the bearer token for authorization
|
'Authorization': f'Bearer {os.getenv("api_key")}', # replace YOUR_ACCESS_TOKEN with your actual token
|
||||||
headers = {
|
'Content-Type': 'application/json'
|
||||||
'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)
|
||||||
# Send the POST request
|
|
||||||
response = requests.post(url, json=data, headers=headers)
|
# Print the response (optional)
|
||||||
|
print(response.status_code)
|
||||||
# Print the response (optional)
|
|
||||||
print(response.status_code)
|
|
||||||
print(response.json())
|
print(response.json())
|
Loading…
Reference in a new issue