Create a spreadsheet binding
curl --request POST \
--url https://app.chatobserver.com/api/v2/metrics/client/bindings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-metrics-client-audience: <x-metrics-client-audience>' \
--header 'x-metrics-document-reference: <x-metrics-document-reference>' \
--data '
{
"name": "<string>",
"definition": {
"input": {
"kind": "query",
"queryVersionId": "<string>"
},
"schemaVersion": 3,
"ownership": {
"ownerUserId": "<string>",
"hostOwnerReference": "<string>"
},
"clientKind": "google_sheets",
"targetIdentity": {
"sheetName": "<string>",
"spreadsheetReferenceHash": "<string>",
"stableSheetId": 123
},
"placement": {
"anchorRow": 123,
"anchorColumn": 123,
"selectedRangeA1": "<string>",
"lastWrittenRangeA1": "<string>"
},
"writePolicy": {
"incrementalKeyFieldIds": [
"<string>"
],
"preserveOutputOnFailure": false,
"maximumRowsPerBatch": 123
},
"formatting": {
"timeZone": "<string>",
"locale": "<string>",
"preserveExisting": false,
"writeHeaders": false,
"applyNumberFormats": false,
"freezeHeaderRow": false
},
"parameterBindings": [
{
"value": "<string>",
"kind": "literal",
"parameterId": "<string>"
}
],
"unattendedAccess": false,
"credentialReferenceVersion": "<string>"
},
"description": null,
"visibility": "private",
"publish": false
}
'const options = {
method: 'POST',
headers: {
'x-metrics-client-audience': '<x-metrics-client-audience>',
'x-metrics-document-reference': '<x-metrics-document-reference>',
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
definition: {
input: {kind: 'query', queryVersionId: '<string>'},
schemaVersion: 3,
ownership: {ownerUserId: '<string>', hostOwnerReference: '<string>'},
clientKind: 'google_sheets',
targetIdentity: {
sheetName: '<string>',
spreadsheetReferenceHash: '<string>',
stableSheetId: 123
},
placement: {
anchorRow: 123,
anchorColumn: 123,
selectedRangeA1: '<string>',
lastWrittenRangeA1: '<string>'
},
writePolicy: {
incrementalKeyFieldIds: ['<string>'],
preserveOutputOnFailure: false,
maximumRowsPerBatch: 123
},
formatting: {
timeZone: '<string>',
locale: '<string>',
preserveExisting: false,
writeHeaders: false,
applyNumberFormats: false,
freezeHeaderRow: false
},
parameterBindings: [{value: '<string>', kind: 'literal', parameterId: '<string>'}],
unattendedAccess: false,
credentialReferenceVersion: '<string>'
},
description: null,
visibility: 'private',
publish: false
})
};
fetch('https://app.chatobserver.com/api/v2/metrics/client/bindings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.chatobserver.com/api/v2/metrics/client/bindings"
payload = {
"name": "<string>",
"definition": {
"input": {
"kind": "query",
"queryVersionId": "<string>"
},
"schemaVersion": 3,
"ownership": {
"ownerUserId": "<string>",
"hostOwnerReference": "<string>"
},
"clientKind": "google_sheets",
"targetIdentity": {
"sheetName": "<string>",
"spreadsheetReferenceHash": "<string>",
"stableSheetId": 123
},
"placement": {
"anchorRow": 123,
"anchorColumn": 123,
"selectedRangeA1": "<string>",
"lastWrittenRangeA1": "<string>"
},
"writePolicy": {
"incrementalKeyFieldIds": ["<string>"],
"preserveOutputOnFailure": False,
"maximumRowsPerBatch": 123
},
"formatting": {
"timeZone": "<string>",
"locale": "<string>",
"preserveExisting": False,
"writeHeaders": False,
"applyNumberFormats": False,
"freezeHeaderRow": False
},
"parameterBindings": [
{
"value": "<string>",
"kind": "literal",
"parameterId": "<string>"
}
],
"unattendedAccess": False,
"credentialReferenceVersion": "<string>"
},
"description": None,
"visibility": "private",
"publish": False
}
headers = {
"x-metrics-client-audience": "<x-metrics-client-audience>",
"x-metrics-document-reference": "<x-metrics-document-reference>",
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"actorId": "<string>",
"canonicalHash": "<string>",
"resourceId": "<string>",
"resourceType": "<string>",
"versionId": "<string>",
"versionNumber": 123,
"versionStatus": "draft"
},
"replayed": false
}{
"data": {
"actorId": "<string>",
"canonicalHash": "<string>",
"resourceId": "<string>",
"resourceType": "<string>",
"versionId": "<string>",
"versionNumber": 123,
"versionStatus": "draft"
},
"replayed": false
}{
"error": {
"code": "internal",
"fieldPath": [
"<string>"
],
"parameters": {},
"repairActions": [
"<string>"
],
"requestId": "<string>",
"retryable": false,
"retryAfterSeconds": 1
}
}Spreadsheet clients
Create a spreadsheet binding
Access document-bound client sessions, queries, schedules, bindings and write claims.
POST
/
api
/
v2
/
metrics
/
client
/
bindings
Create a spreadsheet binding
curl --request POST \
--url https://app.chatobserver.com/api/v2/metrics/client/bindings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-metrics-client-audience: <x-metrics-client-audience>' \
--header 'x-metrics-document-reference: <x-metrics-document-reference>' \
--data '
{
"name": "<string>",
"definition": {
"input": {
"kind": "query",
"queryVersionId": "<string>"
},
"schemaVersion": 3,
"ownership": {
"ownerUserId": "<string>",
"hostOwnerReference": "<string>"
},
"clientKind": "google_sheets",
"targetIdentity": {
"sheetName": "<string>",
"spreadsheetReferenceHash": "<string>",
"stableSheetId": 123
},
"placement": {
"anchorRow": 123,
"anchorColumn": 123,
"selectedRangeA1": "<string>",
"lastWrittenRangeA1": "<string>"
},
"writePolicy": {
"incrementalKeyFieldIds": [
"<string>"
],
"preserveOutputOnFailure": false,
"maximumRowsPerBatch": 123
},
"formatting": {
"timeZone": "<string>",
"locale": "<string>",
"preserveExisting": false,
"writeHeaders": false,
"applyNumberFormats": false,
"freezeHeaderRow": false
},
"parameterBindings": [
{
"value": "<string>",
"kind": "literal",
"parameterId": "<string>"
}
],
"unattendedAccess": false,
"credentialReferenceVersion": "<string>"
},
"description": null,
"visibility": "private",
"publish": false
}
'const options = {
method: 'POST',
headers: {
'x-metrics-client-audience': '<x-metrics-client-audience>',
'x-metrics-document-reference': '<x-metrics-document-reference>',
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
definition: {
input: {kind: 'query', queryVersionId: '<string>'},
schemaVersion: 3,
ownership: {ownerUserId: '<string>', hostOwnerReference: '<string>'},
clientKind: 'google_sheets',
targetIdentity: {
sheetName: '<string>',
spreadsheetReferenceHash: '<string>',
stableSheetId: 123
},
placement: {
anchorRow: 123,
anchorColumn: 123,
selectedRangeA1: '<string>',
lastWrittenRangeA1: '<string>'
},
writePolicy: {
incrementalKeyFieldIds: ['<string>'],
preserveOutputOnFailure: false,
maximumRowsPerBatch: 123
},
formatting: {
timeZone: '<string>',
locale: '<string>',
preserveExisting: false,
writeHeaders: false,
applyNumberFormats: false,
freezeHeaderRow: false
},
parameterBindings: [{value: '<string>', kind: 'literal', parameterId: '<string>'}],
unattendedAccess: false,
credentialReferenceVersion: '<string>'
},
description: null,
visibility: 'private',
publish: false
})
};
fetch('https://app.chatobserver.com/api/v2/metrics/client/bindings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.chatobserver.com/api/v2/metrics/client/bindings"
payload = {
"name": "<string>",
"definition": {
"input": {
"kind": "query",
"queryVersionId": "<string>"
},
"schemaVersion": 3,
"ownership": {
"ownerUserId": "<string>",
"hostOwnerReference": "<string>"
},
"clientKind": "google_sheets",
"targetIdentity": {
"sheetName": "<string>",
"spreadsheetReferenceHash": "<string>",
"stableSheetId": 123
},
"placement": {
"anchorRow": 123,
"anchorColumn": 123,
"selectedRangeA1": "<string>",
"lastWrittenRangeA1": "<string>"
},
"writePolicy": {
"incrementalKeyFieldIds": ["<string>"],
"preserveOutputOnFailure": False,
"maximumRowsPerBatch": 123
},
"formatting": {
"timeZone": "<string>",
"locale": "<string>",
"preserveExisting": False,
"writeHeaders": False,
"applyNumberFormats": False,
"freezeHeaderRow": False
},
"parameterBindings": [
{
"value": "<string>",
"kind": "literal",
"parameterId": "<string>"
}
],
"unattendedAccess": False,
"credentialReferenceVersion": "<string>"
},
"description": None,
"visibility": "private",
"publish": False
}
headers = {
"x-metrics-client-audience": "<x-metrics-client-audience>",
"x-metrics-document-reference": "<x-metrics-document-reference>",
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"actorId": "<string>",
"canonicalHash": "<string>",
"resourceId": "<string>",
"resourceType": "<string>",
"versionId": "<string>",
"versionNumber": 123,
"versionStatus": "draft"
},
"replayed": false
}{
"data": {
"actorId": "<string>",
"canonicalHash": "<string>",
"resourceId": "<string>",
"resourceType": "<string>",
"versionId": "<string>",
"versionNumber": 123,
"versionStatus": "draft"
},
"replayed": false
}{
"error": {
"code": "internal",
"fieldPath": [
"<string>"
],
"parameters": {},
"repairActions": [
"<string>"
],
"requestId": "<string>",
"retryable": false,
"retryAfterSeconds": 1
}
}Required scopes:
client:write.Authorizations
A client session token obtained through the client authorisation challenge flow.
Headers
The audience bound to the authorised client session.
Available options:
chatobserver-metrics-sheets, chatobserver-metrics-excel The document reference hash bound to the client session.
Pattern:
^[a-f0-9]{64}$Unique key for one logical command. Reuse it only when retrying the same request and payload.
Required string length:
16 - 160Pattern:
^[A-Za-z0-9:_-]+$Body
application/json
Required string length:
1 - 150- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
Show child attributes
Show child attributes
Maximum string length:
4000Available options:
private, workspace, restricted