24 lines
532 B
Python
24 lines
532 B
Python
|
|
import requests
|
||
|
|
|
||
|
|
group_in_school = "baf22792-56c4-4961-89db-e635639b2665"
|
||
|
|
person_uuid = input_data["user_id"]
|
||
|
|
|
||
|
|
|
||
|
|
url = "https://api.northpass.com/v2/people/"+person_uuid+"/relationships/groups"
|
||
|
|
|
||
|
|
payload = {"data": [
|
||
|
|
{
|
||
|
|
"type": "membership-groups",
|
||
|
|
"id": group_in_school
|
||
|
|
}
|
||
|
|
]}
|
||
|
|
headers = {
|
||
|
|
"Accept": "*/*",
|
||
|
|
"Content-Type": "application/json",
|
||
|
|
"X-Api-Key": "2SBAjkYGUoD0LqesDZq50RSex"
|
||
|
|
}
|
||
|
|
|
||
|
|
response = requests.request("POST", url, json=payload, headers=headers)
|
||
|
|
|
||
|
|
return response.text
|