Send a Slack blast
curl --request POST \
--url https://attend.hackclub.com/api/v1/events/{event_id}/slack_blasts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "Doors open at 9am!"
}
'import requests
url = "https://attend.hackclub.com/api/v1/events/{event_id}/slack_blasts"
payload = { "message": "Doors open at 9am!" }
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({message: 'Doors open at 9am!'})
};
fetch('https://attend.hackclub.com/api/v1/events/{event_id}/slack_blasts', 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://attend.hackclub.com/api/v1/events/{event_id}/slack_blasts",
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([
'message' => 'Doors open at 9am!'
]),
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://attend.hackclub.com/api/v1/events/{event_id}/slack_blasts"
payload := strings.NewReader("{\n \"message\": \"Doors open at 9am!\"\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://attend.hackclub.com/api/v1/events/{event_id}/slack_blasts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"Doors open at 9am!\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://attend.hackclub.com/api/v1/events/{event_id}/slack_blasts")
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 \"message\": \"Doors open at 9am!\"\n}"
response = http.request(request)
puts response.read_body{
"slack_blast": {
"id": 12,
"message": "<string>",
"status": "pending",
"recipient_count": 123,
"sent_count": 123,
"failed_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"sent_by": "<string>"
}
}{
"error": "Unauthorized"
}{
"error": "Unauthorized"
}{
"error": "Unauthorized"
}{
"error": "Unauthorized"
}Slack Blasts
Send a Slack blast
Broadcast a message to every completed participant with a linked Slack account, and enqueue delivery.
POST
/
events
/
{event_id}
/
slack_blasts
Send a Slack blast
curl --request POST \
--url https://attend.hackclub.com/api/v1/events/{event_id}/slack_blasts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "Doors open at 9am!"
}
'import requests
url = "https://attend.hackclub.com/api/v1/events/{event_id}/slack_blasts"
payload = { "message": "Doors open at 9am!" }
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({message: 'Doors open at 9am!'})
};
fetch('https://attend.hackclub.com/api/v1/events/{event_id}/slack_blasts', 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://attend.hackclub.com/api/v1/events/{event_id}/slack_blasts",
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([
'message' => 'Doors open at 9am!'
]),
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://attend.hackclub.com/api/v1/events/{event_id}/slack_blasts"
payload := strings.NewReader("{\n \"message\": \"Doors open at 9am!\"\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://attend.hackclub.com/api/v1/events/{event_id}/slack_blasts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"Doors open at 9am!\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://attend.hackclub.com/api/v1/events/{event_id}/slack_blasts")
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 \"message\": \"Doors open at 9am!\"\n}"
response = http.request(request)
puts response.read_body{
"slack_blast": {
"id": 12,
"message": "<string>",
"status": "pending",
"recipient_count": 123,
"sent_count": 123,
"failed_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"sent_by": "<string>"
}
}{
"error": "Unauthorized"
}{
"error": "Unauthorized"
}{
"error": "Unauthorized"
}{
"error": "Unauthorized"
}Authorizations
Mobile token, global API token, series API key, or event API key. See Authentication above for which endpoints each one reaches.
Path Parameters
Event id.
Body
application/json
Example:
"Doors open at 9am!"
Response
Blast created and enqueued.
Show child attributes
Show child attributes
Was this page helpful?