Set a Discord channel-to-project mapping
curl --request PUT \
--url https://api.sazabi.com/v1/integrations/connections/{connectionId}/discord-channel-project-mappings/{discordChannelId} \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "<string>"
}
'import requests
url = "https://api.sazabi.com/v1/integrations/connections/{connectionId}/discord-channel-project-mappings/{discordChannelId}"
payload = {
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({projectId: '3c90c3cc-0d44-4b50-8888-8dd25736052a', organizationId: '<string>'})
};
fetch('https://api.sazabi.com/v1/integrations/connections/{connectionId}/discord-channel-project-mappings/{discordChannelId}', 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://api.sazabi.com/v1/integrations/connections/{connectionId}/discord-channel-project-mappings/{discordChannelId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'projectId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'organizationId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.sazabi.com/v1/integrations/connections/{connectionId}/discord-channel-project-mappings/{discordChannelId}"
payload := strings.NewReader("{\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"organizationId\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.sazabi.com/v1/integrations/connections/{connectionId}/discord-channel-project-mappings/{discordChannelId}")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"organizationId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sazabi.com/v1/integrations/connections/{connectionId}/discord-channel-project-mappings/{discordChannelId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"organizationId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"discordGuildId": "<string>",
"discordChannelId": "<string>",
"discordChannelName": "<string>",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Integrations
Set a Discord channel-to-project mapping
Create or replace one Discord channel’s mapping. Idempotent on (connection, channel). New conversations in the channel and its threads then run in the project; existing conversations keep theirs.
PUT
https://api.sazabi.com/v1
/
integrations
/
connections
/
{connectionId}
/
discord-channel-project-mappings
/
{discordChannelId}
Set a Discord channel-to-project mapping
curl --request PUT \
--url https://api.sazabi.com/v1/integrations/connections/{connectionId}/discord-channel-project-mappings/{discordChannelId} \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "<string>"
}
'import requests
url = "https://api.sazabi.com/v1/integrations/connections/{connectionId}/discord-channel-project-mappings/{discordChannelId}"
payload = {
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({projectId: '3c90c3cc-0d44-4b50-8888-8dd25736052a', organizationId: '<string>'})
};
fetch('https://api.sazabi.com/v1/integrations/connections/{connectionId}/discord-channel-project-mappings/{discordChannelId}', 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://api.sazabi.com/v1/integrations/connections/{connectionId}/discord-channel-project-mappings/{discordChannelId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'projectId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'organizationId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.sazabi.com/v1/integrations/connections/{connectionId}/discord-channel-project-mappings/{discordChannelId}"
payload := strings.NewReader("{\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"organizationId\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.sazabi.com/v1/integrations/connections/{connectionId}/discord-channel-project-mappings/{discordChannelId}")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"organizationId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sazabi.com/v1/integrations/connections/{connectionId}/discord-channel-project-mappings/{discordChannelId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"organizationId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"discordGuildId": "<string>",
"discordChannelId": "<string>",
"discordChannelName": "<string>",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Path Parameters
Discord bot integration connection ID (the integration_connections.id).
Discord channel ID. Must be a text or announcement channel the Sazabi bot can see in the connection's server; a thread uses its channel's mapping.
Minimum string length:
1Body
application/json
Response
200 - application/json
OK
The Discord server (guild) the channel belongs to.
Discord channel ID (a snowflake, e.g. 1234567890123456789).
The channel's name, as Discord named it when the mapping was set.