Mizuno notes and other items, such as scripts.
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import requests
|
||||
import json
|
||||
|
||||
apiKey = "L93lGMSugtpmsBhSAkx3tei6B"
|
||||
apiKey = "HIDDEN_KEY"
|
||||
|
||||
|
||||
def getallUuid(apiKey):
|
||||
x = 0
|
||||
@ -9,10 +9,7 @@ def getallUuid(apiKey):
|
||||
while True:
|
||||
x += 1
|
||||
url = f"https://api.northpass.com/v2/people?page={x}"
|
||||
headers = {
|
||||
"accept": "application/json",
|
||||
"X-Api-Key": apiKey
|
||||
}
|
||||
headers = {"accept": "application/json", "X-Api-Key": apiKey}
|
||||
response = requests.get(url, headers=headers)
|
||||
jsonResponse = response.json()
|
||||
next = jsonResponse["links"]
|
||||
@ -20,28 +17,33 @@ def getallUuid(apiKey):
|
||||
for id in jsonResponse["data"]:
|
||||
user = id["id"]
|
||||
uuid.append(user)
|
||||
|
||||
|
||||
if "next" not in next:
|
||||
break
|
||||
print(uuid)
|
||||
addtoGroup(apiKey, uuid)
|
||||
|
||||
|
||||
def addtoGroup(apiKey, uuid):
|
||||
for x in uuid:
|
||||
url = f"https://api.northpass.com/v2/people/{x}/relationships/groups"
|
||||
payload = {"data": [
|
||||
{
|
||||
"type": "membership-groups",
|
||||
"id": "2f9aaac9-000a-4888-be33-3b65b76b5b9f"
|
||||
}]}
|
||||
payload = {
|
||||
"data": [
|
||||
{
|
||||
"type": "membership-groups",
|
||||
"id": "2f9aaac9-000a-4888-be33-3b65b76b5b9f",
|
||||
}
|
||||
]
|
||||
}
|
||||
headers = {
|
||||
"accept": "application/json",
|
||||
"content-type": "application/json",
|
||||
"X-Api-Key": apiKey
|
||||
"X-Api-Key": apiKey,
|
||||
}
|
||||
response = requests.post(url, json=payload, headers=headers)
|
||||
#jsonResponse = response.json()
|
||||
# jsonResponse = response.json()
|
||||
print(response)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
getallUuid(apiKey)
|
||||
|
||||
@ -2,18 +2,17 @@ import requests
|
||||
|
||||
apiKey = "SlpQlju219WnWogn94dQUT6Yt"
|
||||
url = "https://api.northpass.com/v1/media"
|
||||
#function = sys.argv[1]
|
||||
# function = sys.argv[1]
|
||||
|
||||
|
||||
def putTest(apiKey, url):
|
||||
|
||||
payload = {
|
||||
"data":
|
||||
{
|
||||
"type":"media",
|
||||
"file_name":"/Users/normrasmussen/Downloads/Shopping&Delivery 9 XP.mp4",
|
||||
}
|
||||
}
|
||||
"data": {
|
||||
"type": "media",
|
||||
"file_name": "/Users/normrasmussen/Downloads/Shopping&Delivery 9 XP.mp4",
|
||||
}
|
||||
}
|
||||
headers = {
|
||||
"accept": "application/json",
|
||||
"content-type": "application/json",
|
||||
@ -24,10 +23,7 @@ def putTest(apiKey, url):
|
||||
|
||||
|
||||
def getTest(apiKey, url):
|
||||
headers = {
|
||||
"accept": "application/json",
|
||||
"X-Api-Key": apiKey
|
||||
}
|
||||
headers = {"accept": "application/json", "X-Api-Key": apiKey}
|
||||
response = requests.get(url, headers=headers)
|
||||
print(response.text)
|
||||
|
||||
@ -36,7 +32,7 @@ def postTest(apiKey, url):
|
||||
headers = {
|
||||
"accept": "application/json",
|
||||
"content-type": "application/json",
|
||||
"X-Api-Key": apiKey
|
||||
"X-Api-Key": apiKey,
|
||||
}
|
||||
response = requests.post(url, headers=headers)
|
||||
print(response.text)
|
||||
|
||||
Reference in New Issue
Block a user