Create a version of a refresh schedule
curl --request POST \
--url https://app.chatobserver.com/api/v2/metrics/client/schedules/{scheduleId}/versions \
--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 '
{
"definition": {
"schemaVersion": 2,
"timeZone": "<string>",
"recurrence": {
"kind": "cron",
"expression": "<string>"
},
"startsAt": "2023-11-07T05:31:56Z",
"endsAt": "2023-11-07T05:31:56Z",
"freshnessDelayMinutes": 5040,
"failurePolicy": {
"maximumAttempts": 5,
"initialDelaySeconds": 43200,
"autoPauseAfterFailures": 50
},
"targets": [
{
"id": "<string>",
"queryVersionId": "<string>",
"position": 123,
"action": "refresh_query",
"retainResult": false
}
],
"notifications": {
"onSuccess": false,
"onFailure": false,
"onAutoPause": false,
"targets": [
{
"kind": "email",
"address": "<string>"
}
]
}
}
}
'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({
definition: {
schemaVersion: 2,
timeZone: '<string>',
recurrence: {kind: 'cron', expression: '<string>'},
startsAt: '2023-11-07T05:31:56Z',
endsAt: '2023-11-07T05:31:56Z',
freshnessDelayMinutes: 5040,
failurePolicy: {maximumAttempts: 5, initialDelaySeconds: 43200, autoPauseAfterFailures: 50},
targets: [
{
id: '<string>',
queryVersionId: '<string>',
position: 123,
action: 'refresh_query',
retainResult: false
}
],
notifications: {
onSuccess: false,
onFailure: false,
onAutoPause: false,
targets: [{kind: 'email', address: '<string>'}]
}
}
})
};
fetch('https://app.chatobserver.com/api/v2/metrics/client/schedules/{scheduleId}/versions', 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/schedules/{scheduleId}/versions"
payload = { "definition": {
"schemaVersion": 2,
"timeZone": "<string>",
"recurrence": {
"kind": "cron",
"expression": "<string>"
},
"startsAt": "2023-11-07T05:31:56Z",
"endsAt": "2023-11-07T05:31:56Z",
"freshnessDelayMinutes": 5040,
"failurePolicy": {
"maximumAttempts": 5,
"initialDelaySeconds": 43200,
"autoPauseAfterFailures": 50
},
"targets": [
{
"id": "<string>",
"queryVersionId": "<string>",
"position": 123,
"action": "refresh_query",
"retainResult": False
}
],
"notifications": {
"onSuccess": False,
"onFailure": False,
"onAutoPause": False,
"targets": [
{
"kind": "email",
"address": "<string>"
}
]
}
} }
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>",
"scheduleId": "<string>",
"versionId": "<string>",
"versionNumber": 123,
"versionStatus": "draft"
},
"replayed": false
}{
"data": {
"actorId": "<string>",
"canonicalHash": "<string>",
"scheduleId": "<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 version of a refresh schedule
Access document-bound client sessions, queries, schedules, bindings and write claims.
POST
/
api
/
v2
/
metrics
/
client
/
schedules
/
{scheduleId}
/
versions
Create a version of a refresh schedule
curl --request POST \
--url https://app.chatobserver.com/api/v2/metrics/client/schedules/{scheduleId}/versions \
--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 '
{
"definition": {
"schemaVersion": 2,
"timeZone": "<string>",
"recurrence": {
"kind": "cron",
"expression": "<string>"
},
"startsAt": "2023-11-07T05:31:56Z",
"endsAt": "2023-11-07T05:31:56Z",
"freshnessDelayMinutes": 5040,
"failurePolicy": {
"maximumAttempts": 5,
"initialDelaySeconds": 43200,
"autoPauseAfterFailures": 50
},
"targets": [
{
"id": "<string>",
"queryVersionId": "<string>",
"position": 123,
"action": "refresh_query",
"retainResult": false
}
],
"notifications": {
"onSuccess": false,
"onFailure": false,
"onAutoPause": false,
"targets": [
{
"kind": "email",
"address": "<string>"
}
]
}
}
}
'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({
definition: {
schemaVersion: 2,
timeZone: '<string>',
recurrence: {kind: 'cron', expression: '<string>'},
startsAt: '2023-11-07T05:31:56Z',
endsAt: '2023-11-07T05:31:56Z',
freshnessDelayMinutes: 5040,
failurePolicy: {maximumAttempts: 5, initialDelaySeconds: 43200, autoPauseAfterFailures: 50},
targets: [
{
id: '<string>',
queryVersionId: '<string>',
position: 123,
action: 'refresh_query',
retainResult: false
}
],
notifications: {
onSuccess: false,
onFailure: false,
onAutoPause: false,
targets: [{kind: 'email', address: '<string>'}]
}
}
})
};
fetch('https://app.chatobserver.com/api/v2/metrics/client/schedules/{scheduleId}/versions', 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/schedules/{scheduleId}/versions"
payload = { "definition": {
"schemaVersion": 2,
"timeZone": "<string>",
"recurrence": {
"kind": "cron",
"expression": "<string>"
},
"startsAt": "2023-11-07T05:31:56Z",
"endsAt": "2023-11-07T05:31:56Z",
"freshnessDelayMinutes": 5040,
"failurePolicy": {
"maximumAttempts": 5,
"initialDelaySeconds": 43200,
"autoPauseAfterFailures": 50
},
"targets": [
{
"id": "<string>",
"queryVersionId": "<string>",
"position": 123,
"action": "refresh_query",
"retainResult": False
}
],
"notifications": {
"onSuccess": False,
"onFailure": False,
"onAutoPause": False,
"targets": [
{
"kind": "email",
"address": "<string>"
}
]
}
} }
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>",
"scheduleId": "<string>",
"versionId": "<string>",
"versionNumber": 123,
"versionStatus": "draft"
},
"replayed": false
}{
"data": {
"actorId": "<string>",
"canonicalHash": "<string>",
"scheduleId": "<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:_-]+$Path Parameters
Resource identifier returned by the API.
Body
application/json
Show child attributes
Show child attributes