From f7e0a20cf375f7afa85d0c9e37b4bbbfa0c1e5ed Mon Sep 17 00:00:00 2001 From: Norm Rasmussen Date: Wed, 6 Dec 2023 16:28:43 -0500 Subject: [PATCH] Zenjob notes. Webhook testing and python scripts. --- CustomerNotes/Zenjob/Zenjob.md | 7 ++++-- Scripts/API_Tests/getuuid_from_email.py | 3 ++- Scripts/API_Tests/workato_for_test.py | 29 +++++++++++++++++++++++++ Scripts/webhook_test.py | 8 +++---- 4 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 Scripts/API_Tests/workato_for_test.py diff --git a/CustomerNotes/Zenjob/Zenjob.md b/CustomerNotes/Zenjob/Zenjob.md index 875fd5da..6fbc37f7 100644 --- a/CustomerNotes/Zenjob/Zenjob.md +++ b/CustomerNotes/Zenjob/Zenjob.md @@ -150,8 +150,11 @@ Thanks, Sophie, and Viky! Enjoy your vacation, Sophie! Talk to you when you retu Best, Norm -## 10/11/2023 +## 12/05/2023 -### Sophie back from PTO +### Arun (Engineer) Questions + +Unable to view assignment in API, but assignment shows up in Analytics +It was because he was previewing and submitting the assignment as a manager. diff --git a/Scripts/API_Tests/getuuid_from_email.py b/Scripts/API_Tests/getuuid_from_email.py index f7f60405..bcd9c9f1 100644 --- a/Scripts/API_Tests/getuuid_from_email.py +++ b/Scripts/API_Tests/getuuid_from_email.py @@ -48,7 +48,8 @@ def getfromEmail(BASEURLEMAIL, APIKEY): # print(response) email = response["data"] # print("Learner ID:" ) - pp.pprint(email) + #pp.pprint(email) + print(email) def getfromUuid(BASEURL, APIKEY): diff --git a/Scripts/API_Tests/workato_for_test.py b/Scripts/API_Tests/workato_for_test.py new file mode 100644 index 00000000..0a1657f9 --- /dev/null +++ b/Scripts/API_Tests/workato_for_test.py @@ -0,0 +1,29 @@ +import json +import pprint +import requests +import Apikeys + +BASEURLEMAIL = "https://api.northpass.com/v2/people?filter[email][cont]=" +APIKEY = Apikeys.DATASNIPPER + +def getfromEmail(BASEURLEMAIL, APIKEY): + email = "datasnipper.com" + url = BASEURLEMAIL + f"{email}" + headers = { + "accept": "*/*", + "x-api-key": APIKEY, + "content-type": "application/json", + } + response = requests.get(url, headers=headers) + if response.status_code == 200: + print("200 Error!") + else: + print("Another Error!") + # response = response.json() + email = str(response.text) + input_json = json.loads(email) + for item in input_json["data"]: + print(item["id"]) + +if __name__ == "__main__": + getfromEmail(BASEURLEMAIL, APIKEY) diff --git a/Scripts/webhook_test.py b/Scripts/webhook_test.py index e401eb83..186c3ced 100644 --- a/Scripts/webhook_test.py +++ b/Scripts/webhook_test.py @@ -5,11 +5,11 @@ URL = "https://webhooks.workato.com/webhooks/rest/3aa0af60-6363-4cc6-9f2a-34b9e1 DATA = { "payload": { - "company": "MJ CPA AUDIT & TAX (RSMA)", + "company": "ExampleCompany1", "package": "Advanced", - "segment": "", - "industry": "ACCOUNTING", - "company_domain": "mjcpa.com", + "segment": "exampleSegment", + "industry": "INDUSTRIAL", + "company_domain": "example_company.com", "health_category": 1, "contract_expires": 1716768000000, "onboarding_stage": "Start",