Start a browser call request (data plane)
curl --request POST \
--url https://api.goyappr.com/web-call/call-requests/{id}/start \
--header 'Content-Type: application/json' \
--header 'x-yappr-call-request-key: <x-yappr-call-request-key>' \
--data '
{
"sdp": "<string>",
"type": "offer",
"wait_for_ready_ms": 1
}
'import requests
url = "https://api.goyappr.com/web-call/call-requests/{id}/start"
payload = {
"sdp": "<string>",
"type": "offer",
"wait_for_ready_ms": 1
}
headers = {
"x-yappr-call-request-key": "<x-yappr-call-request-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-yappr-call-request-key': '<x-yappr-call-request-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({sdp: '<string>', type: 'offer', wait_for_ready_ms: 1})
};
fetch('https://api.goyappr.com/web-call/call-requests/{id}/start', 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.goyappr.com/web-call/call-requests/{id}/start",
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([
'sdp' => '<string>',
'type' => 'offer',
'wait_for_ready_ms' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-yappr-call-request-key: <x-yappr-call-request-key>"
],
]);
$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.goyappr.com/web-call/call-requests/{id}/start"
payload := strings.NewReader("{\n \"sdp\": \"<string>\",\n \"type\": \"offer\",\n \"wait_for_ready_ms\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-yappr-call-request-key", "<x-yappr-call-request-key>")
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.goyappr.com/web-call/call-requests/{id}/start")
.header("x-yappr-call-request-key", "<x-yappr-call-request-key>")
.header("Content-Type", "application/json")
.body("{\n \"sdp\": \"<string>\",\n \"type\": \"offer\",\n \"wait_for_ready_ms\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/web-call/call-requests/{id}/start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-yappr-call-request-key"] = '<x-yappr-call-request-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sdp\": \"<string>\",\n \"type\": \"offer\",\n \"wait_for_ready_ms\": 1\n}"
response = http.request(request)
puts response.read_body{
"sdp": "<string>",
"type": "answer",
"pc_id": "<string>",
"call_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ice_candidate_url": "<string>",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"replayed": true
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}Browser calls
Start Browser Call Request
Authorized by the request’s start_capability. The same start as POST /call-requests//start - a fresh SDP offer for a request that reports ready, answered 201 with the SDP answer, pc_id, ice_candidate_url and call_id - with the same refusals.
POST
/
web-call
/
call-requests
/
{id}
/
start
Start a browser call request (data plane)
curl --request POST \
--url https://api.goyappr.com/web-call/call-requests/{id}/start \
--header 'Content-Type: application/json' \
--header 'x-yappr-call-request-key: <x-yappr-call-request-key>' \
--data '
{
"sdp": "<string>",
"type": "offer",
"wait_for_ready_ms": 1
}
'import requests
url = "https://api.goyappr.com/web-call/call-requests/{id}/start"
payload = {
"sdp": "<string>",
"type": "offer",
"wait_for_ready_ms": 1
}
headers = {
"x-yappr-call-request-key": "<x-yappr-call-request-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-yappr-call-request-key': '<x-yappr-call-request-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({sdp: '<string>', type: 'offer', wait_for_ready_ms: 1})
};
fetch('https://api.goyappr.com/web-call/call-requests/{id}/start', 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.goyappr.com/web-call/call-requests/{id}/start",
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([
'sdp' => '<string>',
'type' => 'offer',
'wait_for_ready_ms' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-yappr-call-request-key: <x-yappr-call-request-key>"
],
]);
$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.goyappr.com/web-call/call-requests/{id}/start"
payload := strings.NewReader("{\n \"sdp\": \"<string>\",\n \"type\": \"offer\",\n \"wait_for_ready_ms\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-yappr-call-request-key", "<x-yappr-call-request-key>")
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.goyappr.com/web-call/call-requests/{id}/start")
.header("x-yappr-call-request-key", "<x-yappr-call-request-key>")
.header("Content-Type", "application/json")
.body("{\n \"sdp\": \"<string>\",\n \"type\": \"offer\",\n \"wait_for_ready_ms\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/web-call/call-requests/{id}/start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-yappr-call-request-key"] = '<x-yappr-call-request-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sdp\": \"<string>\",\n \"type\": \"offer\",\n \"wait_for_ready_ms\": 1\n}"
response = http.request(request)
puts response.read_body{
"sdp": "<string>",
"type": "answer",
"pc_id": "<string>",
"call_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ice_candidate_url": "<string>",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"replayed": true
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}The browser data plane: the
It is the same start as
start_url a browser call request answered with,
authorized by the request’s start_capability as x-yappr-call-request-key. Once the
poll reads ready, the browser sends a fresh SDP
offer here, takes a line and gets the answer it completes the connection with.
curl -X POST https://api.goyappr.com/web-call/call-requests/REQUEST_ID/start \
-H "x-yappr-call-request-key: START_CAPABILITY" \
-H "Content-Type: application/json" \
-d '{ "sdp": "v=0…", "type": "offer" }'
{
"sdp": "v=0…",
"type": "answer",
"pc_id": "…",
"ice_candidate_url": "https://voice.goyappr.com/api/web-call/offer",
"call_id": "7c4d…",
"request_id": "9f1c…",
"run_id": "4ab2…",
"replayed": false
}
POST /call-requests/{id}/start,
with the same rules: build the peer connection now, not before the steps ran, and a
start is one offer - the same offer again returns the same peer with replayed: true, and
a different one is 409 WORKFLOW_START_ALREADY_CLAIMED. call_id is the call record.
To skip the wait for ready, send the offer as soon as you have it with "wait_for_ready_ms": 15000
(at most 15000): the start waits up to that long for the steps to finish, then takes the line. If they have not
finished by then, or they failed, the answer is 409 WORKFLOW_START_NOT_READY and you poll the request
(it says why) and start again as usual.
| Status | Code | What to do |
|---|---|---|
400 | INVALID_START_WAIT | wait_for_ready_ms must be a whole number of milliseconds, 0 or more. |
401 | CALL_REQUEST_KEY_REQUIRED | Send the start_capability as x-yappr-call-request-key. |
403 | WORKFLOW_START_DENIED | The capability does not belong to that request. |
409 | WORKFLOW_START_NOT_READY | The steps have not finished. Poll until the request reads ready. |
409 | WORKFLOW_START_ALREADY_CLAIMED | Already started with a different offer. Create a new request. |
409 | WORKFLOW_REQUEST_CANCELLED | Cancelled. Create a new request. |
410 | WORKFLOW_START_EXPIRED | The request outlived expires_at. Create a new one. |
502 | WEB_START_REFUSED | The voice server refused the offer. The request is finished; create a new one. |
503 | AT_CAPACITY | Every line is busy and nothing was claimed. Poll and start again. |
503 | AUTH_UNAVAILABLE | A start aimed at the testing server could not check its sign-in just now. Nothing was claimed; retry. |
503 | WEB_START_UNAVAILABLE | The voice server never answered. The request is finished; create a new one. |
Body
application/json
Optional. Send the offer while the request is still preparing and let the start wait up to this many milliseconds (at most 15000) for it to read ready, instead of polling first. Absent or 0, a request that is not ready is refused at once with WORKFLOW_START_NOT_READY. A request whose steps failed is refused the same way once the wait runs out; poll it to read why.
Required range:
x >= 0