Create a new realtime trigger using XanoScript
Authentication: required
curl --request POST \
--url https://your-xano-instance.xano.io/api:meta/workspace/{workspace_id}/realtime/channel/trigger \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: text/x-xanoscript' \
--data 'realtime_trigger foo {
channel = "my_channel"
input {
enum action {
values = ["message", "join"]
}
text channel
object client {
schema {
json extras
object permissions {
schema {
int dbo_id
text row_id
}
}
}
}
object options {
schema {
bool authenticated
text channel
}
}
json payload
}
stack {
var $x1 {
value = 123
}
}
actions = {connection: true}
}
'{
"id": 1,
"created_at": "2023-04-19 21:01:32+0000",
"updated_at": "2023-04-19 21:01:32+0000",
"name": "Realtime Trigger",
"description": "My realtime trigger test description",
"guid": "YE1fwVhQ-enRlc6Sb42Gqru58-0",
"branch": "v1",
"tag": [
"example tag"
],
"actions": {
"message": true,
"join": true
},
"xanoscript": {
"status": "ok",
"value": "<string>",
"message": "<string>"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The body is of type string.
"realtime_trigger foo {\n channel = \"my_channel\"\n input {\n enum action {\n values = [\"message\", \"join\"]\n }\n text channel\n object client {\n schema {\n json extras\n object permissions {\n schema {\n int dbo_id\n text row_id\n }\n }\n }\n }\n object options {\n schema {\n bool authenticated\n text channel\n }\n }\n json payload\n }\n stack {\n var $x1 {\n value = 123\n }\n }\n actions = {connection: true}\n}\n"
Success!
Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://your-xano-instance.xano.io/api:meta/workspace/{workspace_id}/realtime/channel/trigger \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: text/x-xanoscript' \
--data 'realtime_trigger foo {
channel = "my_channel"
input {
enum action {
values = ["message", "join"]
}
text channel
object client {
schema {
json extras
object permissions {
schema {
int dbo_id
text row_id
}
}
}
}
object options {
schema {
bool authenticated
text channel
}
}
json payload
}
stack {
var $x1 {
value = 123
}
}
actions = {connection: true}
}
'{
"id": 1,
"created_at": "2023-04-19 21:01:32+0000",
"updated_at": "2023-04-19 21:01:32+0000",
"name": "Realtime Trigger",
"description": "My realtime trigger test description",
"guid": "YE1fwVhQ-enRlc6Sb42Gqru58-0",
"branch": "v1",
"tag": [
"example tag"
],
"actions": {
"message": true,
"join": true
},
"xanoscript": {
"status": "ok",
"value": "<string>",
"message": "<string>"
}
}