curl --request POST \
--url https://api.staging.glot.com/v1/invites/{invite_code}/join \
--header 'Content-Type: application/json' \
--data '
{
"languages": [
"en-GB"
]
}
'import requests
url = "https://api.staging.glot.com/v1/invites/{invite_code}/join"
payload = { "languages": ["en-GB"] }
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({languages: ['en-GB']})
};
fetch('https://api.staging.glot.com/v1/invites/{invite_code}/join', 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.staging.glot.com/v1/invites/{invite_code}/join",
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([
'languages' => [
'en-GB'
]
]),
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.staging.glot.com/v1/invites/{invite_code}/join"
payload := strings.NewReader("{\n \"languages\": [\n \"en-GB\"\n ]\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.staging.glot.com/v1/invites/{invite_code}/join")
.header("Content-Type", "application/json")
.body("{\n \"languages\": [\n \"en-GB\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.glot.com/v1/invites/{invite_code}/join")
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 \"languages\": [\n \"en-GB\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"room": "<string>",
"token": "<string>",
"url": "<string>",
"languages": [
"ar-EG"
],
"identity": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Join a room with an invite link
Redeem an invite link and get credentials to join the room. No account needed.
Connect a client to url with token. The token is short-lived and the guest is
disconnected when it expires; the translator joins the room by itself once two
languages are present.
This spends one of the link’s uses, so it is not repeatable — a guest who reloads and joins again consumes another.
Send languages from active_languages, as many as the preview’s
languages_required — one for a dual room, two for a mono one. Both refusals are
409 and neither spends a use, so a chooser rendered against a stale preview costs
the guest nothing but a retry: a language that would make a third in the room, and a
count that disagrees with the room’s mode. If the room has no mode yet, this count
settles it — one language makes it dual, two makes it mono — for its lifetime.
The guest’s identity is assigned here rather than requested. They are
unauthenticated, so accepting one would let them join as any name they liked — and be
attributed as that name in the host’s usage breakdown.
404 and 410 mean what they do on GET /v1/invites/{invite_code}.
curl --request POST \
--url https://api.staging.glot.com/v1/invites/{invite_code}/join \
--header 'Content-Type: application/json' \
--data '
{
"languages": [
"en-GB"
]
}
'import requests
url = "https://api.staging.glot.com/v1/invites/{invite_code}/join"
payload = { "languages": ["en-GB"] }
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({languages: ['en-GB']})
};
fetch('https://api.staging.glot.com/v1/invites/{invite_code}/join', 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.staging.glot.com/v1/invites/{invite_code}/join",
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([
'languages' => [
'en-GB'
]
]),
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.staging.glot.com/v1/invites/{invite_code}/join"
payload := strings.NewReader("{\n \"languages\": [\n \"en-GB\"\n ]\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.staging.glot.com/v1/invites/{invite_code}/join")
.header("Content-Type", "application/json")
.body("{\n \"languages\": [\n \"en-GB\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.glot.com/v1/invites/{invite_code}/join")
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 \"languages\": [\n \"en-GB\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"room": "<string>",
"token": "<string>",
"url": "<string>",
"languages": [
"ar-EG"
],
"identity": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Path Parameters
Body
The languages a guest is joining in.
The same shape as JoinTokenRequest.languages, and deliberately so: a guest's join is
a join token like any other, and the room's streaming mode decides how many languages
one carries — see languages_required on the preview.
The languages this guest speaks and wants to hear, each one of the active_languages from GET /v1/invites/{invite_code}.
Send exactly as many as that response's languages_required. One for a dual room — the guest is on their own device — and two for a mono room, where one device carries both speakers. A count that disagrees with the room's mode returns 409 and spends none of the link's uses.
When languages_required is null the room has no mode yet and this count settles it, exactly as the first room token would: one language makes the room dual, two makes it mono, and it is fixed from then on.
1 - 2 elementsar-EG, ca-ES, da-DK, de-DE, el-GR, en-GB, es-ES, fi-FI, fr-FR, he-IL, hi-IN, hu-HU, it-IT, ja-JP, ko-KR, nl-NL, no-NO, pl-PL, pt-PT, ro-RO, ru-RU, sv-SE, tr-TR, uk-UA, ur-PK, zh-CN ["en-GB"]
["en-GB", "zh-CN"]
Response
Successful Response
Credentials for a guest who redeemed an invite link.
The same shape every other participant gets, plus the identity they were assigned.
Connect to url with token; the token is short-lived and the guest is disconnected
when it expires.
Redeeming spends one of the link's uses, so this response is not repeatable — a guest who reloads and joins again consumes another.
ar-EG, ca-ES, da-DK, de-DE, el-GR, en-GB, es-ES, fi-FI, fr-FR, he-IL, hi-IN, hu-HU, it-IT, ja-JP, ko-KR, nl-NL, no-NO, pl-PL, pt-PT, ro-RO, ru-RU, sv-SE, tr-TR, uk-UA, ur-PK, zh-CN Who this guest appears as in the room, and how their connection is attributed in the room's usage breakdown. Assigned by the server, not chosen: a guest is unauthenticated, so letting them name themselves would let them join as anyone.