Cobrowse API v1.0.0
Cobrowse Api of the Fastify server in Nodejs.
You are viewing REST API documentation. This documentation is auto-generated from a swagger specification which itself is generated from annotations in the source code of the project. It is possible that this documentation includes bugs and that code samples are incomplete or wrong.
Authentication
- HTTP Authentication, scheme: bearer
cobrowse
Events, Resume, Terminate a session
Resume session after sender has refreshed page
POST http://localhost:4444/cobrowser/api/session/resume HTTP/1.1
Host: localhost:4444
Content-Type: application/json
Accept: application/json
Request body
{
"type": "ReconnectCobrowsingSession",
"sessionId": "string",
"timestamp": "string",
"userId": "string",
"userEndpointId": "string",
"version": 0,
"payload": {
"previousId": "string",
"previousEndpointId": "string"
}
}
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | none |
| » type | body | string | true | none |
| » sessionId | body | string | false | none |
| » timestamp | body | string | true | none |
| » userId | body | string | true | none |
| » userEndpointId | body | string | true | none |
| » version | body | integer | true | none |
| » payload | body | object | false | none |
| »» previousId | body | string | true | none |
| »» previousEndpointId | body | string | true | none |
Enumerated Values
| Parameter | Value |
|---|---|
| » type | ReconnectCobrowsingSession |
| » type | ResumeCobrowsingSession |
| » type | EnableCobrowsingOption |
| » type | DisableCobrowsingOption |
| » type | RequestCobrowsingView |
| » type | RequestCobrowsingControl |
| » type | TerminateCobrowsingSession |
| » type | AcceptCobrowsingView |
| » type | AcceptCobrowsingControl |
| » type | RevokeCobrowsingView |
| » type | RevokeCobrowsingControl |
| » type | DenyCobrowsingView |
| » type | DenyCobrowsingControl |
| » type | UpdateCobrowsingPage |
| » type | UpdateCobrowsingCursor |
| » type | UpdateCobrowsingInput |
| » type | CreateCobrowsingSession |
Responses
Overview
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Session resumed, sender updated | Inline |
| 404 | Not Found | Sesssion was not found | Inline |
Response Schema
Status Code 200
Session resumed, sender updated
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » status | string | true | none | none |
| » version | integer | true | none | none |
| » remotes | object | true | none | none |
| »» remoteEndpointIds | object | false | none | none |
| »»» remoteId | string | false | none | none |
| »»» permissions | object | true | none | none |
| »»»» view | boolean | false | none | none |
| »»»» control | boolean | false | none | none |
| » options | object | true | none | none |
| »» scroll | object | false | none | none |
| »»» enabled | boolean | false | none | none |
Status Code 404
Sesssion was not found
| Name | Type | Required | Restrictions | Description |
|---|
Examples
200 Response
{
"status": "string",
"version": 0,
"remotes": {
"remoteEndpointIds": {
"remoteId": "string",
"permissions": {
"view": true,
"control": true
}
}
},
"options": {
"scroll": {
"enabled": true
}
}
}
To perform this operation, you must be authenticated by means of one of the following methods: bearerAuth
Code samples
- Shell
- Go
- Node
- Java
- Python
- Ruby
curl -X POST http://localhost:4444/cobrowser/api/session/resume \
-H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {access-token}'
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
var body []byte
// body = ...
req, err := http.NewRequest("POST", "http://localhost:4444/cobrowser/api/session/resume", bytes.NewBuffer(body))
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
const fetch = require('node-fetch');
const input = '{
"type": "ReconnectCobrowsingSession",
"sessionId": "string",
"timestamp": "string",
"userId": "string",
"userEndpointId": "string",
"version": 0,
"payload": {
"previousId": "string",
"previousEndpointId": "string"
}
}';
const headers = {
'Content-Type': 'application/json', 'Accept': 'application/json', 'Authorization': 'Bearer {access-token}'
}
fetch('http://localhost:4444/cobrowser/api/session/resume', {
method: 'POST',
body: input,
headers
})
.then(r => r.json())
.then((body) => {
console.log(body)
})
// This sample needs improvement.
URL obj = new URL("http://localhost:4444/cobrowser/api/session/resume");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream())
);
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post(
'http://localhost:4444/cobrowser/api/session/resume',
params={},
headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'http://localhost:4444/cobrowser/api/session/resume',
params: {}, headers: headers
p JSON.parse(result)
Reconnect to a session
POST http://localhost:4444/cobrowser/api/session/reconnect HTTP/1.1
Host: localhost:4444
Content-Type: application/json
Accept: application/json
Request body
{
"type": "ReconnectCobrowsingSession",
"sessionId": "string",
"timestamp": "string",
"userId": "string",
"userEndpointId": "string",
"version": 0,
"payload": {
"previousId": "string",
"previousEndpointId": "string"
}
}
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | none |
| » type | body | string | true | none |
| » sessionId | body | string | false | none |
| » timestamp | body | string | true | none |
| » userId | body | string | true | none |
| » userEndpointId | body | string | true | none |
| » version | body | integer | true | none |
| » payload | body | object | false | none |
| »» previousId | body | string | true | none |
| »» previousEndpointId | body | string | true | none |
Enumerated Values
| Parameter | Value |
|---|---|
| » type | ReconnectCobrowsingSession |
| » type | ResumeCobrowsingSession |
| » type | EnableCobrowsingOption |
| » type | DisableCobrowsingOption |
| » type | RequestCobrowsingView |
| » type | RequestCobrowsingControl |
| » type | TerminateCobrowsingSession |
| » type | AcceptCobrowsingView |
| » type | AcceptCobrowsingControl |
| » type | RevokeCobrowsingView |
| » type | RevokeCobrowsingControl |
| » type | DenyCobrowsingView |
| » type | DenyCobrowsingControl |
| » type | UpdateCobrowsingPage |
| » type | UpdateCobrowsingCursor |
| » type | UpdateCobrowsingInput |
| » type | CreateCobrowsingSession |
Responses
Overview
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Reconnected to session | Inline |
| 403 | Forbidden | Permission denied | Inline |
| 404 | Not Found | Sesssion was not found | Inline |
Response Schema
Status Code 200
Reconnected to session
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » status | string | true | none | none |
| » version | integer | true | none | none |
| » owner | object | true | none | none |
| »» id | string | false | none | none |
| »» endpoint | string | false | none | none |
| » remotes | object | true | none | none |
| »» remoteEndpointIds | object | false | none | none |
| »»» remoteId | string | false | none | none |
| »»» permissions | object | true | none | none |
| »»»» view | boolean | false | none | none |
| »»»» control | boolean | false | none | none |
| » options | object | true | none | none |
| »» scroll | object | false | none | none |
| »»» enabled | boolean | false | none | none |
Status Code 403
Permission denied
| Name | Type | Required | Restrictions | Description |
|---|
Status Code 404
Sesssion was not found
| Name | Type | Required | Restrictions | Description |
|---|
Examples
200 Response
{
"status": "string",
"version": 0,
"owner": {
"id": "string",
"endpoint": "string"
},
"remotes": {
"remoteEndpointIds": {
"remoteId": "string",
"permissions": {
"view": true,
"control": true
}
}
},
"options": {
"scroll": {
"enabled": true
}
}
}
To perform this operation, you must be authenticated by means of one of the following methods: bearerAuth
Code samples
- Shell
- Go
- Node
- Java
- Python
- Ruby
curl -X POST http://localhost:4444/cobrowser/api/session/reconnect \
-H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {access-token}'
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
var body []byte
// body = ...
req, err := http.NewRequest("POST", "http://localhost:4444/cobrowser/api/session/reconnect", bytes.NewBuffer(body))
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
const fetch = require('node-fetch');
const input = '{
"type": "ReconnectCobrowsingSession",
"sessionId": "string",
"timestamp": "string",
"userId": "string",
"userEndpointId": "string",
"version": 0,
"payload": {
"previousId": "string",
"previousEndpointId": "string"
}
}';
const headers = {
'Content-Type': 'application/json', 'Accept': 'application/json', 'Authorization': 'Bearer {access-token}'
}
fetch('http://localhost:4444/cobrowser/api/session/reconnect', {
method: 'POST',
body: input,
headers
})
.then(r => r.json())
.then((body) => {
console.log(body)
})
// This sample needs improvement.
URL obj = new URL("http://localhost:4444/cobrowser/api/session/reconnect");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream())
);
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post(
'http://localhost:4444/cobrowser/api/session/reconnect',
params={},
headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'http://localhost:4444/cobrowser/api/session/reconnect',
params: {}, headers: headers
p JSON.parse(result)
Create a new session
POST http://localhost:4444/cobrowser/api/session HTTP/1.1
Host: localhost:4444
Content-Type: application/json
Accept: application/json
Request body
{
"type": "ReconnectCobrowsingSession",
"sessionId": "string",
"timestamp": "string",
"userId": "string",
"userEndpointId": "string",
"version": 0,
"payload": {
"isTargetLocal": true,
"targetId": "string",
"targetEndpointId": "string",
"compressionSupport": {
"zstd": {
"compress": true,
"decompress": true
}
},
"record": {
"conversationId": "string",
"instanceId": "string",
"recorderId": "string"
}
}
}
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | none |
| » type | body | string | true | none |
| » sessionId | body | string | false | none |
| » timestamp | body | string | true | none |
| » userId | body | string | true | none |
| » userEndpointId | body | string | true | none |
| » version | body | integer | true | none |
| » payload | body | object | false | none |
| »» isTargetLocal | body | boolean | false | none |
| »» targetId | body | string | false | none |
| »» targetEndpointId | body | string | false | none |
| »» compressionSupport | body | object | false | none |
| »»» zstd | body | object | false | none |
| »»»» compress | body | boolean | false | none |
| »»»» decompress | body | boolean | false | none |
| »» record | body | object¦null | false | none |
| »»» conversationId | body | string | false | none |
| »»» instanceId | body | string | false | none |
| »»» recorderId | body | string | false | none |
Enumerated Values
| Parameter | Value |
|---|---|
| » type | ReconnectCobrowsingSession |
| » type | ResumeCobrowsingSession |
| » type | EnableCobrowsingOption |
| » type | DisableCobrowsingOption |
| » type | RequestCobrowsingView |
| » type | RequestCobrowsingControl |
| » type | TerminateCobrowsingSession |
| » type | AcceptCobrowsingView |
| » type | AcceptCobrowsingControl |
| » type | RevokeCobrowsingView |
| » type | RevokeCobrowsingControl |
| » type | DenyCobrowsingView |
| » type | DenyCobrowsingControl |
| » type | UpdateCobrowsingPage |
| » type | UpdateCobrowsingCursor |
| » type | UpdateCobrowsingInput |
| » type | CreateCobrowsingSession |
Responses
Overview
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Created new session and share with target | Inline |
| 400 | Bad Request | Bad Request | Inline |
Response Schema
Status Code 200
Created new session and share with target
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » status | string | false | none | none |
| » version | integer | false | none | none |
| » data | object | false | none | none |
| »» sessionId | string | false | none | none |
Status Code 400
Bad Request
| Name | Type | Required | Restrictions | Description |
|---|
Examples
200 Response
{
"status": "string",
"version": 0,
"data": {
"sessionId": "string"
}
}
To perform this operation, you must be authenticated by means of one of the following methods: bearerAuth
Code samples
- Shell
- Go
- Node
- Java
- Python
- Ruby
curl -X POST http://localhost:4444/cobrowser/api/session \
-H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {access-token}'
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
var body []byte
// body = ...
req, err := http.NewRequest("POST", "http://localhost:4444/cobrowser/api/session", bytes.NewBuffer(body))
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
const fetch = require('node-fetch');
const input = '{
"type": "ReconnectCobrowsingSession",
"sessionId": "string",
"timestamp": "string",
"userId": "string",
"userEndpointId": "string",
"version": 0,
"payload": {
"isTargetLocal": true,
"targetId": "string",
"targetEndpointId": "string",
"compressionSupport": {
"zstd": {
"compress": true,
"decompress": true
}
},
"record": {
"conversationId": "string",
"instanceId": "string",
"recorderId": "string"
}
}
}';
const headers = {
'Content-Type': 'application/json', 'Accept': 'application/json', 'Authorization': 'Bearer {access-token}'
}
fetch('http://localhost:4444/cobrowser/api/session', {
method: 'POST',
body: input,
headers
})
.then(r => r.json())
.then((body) => {
console.log(body)
})
// This sample needs improvement.
URL obj = new URL("http://localhost:4444/cobrowser/api/session");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream())
);
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post(
'http://localhost:4444/cobrowser/api/session',
params={},
headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'http://localhost:4444/cobrowser/api/session',
params: {}, headers: headers
p JSON.parse(result)
Get session info
GET http://localhost:4444/cobrowser/api/session/{id} HTTP/1.1
Host: localhost:4444
Accept: application/json
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | string | true | none |
Responses
Overview
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Session info | Inline |
| 403 | Forbidden | Permission denied | Inline |
| 404 | Not Found | Session not found | Inline |
Response Schema
Status Code 200
Session info
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » status | string | false | none | none |
| » payload | object | false | none | none |
Status Code 403
Permission denied
| Name | Type | Required | Restrictions | Description |
|---|
Status Code 404
Session not found
| Name | Type | Required | Restrictions | Description |
|---|
Examples
200 Response
{
"status": "string",
"payload": {}
}
To perform this operation, you must be authenticated by means of one of the following methods: bearerAuth
Code samples
- Shell
- Go
- Node
- Java
- Python
- Ruby
curl -X GET http://localhost:4444/cobrowser/api/session/{id} \
-H 'Accept: application/json' \ -H 'Authorization: Bearer {access-token}'
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
var body []byte
// body = ...
req, err := http.NewRequest("GET", "http://localhost:4444/cobrowser/api/session/{id}", bytes.NewBuffer(body))
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
const fetch = require('node-fetch');
const headers = {
'Accept': 'application/json', 'Authorization': 'Bearer {access-token}'
}
fetch('http://localhost:4444/cobrowser/api/session/{id}', {
method: 'GET',
headers
})
.then(r => r.json())
.then((body) => {
console.log(body)
})
// This sample needs improvement.
URL obj = new URL("http://localhost:4444/cobrowser/api/session/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream())
);
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get(
'http://localhost:4444/cobrowser/api/session/{id}',
params={},
headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'http://localhost:4444/cobrowser/api/session/{id}',
params: {}, headers: headers
p JSON.parse(result)
Post dom event as document's owner
POST http://localhost:4444/cobrowser/api/session/owner/update HTTP/1.1
Host: localhost:4444
Accept: application/json
Responses
Overview
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Event posted | Inline |
| 403 | Forbidden | Permission denied | Inline |
| 404 | Not Found | Session not found | Inline |
Response Schema
Status Code 200
Event posted
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » status | string | false | none | none |
| » version | integer | false | none | none |
Status Code 403
Permission denied
| Name | Type | Required | Restrictions | Description |
|---|
Status Code 404
Session not found
| Name | Type | Required | Restrictions | Description |
|---|
Examples
200 Response
{
"status": "string",
"version": 0
}
To perform this operation, you must be authenticated by means of one of the following methods: bearerAuth
Code samples
- Shell
- Go
- Node
- Java
- Python
- Ruby
curl -X POST http://localhost:4444/cobrowser/api/session/owner/update \
-H 'Accept: application/json' \ -H 'Authorization: Bearer {access-token}'
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
var body []byte
// body = ...
req, err := http.NewRequest("POST", "http://localhost:4444/cobrowser/api/session/owner/update", bytes.NewBuffer(body))
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
const fetch = require('node-fetch');
const headers = {
'Accept': 'application/json', 'Authorization': 'Bearer {access-token}'
}
fetch('http://localhost:4444/cobrowser/api/session/owner/update', {
method: 'POST',
headers
})
.then(r => r.json())
.then((body) => {
console.log(body)
})
// This sample needs improvement.
URL obj = new URL("http://localhost:4444/cobrowser/api/session/owner/update");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream())
);
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post(
'http://localhost:4444/cobrowser/api/session/owner/update',
params={},
headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'http://localhost:4444/cobrowser/api/session/owner/update',
params: {}, headers: headers
p JSON.parse(result)
Post dom event as viewer
POST http://localhost:4444/cobrowser/api/session/remote/update HTTP/1.1
Host: localhost:4444
Content-Type: application/json
Accept: application/json
Request body
{
"type": "ReconnectCobrowsingSession",
"sessionId": "string",
"timestamp": "string",
"userId": "string",
"userEndpointId": "string",
"version": 0,
"payload": {
"type": "string",
"users": [
{
"userId": "string",
"userEndpointId": "string"
}
],
"count": 0,
"payload": {
"events": [
{
"type": "string",
"time": 0,
"payload": {},
"user": {
"userId": "string",
"userEndpointId": "string"
}
}
]
}
}
}
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | none |
| » type | body | string | true | none |
| » sessionId | body | string | false | none |
| » timestamp | body | string | true | none |
| » userId | body | string | true | none |
| » userEndpointId | body | string | true | none |
| » version | body | integer | true | none |
| » payload | body | object | false | none |
| »» type | body | string | true | none |
| »» users | body | [object] | false | none |
| »»» userId | body | string | false | none |
| »»» userEndpointId | body | string | false | none |
| »» count | body | integer | true | none |
| »» payload | body | object | true | none |
| »»» events | body | [object] | false | none |
| »»»» type | body | string | true | none |
| »»»» time | body | integer | false | none |
| »»»» payload | body | object | false | none |
| »»»» user | body | object | false | none |
| »»»»» userId | body | string | false | none |
| »»»»» userEndpointId | body | string | false | none |
Enumerated Values
| Parameter | Value |
|---|---|
| » type | ReconnectCobrowsingSession |
| » type | ResumeCobrowsingSession |
| » type | EnableCobrowsingOption |
| » type | DisableCobrowsingOption |
| » type | RequestCobrowsingView |
| » type | RequestCobrowsingControl |
| » type | TerminateCobrowsingSession |
| » type | AcceptCobrowsingView |
| » type | AcceptCobrowsingControl |
| » type | RevokeCobrowsingView |