Webhooks for custom integration

Academy of Mine (AOM) allows integrating with other systems by notifying and sending them data on certain events/triggers using WebHook Endpoints. The events are:

  • New Account Created
  • Enrolled in a course
  • Submitted a Quiz
  • Submitted an assignment
  • Evaluated an assignment
  • Rejected an assignment
  • Submitted a discussion
  • New Order Placed
  • Order Failed
  • Order Refused
  • Payment Pending
  • New Announcement

Technically, AOM platform will call the WebHook endpoint added by you for a certain event/trigger. It sends an http POST request with a JSON payload to the endpoint which can then be utilized to do any processing as needed. One example could be utilizing the "New Account Created" event/trigger to add that user in your own CRM system (.e.g Hubspot, Salesforce etc). Every time a new account is created in the platform, the endpoint will be called by AOM. 

Below are the steps to enable and setup WebHooks in the platform:

1.     Navigate to the  Integrations tab in the Admin Dashboard. You can find it in the sidebar.

2.     Click on the  Manage button for the webhooks box.

3.     Enable the webhook option by activating the toggle.

4.     Click on Add Endpoint to add the Endpoint URL.

5.     Add details into the fields- Endpoint URLDescription (optional), and then select Events (one or more). You can select one or multiple events. Then click on Save. You have successfully added a webhook URL.

6.     The endpoint URL(s) added in the previous step can be seen in the list (as shown in the below figure.)

7.     To search an endpoint URL from the list, use the Select events menu. This enables you to search for a URL by events.

SAMPLE Payload JSON for each event


New Account Created:

Sample JSON :
{
"id":4,
"first_name":"John",
"last_name":"Doe",
"email":"johnDoe@academyofmine.com",
"date_registered":"Aug 11, 2020 04:58 PM"
}

Enrolled in a Course

Sample JSON :
{
"userList":
[{
"id":1,
"first_name":"Aom",
"last_name":"Staff",
"email":"dev@academyofmine.com"
}],
"enrolled_courses_list":
[{
"id":2,
"name":"test course to test all the events"
}
]}
<br>

Submiited a Quiz

Sample JSON :
{
"id":3,
"first_name":"Demo",
"last_name":"Student",
"email":"student@app.com",
"date_submitted":"Aug 11, 2020 01:37 PM",
"quiz":{
"id":3,
"name":"quiz 1"
},
"course":
{
"id":2,
"name":"test course to test all the evnts"},
"course_instructor_name":
{
"id":1,
"name":"Aom Staff"
}}
<br>

Submitted an Assignment

Sample JSON :
{
"first_name":"Demo",
"last_name":"Student",
"email":"student@app.com",
"date_submitted":"Aug 11, 2020 01:45 PM",
"assignment":
{
"id":"1",
"name":"assignment 1"
},
"course":
{
"id":2,
"name":"test course to test all the evnts"},
"course_instructor":
{
"id":1,
"name":"Aom Staff"
}}
<br>

Submitted a Discussion

Sample JSON :
{
"id":3,
"first_name":"Demo",
"last_name":"Student",
"email":"student@app.com",
"discussion":
{
"id":6,
"name":"Discussion Board"
},
"course":
{
"id":1,
"name":"Professional Development and Training"},
"course_instructor":
{
"id":1,
"name":"Aom Staff"
},
"date_submitted":"Aug 11, 2020 05:03 PM"}
<br>

New Announcement

Sample JSON :
{
"receivers":
[{
"first_name":"Demo",
"last_name":"Student",
"name":"Demo Student",
"email":"student@app.com"
},
{
"first_name":"Site",
"last_name":"Admin",
"name":"Site Admin",
"email":"ehj@academyofmine.com"
}],
"annoucement_date":"Aug 11, 2020 02:23 PM",
"announcement_content":"We have just released a new course on Professional Development. You can purchase it in the course catalog",
"announcement_title":"Test announcement",
"created_by":"Aom Staff"
}
<br>

New Order Placed (Successful payment)

Sample JSON :
{
"id":19,
"date_created":"Aug 11, 2020 07:45 PM",
"status":"COMPLETED",
"currency":"United States (US) dollar",
"order_total":220,
"sub_total":220,
"transaction_ref":null,
"payment_gateway":
{
"id":"Unknown",
"name":"Manual order"},
"customer":
{
"id":3,
"first_name":"Demo",
"last_name":"Student",
"email":"student@app.com",
"billing_address":
{
"full_name":"John doe",
"address_line_1":"123 John St",
"address_line_2":"Suite 309",
"city":"New York",
"country":"US",
"state":"NY",
"zipcode":"10017"
}
},
"line_items":
[{
"product_id":1,
"product_name":"Product",
"quantity":1,
"price_per_qty":"110.00",
"total":"110.00"
},
{
"product_id":2,
"product_name":"Prod 2",
"quantity":1,
"price_per_qty":"110.00",
"total":"110.00"}
],
"coupons":[],
"notes":[]
}
<br>

Failed Order (payment did not go through)

Sample JSON :
{
"id":19,
"date_created":"Aug 11, 2020 07:45 PM",
"status":"FAILED",
"currency":"United States (US) dollar",
"order_total":220,
"sub_total":220,
"transaction_ref":null,
"payment_gateway":
{
"id":"Unknown",
"name":"Manual order"},
"customer":
{
"id":3,
"first_name":"Demo",
"last_name":"Student",
"email":"student@app.com",
"billing_address":
{
"full_name":"John doe",
"address_line_1":"123 John St",
"address_line_2":"Suite 309",
"city":"New York",
"country":"US",
"state":"NY",
"zipcode":"10017"
}
},
"line_items":
[{
"product_id":1,
"product_name":"Product",
"quantity":1,
"price_per_qty":"110.00",
"total":"110.00"
},
{
"product_id":2,
"product_name":"Prod 2",
"quantity":1,
"price_per_qty":"110.00",
"total":"110.00"}
],
"coupons":[],
"notes":[]
}
<br>

Order Refunded

Sample JSON :
{
"id":19,
"date_created":"Aug 11, 2020 07:45 PM",
"status":"REFUNDED",
"currency":"United States (US) dollar",
"order_total":220,
"sub_total":220,
"transaction_ref":null,
"payment_gateway":
{
"id":"Unknown",
"name":"Manual order"},
"customer":
{
"id":3,
"first_name":"Demo",
"last_name":"Student",
"email":"student@app.com",
"billing_address":
{
"full_name":"John doe",
"address_line_1":"test",
"address_line_2":"test",
"city":"Durg",
"country":"US",
"state":"AL",
"zipcode":"491001"
}
},
"line_items":
[{
"product_id":1,
"product_name":"Product",
"quantity":1,
"price_per_qty":"110.00",
"total":"110.00"
},
{
"product_id":2,
"product_name":"Prod 2",
"quantity":1,
"price_per_qty":"110.00",
"total":"110.00"}
],
"coupons":[],
"notes":[]
}