Send a Conversation Message
curl --request POST \
--url https://schoolmaker.co/api/v1/conversations/groups/{id}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_id": "058696d4-f2c8-472f-8c80-5e2208e9fcb1",
"message": "Hello, thanks for your message!"
}
'import requests
url = "https://schoolmaker.co/api/v1/conversations/groups/{id}/messages"
payload = {
"user_id": "058696d4-f2c8-472f-8c80-5e2208e9fcb1",
"message": "Hello, thanks for your message!"
}
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({
user_id: '058696d4-f2c8-472f-8c80-5e2208e9fcb1',
message: 'Hello, thanks for your message!'
})
};
fetch('https://schoolmaker.co/api/v1/conversations/groups/{id}/messages', 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/conversations/groups/{id}/messages",
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([
'user_id' => '058696d4-f2c8-472f-8c80-5e2208e9fcb1',
'message' => 'Hello, thanks for your message!'
]),
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/conversations/groups/{id}/messages"
payload := strings.NewReader("{\n \"user_id\": \"058696d4-f2c8-472f-8c80-5e2208e9fcb1\",\n \"message\": \"Hello, thanks for your message!\"\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/conversations/groups/{id}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"058696d4-f2c8-472f-8c80-5e2208e9fcb1\",\n \"message\": \"Hello, thanks for your message!\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://schoolmaker.co/api/v1/conversations/groups/{id}/messages")
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 \"user_id\": \"058696d4-f2c8-472f-8c80-5e2208e9fcb1\",\n \"message\": \"Hello, thanks for your message!\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"group_id": "<string>",
"user_id": "<string>",
"content": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}Conversations
Send a Conversation Message
Sends a message from an admin or moderator account to an existing conversation group. If the user is not already a participant, they will be added to the conversation group.
POST
/
conversations
/
groups
/
{id}
/
messages
Send a Conversation Message
curl --request POST \
--url https://schoolmaker.co/api/v1/conversations/groups/{id}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_id": "058696d4-f2c8-472f-8c80-5e2208e9fcb1",
"message": "Hello, thanks for your message!"
}
'import requests
url = "https://schoolmaker.co/api/v1/conversations/groups/{id}/messages"
payload = {
"user_id": "058696d4-f2c8-472f-8c80-5e2208e9fcb1",
"message": "Hello, thanks for your message!"
}
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({
user_id: '058696d4-f2c8-472f-8c80-5e2208e9fcb1',
message: 'Hello, thanks for your message!'
})
};
fetch('https://schoolmaker.co/api/v1/conversations/groups/{id}/messages', 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/conversations/groups/{id}/messages",
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([
'user_id' => '058696d4-f2c8-472f-8c80-5e2208e9fcb1',
'message' => 'Hello, thanks for your message!'
]),
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/conversations/groups/{id}/messages"
payload := strings.NewReader("{\n \"user_id\": \"058696d4-f2c8-472f-8c80-5e2208e9fcb1\",\n \"message\": \"Hello, thanks for your message!\"\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/conversations/groups/{id}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"058696d4-f2c8-472f-8c80-5e2208e9fcb1\",\n \"message\": \"Hello, thanks for your message!\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://schoolmaker.co/api/v1/conversations/groups/{id}/messages")
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 \"user_id\": \"058696d4-f2c8-472f-8c80-5e2208e9fcb1\",\n \"message\": \"Hello, thanks for your message!\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"group_id": "<string>",
"user_id": "<string>",
"content": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the conversation group
Body
application/json
Was this page helpful?
⌘I