Notes from SPS,Keystone,Walmart, and Glassdoor. Changed some templates in my sandbox.
This commit is contained in:
@ -7,4 +7,4 @@ normsandbox = "SlpQlju219WnWogn94dQUT6Yt"
|
||||
walmartprod = "6hUfJdAartHTHhHc0WIRZYPWe"
|
||||
recast = "9LISLpq7Ebqot3Xrggn5twKWZ"
|
||||
mizuno = "stXNF84HWL8aCGeRjHEo2rJ1U"
|
||||
|
||||
sps = "VNDXh8K4tLYJ-Nvp78bo6w"
|
||||
|
||||
Binary file not shown.
@ -1,16 +1,17 @@
|
||||
import requests
|
||||
import json
|
||||
import requests
|
||||
import Apikeys
|
||||
|
||||
|
||||
# url ="https://api.northpass.com/v2/groups/e6ef3e5f-b5a2-4b10-868b-8c165d76d263/learning_paths"
|
||||
# url = "https://api.northpass.com/v1/media?limit=1"
|
||||
# url = "https://api.northpass.com/v1/learning_paths"
|
||||
url = "https://api2.northpass.com/v2/courses"
|
||||
# url = "https://api2.northpass.com/v2/courses"
|
||||
|
||||
# function = sys.argv[1]
|
||||
apiKey = Apikeys.walmartprod
|
||||
# normuuid = "0b31c435-c18b-4573-984e-32cda57045b4"
|
||||
apiKey = Apikeys.normsandbox
|
||||
# normuuid = "3b2ac85d-2bdb-4183-a1c7-e0f49c58c4eb"
|
||||
group_uuid = "8be78542-ec43-4b5e-a662-77b403b4f049"
|
||||
|
||||
# Get Group Memberships:
|
||||
# url = "https://api.northpass.com/v2/groups/504c4771-223a-447f-9ec6-08e51bc9ca23/memberships"
|
||||
@ -21,6 +22,9 @@ apiKey = Apikeys.walmartprod
|
||||
# Associate a person with a Learning Path (Test):
|
||||
# url = f"https://api.northpass.com/v1/people/{normuuid}/relationships/learning_paths"
|
||||
|
||||
# Add Learning Paths to a Group (Test):
|
||||
url = f"https://api.northpass.com/v1/groups/{group_uuid}/relationships/learning_paths"
|
||||
|
||||
|
||||
def putTest(apiKey, url):
|
||||
payload = {
|
||||
@ -54,12 +58,16 @@ def getTest(apiKey, url):
|
||||
def postTest(apiKey, url):
|
||||
print(url)
|
||||
# Learning Path ID is for ID and change type to "enrolled-learning-paths"
|
||||
payload = {"data": [
|
||||
{
|
||||
"type": "enrolled-learning-paths",
|
||||
"id": "6ef5c9db-81d7-427c-846b-babb9a9a2ad1"
|
||||
}
|
||||
]}
|
||||
# payload = {"data": [
|
||||
# {
|
||||
# "type": "enrolled-learning-paths",
|
||||
# "id": "6ef5c9db-81d7-427c-846b-babb9a9a2ad1"
|
||||
# }
|
||||
# ]}
|
||||
# Add Learning Path to a Group Test
|
||||
payload = {"data": [{"type": "learning-paths", "id": "6ef5c9db-81d7-427c-846b-babb9a9a2ad1"}]}
|
||||
|
||||
|
||||
headers = {
|
||||
"accept": "application/json",
|
||||
"content-type": "application/json",
|
||||
@ -71,6 +79,6 @@ def postTest(apiKey, url):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
getTest(apiKey, url)
|
||||
# getTest(apiKey, url)
|
||||
# putTest(apiKey, url)
|
||||
# postTest(apiKey, url)
|
||||
postTest(apiKey, url)
|
||||
|
||||
13
Scripts/API_Tests/training_events.py
Normal file
13
Scripts/API_Tests/training_events.py
Normal file
@ -0,0 +1,13 @@
|
||||
import requests
|
||||
import Apikeys
|
||||
|
||||
|
||||
apikey = Apikeys.sps
|
||||
url = "https://api.northpass.com/v2/events"
|
||||
headers = {
|
||||
"accept": "application/json",
|
||||
"X-Api-Key": apikey
|
||||
}
|
||||
response = requests.get(url, headers=headers)
|
||||
resp = response.json()
|
||||
print(resp)
|
||||
Reference in New Issue
Block a user