Create a Webhook
curl --request POST \
--url https://schoolmaker.co/api/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"webhook_url": "<string>",
"provider": "<string>",
"extra_parameters": {
"step_type": [],
"offerFilter": [
"<string>"
],
"activeLevels": [
123
],
"user_ids": [
"<string>"
]
}
}
'import requests
url = "https://schoolmaker.co/api/v1/webhooks"
payload = {
"webhook_url": "<string>",
"provider": "<string>",
"extra_parameters": {
"step_type": [],
"offerFilter": ["<string>"],
"activeLevels": [123],
"user_ids": ["<string>"]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
webhook_url: '<string>',
provider: '<string>',
extra_parameters: {
step_type: [],
offerFilter: ['<string>'],
activeLevels: [123],
user_ids: ['<string>']
}
})
};
fetch('https://schoolmaker.co/api/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://schoolmaker.co/api/v1/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'webhook_url' => '<string>',
'provider' => '<string>',
'extra_parameters' => [
'step_type' => [
],
'offerFilter' => [
'<string>'
],
'activeLevels' => [
123
],
'user_ids' => [
'<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://schoolmaker.co/api/v1/webhooks"
payload := strings.NewReader("{\n \"webhook_url\": \"<string>\",\n \"provider\": \"<string>\",\n \"extra_parameters\": {\n \"step_type\": [],\n \"offerFilter\": [\n \"<string>\"\n ],\n \"activeLevels\": [\n 123\n ],\n \"user_ids\": [\n \"<string>\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://schoolmaker.co/api/v1/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"webhook_url\": \"<string>\",\n \"provider\": \"<string>\",\n \"extra_parameters\": {\n \"step_type\": [],\n \"offerFilter\": [\n \"<string>\"\n ],\n \"activeLevels\": [\n 123\n ],\n \"user_ids\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://schoolmaker.co/api/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"webhook_url\": \"<string>\",\n \"provider\": \"<string>\",\n \"extra_parameters\": {\n \"step_type\": [],\n \"offerFilter\": [\n \"<string>\"\n ],\n \"activeLevels\": [\n 123\n ],\n \"user_ids\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"webhook_url": "<string>",
"event_type": "<string>",
"provider": "<string>",
"extra_parameters": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Webhooks
Create a Webhook
Create a webhook for events: element_completed, element_pending, member_joining_offer, new_payment, member_inactivity, gamification_level_passed, conversation_message_received
POST
/
webhooks
Create a Webhook
curl --request POST \
--url https://schoolmaker.co/api/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"webhook_url": "<string>",
"provider": "<string>",
"extra_parameters": {
"step_type": [],
"offerFilter": [
"<string>"
],
"activeLevels": [
123
],
"user_ids": [
"<string>"
]
}
}
'import requests
url = "https://schoolmaker.co/api/v1/webhooks"
payload = {
"webhook_url": "<string>",
"provider": "<string>",
"extra_parameters": {
"step_type": [],
"offerFilter": ["<string>"],
"activeLevels": [123],
"user_ids": ["<string>"]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
webhook_url: '<string>',
provider: '<string>',
extra_parameters: {
step_type: [],
offerFilter: ['<string>'],
activeLevels: [123],
user_ids: ['<string>']
}
})
};
fetch('https://schoolmaker.co/api/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://schoolmaker.co/api/v1/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'webhook_url' => '<string>',
'provider' => '<string>',
'extra_parameters' => [
'step_type' => [
],
'offerFilter' => [
'<string>'
],
'activeLevels' => [
123
],
'user_ids' => [
'<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://schoolmaker.co/api/v1/webhooks"
payload := strings.NewReader("{\n \"webhook_url\": \"<string>\",\n \"provider\": \"<string>\",\n \"extra_parameters\": {\n \"step_type\": [],\n \"offerFilter\": [\n \"<string>\"\n ],\n \"activeLevels\": [\n 123\n ],\n \"user_ids\": [\n \"<string>\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://schoolmaker.co/api/v1/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"webhook_url\": \"<string>\",\n \"provider\": \"<string>\",\n \"extra_parameters\": {\n \"step_type\": [],\n \"offerFilter\": [\n \"<string>\"\n ],\n \"activeLevels\": [\n 123\n ],\n \"user_ids\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://schoolmaker.co/api/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"webhook_url\": \"<string>\",\n \"provider\": \"<string>\",\n \"extra_parameters\": {\n \"step_type\": [],\n \"offerFilter\": [\n \"<string>\"\n ],\n \"activeLevels\": [\n 123\n ],\n \"user_ids\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"webhook_url": "<string>",
"event_type": "<string>",
"provider": "<string>",
"extra_parameters": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Webhooks will allow you to detect when a specified event occurs. Supported event types include:
element_completed→ When a step is completed- extra_parameters:
step_type→ One or more step types. Leave empty to include all step types. Supported values arebasic,input_text,textarea,link,quiz,post,topic,milestone,file_upload, andform
- extra_parameters:
element_pending→ When a member submits an answer that needs to be corrected.- extra_parameters:
step_type→ One or more step types. Leave empty to include all applicable step types. Supported values areinput_text,textarea,post,topic,milestone, andfile_upload
- extra_parameters:
member_joining_offer→ When a member is added to an offer- extra_parameters:
offerFilter→ An offer ID or multiple offer IDs separated by commas. This event will only trigger if the member is added to an offer that matches the filter
- extra_parameters:
new_payment→ When a member initiates a new payment (whether it is on a one-time offer price, a multiple installment price, or a subscription)member_inactivity→ Will trigger at the same time as the member inactivity notification from SchoolMakergamification_level_passed→ Which will trigger when a level is passed in the community gamification feature- extra_parameters:
activeLevels→ A comma-separated list of level numbers. This event will only trigger if the member has passed a level that is in the list
- extra_parameters:
conversation_message_received→ When a User receives a new message in a conversation group- extra_parameters:
user_ids→ A list of User IDs. The event will only trigger when one of these Users receives the message. Leave empty to include all Usersauthor_types→ Usemembersorusersto filter messages by author type. Leave empty to include messages from both Members and Users
- extra_parameters:
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The URL where webhook payloads will be sent via POST requests. This should be a publicly accessible HTTPS endpoint that can receive and process the webhook events.
Available options:
element_completed, element_pending, member_joining_offer, new_payment, member_inactivity, gamification_level_passed, conversation_message_received Show child attributes
Show child attributes
Was this page helpful?