cURL
curl --request POST \
--url https://api.eda.prisme.ai/v2/workspaces/{workspaceId}/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
{
"type": "error",
"payload": {
"message": "<string>",
"type": "<string>",
"details": "<unknown>"
}
}
]
}
'import requests
url = "https://api.eda.prisme.ai/v2/workspaces/{workspaceId}/events"
payload = { "events": [
{
"type": "error",
"payload": {
"message": "<string>",
"type": "<string>",
"details": "<unknown>"
}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: [
{
type: 'error',
payload: {message: '<string>', type: '<string>', details: '<unknown>'}
}
]
})
};
fetch('https://api.eda.prisme.ai/v2/workspaces/{workspaceId}/events', 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://api.eda.prisme.ai/v2/workspaces/{workspaceId}/events",
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([
'events' => [
[
'type' => 'error',
'payload' => [
'message' => '<string>',
'type' => '<string>',
'details' => '<unknown>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.eda.prisme.ai/v2/workspaces/{workspaceId}/events"
payload := strings.NewReader("{\n \"events\": [\n {\n \"type\": \"error\",\n \"payload\": {\n \"message\": \"<string>\",\n \"type\": \"<string>\",\n \"details\": \"<unknown>\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.eda.prisme.ai/v2/workspaces/{workspaceId}/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n {\n \"type\": \"error\",\n \"payload\": {\n \"message\": \"<string>\",\n \"type\": \"<string>\",\n \"details\": \"<unknown>\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eda.prisme.ai/v2/workspaces/{workspaceId}/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n {\n \"type\": \"error\",\n \"payload\": {\n \"message\": \"<string>\",\n \"type\": \"<string>\",\n \"details\": \"<unknown>\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"type": "apps.someApp.someCustomEvent",
"source": {
"appSlug": "<string>",
"appInstanceFullSlug": "<string>",
"appInstanceDepth": 123,
"automationSlug": "<string>",
"automationDepth": 123,
"userId": "<string>",
"ip": "<string>",
"sessionId": "<string>",
"workspaceId": "<string>",
"socketId": "<string>",
"host": {
"service": "<string>"
},
"correlationId": "<string>",
"serviceTopic": "<string>"
},
"createdAt": "<string>",
"id": "<string>",
"size": 123,
"payload": "<unknown>",
"target": {
"userTopic": "<string>",
"userId": "<string>",
"sessionId": "<string>",
"currentSocket": true
},
"options": {
"persist": true,
"aggPayload": false,
"async": false
},
"error": {
"error": "<string>",
"message": "<string>",
"details": "<unknown>",
"level": "warning"
}
}
]{
"error": "BadParameters",
"message": "<string>",
"details": "<unknown>"
}{
"error": "AuthenticationError",
"message": "Unauthenticated"
}{
"error": "ForbiddenError",
"message": "Forbidden"
}{
"error": "ObjectNotFound",
"message": "<string>"
}Prisme.ai Events
Post v2workspaces events
Emit a new event in this workspace
POST
/
v2
/
workspaces
/
{workspaceId}
/
events
cURL
curl --request POST \
--url https://api.eda.prisme.ai/v2/workspaces/{workspaceId}/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
{
"type": "error",
"payload": {
"message": "<string>",
"type": "<string>",
"details": "<unknown>"
}
}
]
}
'import requests
url = "https://api.eda.prisme.ai/v2/workspaces/{workspaceId}/events"
payload = { "events": [
{
"type": "error",
"payload": {
"message": "<string>",
"type": "<string>",
"details": "<unknown>"
}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: [
{
type: 'error',
payload: {message: '<string>', type: '<string>', details: '<unknown>'}
}
]
})
};
fetch('https://api.eda.prisme.ai/v2/workspaces/{workspaceId}/events', 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://api.eda.prisme.ai/v2/workspaces/{workspaceId}/events",
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([
'events' => [
[
'type' => 'error',
'payload' => [
'message' => '<string>',
'type' => '<string>',
'details' => '<unknown>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.eda.prisme.ai/v2/workspaces/{workspaceId}/events"
payload := strings.NewReader("{\n \"events\": [\n {\n \"type\": \"error\",\n \"payload\": {\n \"message\": \"<string>\",\n \"type\": \"<string>\",\n \"details\": \"<unknown>\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.eda.prisme.ai/v2/workspaces/{workspaceId}/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n {\n \"type\": \"error\",\n \"payload\": {\n \"message\": \"<string>\",\n \"type\": \"<string>\",\n \"details\": \"<unknown>\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eda.prisme.ai/v2/workspaces/{workspaceId}/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n {\n \"type\": \"error\",\n \"payload\": {\n \"message\": \"<string>\",\n \"type\": \"<string>\",\n \"details\": \"<unknown>\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"type": "apps.someApp.someCustomEvent",
"source": {
"appSlug": "<string>",
"appInstanceFullSlug": "<string>",
"appInstanceDepth": 123,
"automationSlug": "<string>",
"automationDepth": 123,
"userId": "<string>",
"ip": "<string>",
"sessionId": "<string>",
"workspaceId": "<string>",
"socketId": "<string>",
"host": {
"service": "<string>"
},
"correlationId": "<string>",
"serviceTopic": "<string>"
},
"createdAt": "<string>",
"id": "<string>",
"size": 123,
"payload": "<unknown>",
"target": {
"userTopic": "<string>",
"userId": "<string>",
"sessionId": "<string>",
"currentSocket": true
},
"options": {
"persist": true,
"aggPayload": false,
"async": false
},
"error": {
"error": "<string>",
"message": "<string>",
"details": "<unknown>",
"level": "warning"
}
}
]{
"error": "BadParameters",
"message": "<string>",
"details": "<unknown>"
}{
"error": "AuthenticationError",
"message": "Unauthenticated"
}{
"error": "ForbiddenError",
"message": "Forbidden"
}{
"error": "ObjectNotFound",
"message": "<string>"
}Authorizations
BearerAuthWorkspaceApiKeyAuthBearerAuth & WorkspaceApiKeyAuth
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID of workspace to listen to
Body
application/json
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
- Option 13
- Option 14
- Option 15
- Option 16
- Option 17
- Option 18
Show child attributes
Show child attributes
Response
Success Response
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
- Option 13
- Option 14
- Option 15
- Option 16
- Option 17
- Option 18
- Option 19
Was this page helpful?
⌘I