Issue a link that ties a channel to one of my tenants
curl --request POST \
--url https://api.devic.ai/v1/channels/invites \
--header 'Content-Type: application/json' \
--data '
{
"tenantId": "<string>",
"subtenantId": "<string>",
"channelAppId": "<string>",
"accountId": "<string>",
"greeting": "<string>",
"expiresInHours": 360,
"maxBindings": 123,
"requireApproval": true,
"purpose": "<string>",
"runtimeMetadata": {},
"runtimeSecretMetadata": {}
}
'import requests
url = "https://api.devic.ai/v1/channels/invites"
payload = {
"tenantId": "<string>",
"subtenantId": "<string>",
"channelAppId": "<string>",
"accountId": "<string>",
"greeting": "<string>",
"expiresInHours": 360,
"maxBindings": 123,
"requireApproval": True,
"purpose": "<string>",
"runtimeMetadata": {},
"runtimeSecretMetadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
tenantId: '<string>',
subtenantId: '<string>',
channelAppId: '<string>',
accountId: '<string>',
greeting: '<string>',
expiresInHours: 360,
maxBindings: 123,
requireApproval: true,
purpose: '<string>',
runtimeMetadata: {},
runtimeSecretMetadata: {}
})
};
fetch('https://api.devic.ai/v1/channels/invites', 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.devic.ai/v1/channels/invites",
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([
'tenantId' => '<string>',
'subtenantId' => '<string>',
'channelAppId' => '<string>',
'accountId' => '<string>',
'greeting' => '<string>',
'expiresInHours' => 360,
'maxBindings' => 123,
'requireApproval' => true,
'purpose' => '<string>',
'runtimeMetadata' => [
],
'runtimeSecretMetadata' => [
]
]),
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.devic.ai/v1/channels/invites"
payload := strings.NewReader("{\n \"tenantId\": \"<string>\",\n \"subtenantId\": \"<string>\",\n \"channelAppId\": \"<string>\",\n \"accountId\": \"<string>\",\n \"greeting\": \"<string>\",\n \"expiresInHours\": 360,\n \"maxBindings\": 123,\n \"requireApproval\": true,\n \"purpose\": \"<string>\",\n \"runtimeMetadata\": {},\n \"runtimeSecretMetadata\": {}\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.devic.ai/v1/channels/invites")
.header("Content-Type", "application/json")
.body("{\n \"tenantId\": \"<string>\",\n \"subtenantId\": \"<string>\",\n \"channelAppId\": \"<string>\",\n \"accountId\": \"<string>\",\n \"greeting\": \"<string>\",\n \"expiresInHours\": 360,\n \"maxBindings\": 123,\n \"requireApproval\": true,\n \"purpose\": \"<string>\",\n \"runtimeMetadata\": {},\n \"runtimeSecretMetadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devic.ai/v1/channels/invites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"tenantId\": \"<string>\",\n \"subtenantId\": \"<string>\",\n \"channelAppId\": \"<string>\",\n \"accountId\": \"<string>\",\n \"greeting\": \"<string>\",\n \"expiresInHours\": 360,\n \"maxBindings\": 123,\n \"requireApproval\": true,\n \"purpose\": \"<string>\",\n \"runtimeMetadata\": {},\n \"runtimeSecretMetadata\": {}\n}"
response = http.request(request)
puts response.read_bodyChannels
Issue a link that ties a channel to one of my tenants
Slack comes back with a url to a page that installs the bot. WhatsApp comes back with a waUrl — a click-to-chat link that opens the number with a short joinCode already written in the box — and with that code on its own, for somebody who would rather type it. The person sends the message, and from that message on the conversation belongs to the tenant. Email sends the invitation from the chosen agent or assistant mailbox and returns its delivery status; once accepted, mail from that exact address is attributed to the tenant and subtenant. Links and codes are returned ONCE, here: only their hashes are stored, so a link that is lost is reissued, never recovered.
POST
/
v1
/
channels
/
invites
Issue a link that ties a channel to one of my tenants
curl --request POST \
--url https://api.devic.ai/v1/channels/invites \
--header 'Content-Type: application/json' \
--data '
{
"tenantId": "<string>",
"subtenantId": "<string>",
"channelAppId": "<string>",
"accountId": "<string>",
"greeting": "<string>",
"expiresInHours": 360,
"maxBindings": 123,
"requireApproval": true,
"purpose": "<string>",
"runtimeMetadata": {},
"runtimeSecretMetadata": {}
}
'import requests
url = "https://api.devic.ai/v1/channels/invites"
payload = {
"tenantId": "<string>",
"subtenantId": "<string>",
"channelAppId": "<string>",
"accountId": "<string>",
"greeting": "<string>",
"expiresInHours": 360,
"maxBindings": 123,
"requireApproval": True,
"purpose": "<string>",
"runtimeMetadata": {},
"runtimeSecretMetadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
tenantId: '<string>',
subtenantId: '<string>',
channelAppId: '<string>',
accountId: '<string>',
greeting: '<string>',
expiresInHours: 360,
maxBindings: 123,
requireApproval: true,
purpose: '<string>',
runtimeMetadata: {},
runtimeSecretMetadata: {}
})
};
fetch('https://api.devic.ai/v1/channels/invites', 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.devic.ai/v1/channels/invites",
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([
'tenantId' => '<string>',
'subtenantId' => '<string>',
'channelAppId' => '<string>',
'accountId' => '<string>',
'greeting' => '<string>',
'expiresInHours' => 360,
'maxBindings' => 123,
'requireApproval' => true,
'purpose' => '<string>',
'runtimeMetadata' => [
],
'runtimeSecretMetadata' => [
]
]),
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.devic.ai/v1/channels/invites"
payload := strings.NewReader("{\n \"tenantId\": \"<string>\",\n \"subtenantId\": \"<string>\",\n \"channelAppId\": \"<string>\",\n \"accountId\": \"<string>\",\n \"greeting\": \"<string>\",\n \"expiresInHours\": 360,\n \"maxBindings\": 123,\n \"requireApproval\": true,\n \"purpose\": \"<string>\",\n \"runtimeMetadata\": {},\n \"runtimeSecretMetadata\": {}\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.devic.ai/v1/channels/invites")
.header("Content-Type", "application/json")
.body("{\n \"tenantId\": \"<string>\",\n \"subtenantId\": \"<string>\",\n \"channelAppId\": \"<string>\",\n \"accountId\": \"<string>\",\n \"greeting\": \"<string>\",\n \"expiresInHours\": 360,\n \"maxBindings\": 123,\n \"requireApproval\": true,\n \"purpose\": \"<string>\",\n \"runtimeMetadata\": {},\n \"runtimeSecretMetadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devic.ai/v1/channels/invites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"tenantId\": \"<string>\",\n \"subtenantId\": \"<string>\",\n \"channelAppId\": \"<string>\",\n \"accountId\": \"<string>\",\n \"greeting\": \"<string>\",\n \"expiresInHours\": 360,\n \"maxBindings\": 123,\n \"requireApproval\": true,\n \"purpose\": \"<string>\",\n \"runtimeMetadata\": {},\n \"runtimeSecretMetadata\": {}\n}"
response = http.request(request)
puts response.read_bodyBody
application/json
Response
The link, said once