Capture browser session for account
curl --request POST \
--url https://optareach.com/api/v1/platforms/{platform}/accounts/{accountId}/capture-session \
--header 'Content-Type: application/json' \
--data '
{
"browser_id": "browser-session-id",
"browser_session_version": "2"
}
'import requests
url = "https://optareach.com/api/v1/platforms/{platform}/accounts/{accountId}/capture-session"
payload = {
"browser_id": "browser-session-id",
"browser_session_version": "2"
}
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({browser_id: 'browser-session-id', browser_session_version: '2'})
};
fetch('https://optareach.com/api/v1/platforms/{platform}/accounts/{accountId}/capture-session', 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://optareach.com/api/v1/platforms/{platform}/accounts/{accountId}/capture-session",
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([
'browser_id' => 'browser-session-id',
'browser_session_version' => '2'
]),
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://optareach.com/api/v1/platforms/{platform}/accounts/{accountId}/capture-session"
payload := strings.NewReader("{\n \"browser_id\": \"browser-session-id\",\n \"browser_session_version\": \"2\"\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://optareach.com/api/v1/platforms/{platform}/accounts/{accountId}/capture-session")
.header("Content-Type", "application/json")
.body("{\n \"browser_id\": \"browser-session-id\",\n \"browser_session_version\": \"2\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://optareach.com/api/v1/platforms/{platform}/accounts/{accountId}/capture-session")
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 \"browser_id\": \"browser-session-id\",\n \"browser_session_version\": \"2\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c7de2c5-617c-4c1b-9c6f-b6e659b08d92",
"created": false
}
}{
"error": {
"code": "validation_error",
"message": "Payload failed validation.",
"details": {
"field": "body"
}
}
}{
"error": {
"code": "not_found",
"message": "Requested resource was not found."
}
}Accounts
Capture browser session for account
Captures a browser session for an existing account and queues validation. Use accountId new to create an account from the captured session. A browser session service must be configured.
POST
/
api
/
v1
/
platforms
/
{platform}
/
accounts
/
{accountId}
/
capture-session
Capture browser session for account
curl --request POST \
--url https://optareach.com/api/v1/platforms/{platform}/accounts/{accountId}/capture-session \
--header 'Content-Type: application/json' \
--data '
{
"browser_id": "browser-session-id",
"browser_session_version": "2"
}
'import requests
url = "https://optareach.com/api/v1/platforms/{platform}/accounts/{accountId}/capture-session"
payload = {
"browser_id": "browser-session-id",
"browser_session_version": "2"
}
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({browser_id: 'browser-session-id', browser_session_version: '2'})
};
fetch('https://optareach.com/api/v1/platforms/{platform}/accounts/{accountId}/capture-session', 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://optareach.com/api/v1/platforms/{platform}/accounts/{accountId}/capture-session",
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([
'browser_id' => 'browser-session-id',
'browser_session_version' => '2'
]),
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://optareach.com/api/v1/platforms/{platform}/accounts/{accountId}/capture-session"
payload := strings.NewReader("{\n \"browser_id\": \"browser-session-id\",\n \"browser_session_version\": \"2\"\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://optareach.com/api/v1/platforms/{platform}/accounts/{accountId}/capture-session")
.header("Content-Type", "application/json")
.body("{\n \"browser_id\": \"browser-session-id\",\n \"browser_session_version\": \"2\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://optareach.com/api/v1/platforms/{platform}/accounts/{accountId}/capture-session")
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 \"browser_id\": \"browser-session-id\",\n \"browser_session_version\": \"2\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c7de2c5-617c-4c1b-9c6f-b6e659b08d92",
"created": false
}
}{
"error": {
"code": "validation_error",
"message": "Payload failed validation.",
"details": {
"field": "body"
}
}
}{
"error": {
"code": "not_found",
"message": "Requested resource was not found."
}
}Body
application/json
The browser session to capture. browser_id is required; proxy_id, browser_session_version, and user_agent are optional.
Response
Browser session captured and account validation scheduled. created is true when accountId is new and a new account was created.
Show child attributes
Show child attributes