From a9a7d0739e38b8e36129a22555c1ec315d4cd1fa Mon Sep 17 00:00:00 2001 From: Norm Rasmussen Date: Tue, 17 Sep 2024 16:12:57 -0400 Subject: [PATCH] Doordash sample braze call. Walmart resource PDF. --- CustomerNotes/Doordash/sample_braze_call.py | 26 ++ Scripts/Walmart/Spark/single_resource.js | 3 +- Scripts/webhook_test.py | 249 +++++++++++++++++++- 3 files changed, 263 insertions(+), 15 deletions(-) create mode 100644 CustomerNotes/Doordash/sample_braze_call.py diff --git a/CustomerNotes/Doordash/sample_braze_call.py b/CustomerNotes/Doordash/sample_braze_call.py new file mode 100644 index 00000000..38872244 --- /dev/null +++ b/CustomerNotes/Doordash/sample_braze_call.py @@ -0,0 +1,26 @@ +course_payload = { + "attributes": [ + { + "first_name": "", + "last_name": "", + "email": "", + "course_attempt_number": "", + "course_progress": "", + "course_name": "", + "last_activity_completed": "", + } + ] +} +quiz_payload = { + "attributes": [ + { + "first_name": "", + "last_name": "", + "email": "", + "quiz_name": "", + "quiz_attempt": "", + "quiz_score": "", + "course_name": "", + } + ] +} diff --git a/Scripts/Walmart/Spark/single_resource.js b/Scripts/Walmart/Spark/single_resource.js index f8601b76..7499f27f 100644 --- a/Scripts/Walmart/Spark/single_resource.js +++ b/Scripts/Walmart/Spark/single_resource.js @@ -8,8 +8,7 @@ const apiKey = "6hUfJdAartHTHhHc0WIRZYPWe" // Luminate Production ^ const uid = "/\?uid\=7beg87y4-fh24-4929-3rt5-24kdn87s5241"; const groupIds = [ - 'efdfb1a5-58c8-4fd4-a31c-60946e73b6ed', - '563b97ed-6d1f-4fd9-a9eb-82842e13468e' + '2fc475e8-d55a-4aec-be43-d78ef27ba4ae' ] const getAllGroups = async (num) => { diff --git a/Scripts/webhook_test.py b/Scripts/webhook_test.py index 186c3ced..4f1640e1 100644 --- a/Scripts/webhook_test.py +++ b/Scripts/webhook_test.py @@ -1,26 +1,249 @@ import json import requests -URL = "https://webhooks.workato.com/webhooks/rest/3aa0af60-6363-4cc6-9f2a-34b9e132cc2c/hubspot-webhook" +URL = "https://webhooks.workato.com/webhooks/rest/c98e26af-6fdf-423d-b7ee-899f208956a0/doordash-activity-completion" + +# DoorDash Quiz Completion +# "https://webhooks.workato.com/webhooks/rest/c98e26af-6fdf-423d-b7ee-899f208956a0/doordash-quiz-completion" + +#DoorDash Course Completion +# DATA = { - "payload": { - "company": "ExampleCompany1", - "package": "Advanced", - "segment": "exampleSegment", - "industry": "INDUSTRIAL", - "company_domain": "example_company.com", - "health_category": 1, - "contract_expires": 1716768000000, - "onboarding_stage": "Start", - "onboarding_end_date": "" - }, -"params": {}, + "data":{ + "id":"44444444-4444-4444-4444-444444444444", + "type":"activity_completed_events", + "links":{}, + "included":[ + { + "id":"abcdefghi-1234-jklm-5678-nopqrstuvwxy", + "type":"people", + "links":{ + "self":"https://api.northpass.com/v2/people/abcdefghi-1234-jklm-5678-nopqrstuvwxy", + "teaching":"https://app.northpass.com/people/abcdefghi-1234-jklm-5678-nopqrstuvwxy" + }, +"attributes":{ + "name":"Jill Smith", + "email":"jillsmith@example.com", + "sso_uid":"jillsmith@example.com", + "full_name":"Jill Smith", + "created_at":"2022-04-08T17:55:42Z", + "first_name":"Jill", + "updated_at":"2022-04-08T17:55:42Z", + "activated_at":"2022-04-08T17:55:42Z", + "unsubscribed":False, + "last_active_at":"2022-04-08T17:58:47Z" + }, + "relationships":{ + "school":{ + "data":{ + "id":"00000000-0000-0000-0000-000000000000", + "type":"schools" + } + } + } + }, + { + "id":"zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzz", + "type":"courses", + "links":{ + "self":"https://api.northpass.com/v2/courses/zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzz", + "build":{ + "href":"https://app.northpass.com/courses/abcdefgh/builder", + "methods":[ + "get" + ] + }, + "clone":"https://app.northpass.com/courses/abcdefgh/clone", + "preview":"/previews/courses/abcdefgh", + "teaching":"https://app.northpass.com/courses/abcdefgh" + }, + "attributes":{ + "name":"Onboarding 101", + "status":"live", + "for_sale":True, + "permalink":"abcdefgh", + "created_at":"2020-09-01T16:36:33Z", + "updated_at":"2022-04-08T17:58:37Z", + "list_image_url":"Image URL here", + "enrollments_count":2215, + "share_course_link":"https://subdomain.northpass.com/outline/abcdefgh/cover", + "course_enrollment_link":"https://subdomain.northpass.com/c/abcdefghijklmnopqrstuvwxyz" + }, + "relationships":{ + "categories":{ + "data":[] + }, + "instructor_partnerships":{ + "data":[] + } + } + }, + { + "id":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + "type":"activities", + "links":{ + "teaching":"https://app.northpass.com/courses/abcdefgh/builder/activities/ijklmnop", + "course_builder":"https://app.northpass.com/courses/abcdefgh/builder" + }, + "attributes":{ + "title":"Getting Started", + "course_name":"Onboarding 101" + } + } + ], + "attributes":{ + "value":12, + "created_at":"2022-04-08T17:58:49Z", + "course_attempt_number":1 + }, + "relationships":{ + "course":{ + "data":{ + "id":"zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzz", + "type":"courses" + } + }, + "person":{ + "data":{ + "id":"abcdefghi-1234-jklm-5678-nopqrstuvwxy", + "type":"people" + } + }, + "activity":{ + "data":{ + "id":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + "type":"activities" + } + } + } + } } + HEADERS = {"content-type": "application/json"} response = requests.post(URL, data=json.dumps(DATA)) print(response.status_code) print(response.text) + + +{ + "payload": { + "data": { + "id": "324198cf-cab3-444b-bb4d-ffe4d31b4f7f", + "type": "activity_completed_events", + "links": {}, + "included": [ + { + "id": "a88729f9-92f2-4381-ab28-4035cb4d3592", + "type": "people", + "links": { + "self": "https://api.northpass.com/v1/people/a88729f9-92f2-4381-ab28-4035cb4d3592", + "teaching": "https://app.northpass.com/people/a88729f9-92f2-4381-ab28-4035cb4d3592" + }, + "attributes": { + "name": "Gus Parham", + "email": "gupar51@gmail.com", + "sso_uid": "gupar51@gmail.com", + "full_name": "Gus Parham", + "last_name": "Parham ", + "created_at": "2024-09-17T19:35:44.000000+00:00", + "first_name": "Gus", + "updated_at": "2024-09-17T20:06:26.000000+00:00", + "activated_at": "2024-09-17T19:35:44.000000+00:00", + "unsubscribed": false, + "last_active_at": "2024-09-17T20:06:26.000000+00:00" + }, + "relationships": { + "school": { + "data": { + "id": "a842c0ec-e681-4bfc-b6df-97075d3ff265", + "type": "schools" + } + } + } + }, + { + "id": "e918a598-a6d8-4dcd-9207-0746d0ee192a", + "type": "courses", + "links": { + "self": "https://api.northpass.com/v1/courses/e918a598-a6d8-4dcd-9207-0746d0ee192a", + "build": { + "href": "https://app.northpass.com/courses/nafkkwfx/builder", + "methods": [ + "get" + ] + }, + "clone": "https://app.northpass.com/courses/nafkkwfx/clone", + "preview": "/previews/courses/nafkkwfx", + "teaching": "https://app.northpass.com/courses/nafkkwfx" + }, + "attributes": { + "name": "DashLink Basics", + "status": "live", + "permalink": "nafkkwfx", + "created_at": "2024-05-24T19:19:00.000000+00:00", + "updated_at": "2024-09-17T20:03:43.000000+00:00", + "list_image_url": "https://cdn.filestackcontent.com/security=policy:eyJ3Ijo4MjAsImgiOjUwMCwiZml0IjoiY3JvcCIsImV4cGlyeSI6MTcyNjY1ODA4NCwiY2FsbCI6WyJyZWFkIiwiY29udmVydCIsInN0b3JlIiwicGljayIsInJlbW92ZSJdfQ==,signature:6bef5fcf0bfd2a796151ede34d792b9b0f6688b80590849cdd94cb17eeaf4ac0/resize=width:820,height:500,fit:crop/G5h4wupUQBqTrP7G78AG", + "enrollments_count": 5945, + "share_course_link": "https://doordash.northpass.com/app/courses/e918a598-a6d8-4dcd-9207-0746d0ee192a", + "course_enrollment_link": "https://doordash.northpass.com/c/e378bd4ea246bf537925b49771155a4af4ade5d9" + }, + "relationships": { + "categories": { + "data": [ + { + "id": "2364d17a-33ac-4652-8c85-5f93afae260c", + "type": "categories" + } + ] + }, + "instructor_partnerships": { + "data": [] + } + } + }, + { + "id": "2073e628-495f-4a8f-a61b-32b19897c1ca", + "type": "activities", + "links": { + "teaching": "https://app.northpass.com/courses/nafkkwfx/builder/activities/NjBCUq-W8", + "course_builder": "https://app.northpass.com/courses/nafkkwfx/builder" + }, + "attributes": { + "title": "How to Pickup DashLink Orders?", + "course_name": "DashLink Basics" + } + } + ], + "attributes": { + "value": 60, + "created_at": "2024-09-17T20:06:26.000000+00:00", + "course_attempt_number": 2 + }, + "relationships": { + "course": { + "data": { + "id": "e918a598-a6d8-4dcd-9207-0746d0ee192a", + "type": "courses" + } + }, + "person": { + "data": { + "id": "a88729f9-92f2-4381-ab28-4035cb4d3592", + "type": "people" + } + }, + "activity": { + "data": { + "id": "2073e628-495f-4a8f-a61b-32b19897c1ca", + "type": "activities" + } + } + } + } + }, + "params": {} +}