Create NotificationRule
curl --request POST \
--url https://api.ravion.com/notification-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"audiences": [
{
"destination_id": "<string>",
"kind": "destination"
}
],
"conditions": [
{
"in": [
"<string>"
],
"kind": "scope"
}
],
"content": {
"mention": true
},
"delivery": {
"mode": "live"
},
"enabled": true,
"eventIds": [
"<string>"
],
"name": "<string>",
"ownerUserId": "<string>"
}
}
'import requests
url = "https://api.ravion.com/notification-rules"
payload = { "data": {
"audiences": [
{
"destination_id": "<string>",
"kind": "destination"
}
],
"conditions": [
{
"in": ["<string>"],
"kind": "scope"
}
],
"content": { "mention": True },
"delivery": { "mode": "live" },
"enabled": True,
"eventIds": ["<string>"],
"name": "<string>",
"ownerUserId": "<string>"
} }
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({
data: {
audiences: [{destination_id: '<string>', kind: 'destination'}],
conditions: [{in: ['<string>'], kind: 'scope'}],
content: {mention: true},
delivery: {mode: 'live'},
enabled: true,
eventIds: ['<string>'],
name: '<string>',
ownerUserId: '<string>'
}
})
};
fetch('https://api.ravion.com/notification-rules', 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.ravion.com/notification-rules",
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([
'data' => [
'audiences' => [
[
'destination_id' => '<string>',
'kind' => 'destination'
]
],
'conditions' => [
[
'in' => [
'<string>'
],
'kind' => 'scope'
]
],
'content' => [
'mention' => true
],
'delivery' => [
'mode' => 'live'
],
'enabled' => true,
'eventIds' => [
'<string>'
],
'name' => '<string>',
'ownerUserId' => '<string>'
]
]),
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.ravion.com/notification-rules"
payload := strings.NewReader("{\n \"data\": {\n \"audiences\": [\n {\n \"destination_id\": \"<string>\",\n \"kind\": \"destination\"\n }\n ],\n \"conditions\": [\n {\n \"in\": [\n \"<string>\"\n ],\n \"kind\": \"scope\"\n }\n ],\n \"content\": {\n \"mention\": true\n },\n \"delivery\": {\n \"mode\": \"live\"\n },\n \"enabled\": true,\n \"eventIds\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"ownerUserId\": \"<string>\"\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.ravion.com/notification-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"audiences\": [\n {\n \"destination_id\": \"<string>\",\n \"kind\": \"destination\"\n }\n ],\n \"conditions\": [\n {\n \"in\": [\n \"<string>\"\n ],\n \"kind\": \"scope\"\n }\n ],\n \"content\": {\n \"mention\": true\n },\n \"delivery\": {\n \"mode\": \"live\"\n },\n \"enabled\": true,\n \"eventIds\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"ownerUserId\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ravion.com/notification-rules")
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 \"data\": {\n \"audiences\": [\n {\n \"destination_id\": \"<string>\",\n \"kind\": \"destination\"\n }\n ],\n \"conditions\": [\n {\n \"in\": [\n \"<string>\"\n ],\n \"kind\": \"scope\"\n }\n ],\n \"content\": {\n \"mention\": true\n },\n \"delivery\": {\n \"mode\": \"live\"\n },\n \"enabled\": true,\n \"eventIds\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"ownerUserId\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"audiences": [
{
"destination_id": "<string>",
"kind": "destination"
}
],
"conditions": [
{
"field": "PROJECT",
"in": [
"<string>"
],
"kind": "scope"
}
],
"content": {
"mention": true,
"verbosity": "COMPACT"
},
"createdAt": "2023-11-07T05:31:56Z",
"delivery": {
"mode": "live"
},
"enabled": true,
"eventIds": [
"<string>"
],
"id": "<string>",
"name": "<string>",
"organizationId": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"ownerUserId": "<string>"
}
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}NotificationRules
Create NotificationRule
Create a notification rule. POST /notification-rules in the Ravion API reference.
POST
/
notification-rules
Create NotificationRule
curl --request POST \
--url https://api.ravion.com/notification-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"audiences": [
{
"destination_id": "<string>",
"kind": "destination"
}
],
"conditions": [
{
"in": [
"<string>"
],
"kind": "scope"
}
],
"content": {
"mention": true
},
"delivery": {
"mode": "live"
},
"enabled": true,
"eventIds": [
"<string>"
],
"name": "<string>",
"ownerUserId": "<string>"
}
}
'import requests
url = "https://api.ravion.com/notification-rules"
payload = { "data": {
"audiences": [
{
"destination_id": "<string>",
"kind": "destination"
}
],
"conditions": [
{
"in": ["<string>"],
"kind": "scope"
}
],
"content": { "mention": True },
"delivery": { "mode": "live" },
"enabled": True,
"eventIds": ["<string>"],
"name": "<string>",
"ownerUserId": "<string>"
} }
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({
data: {
audiences: [{destination_id: '<string>', kind: 'destination'}],
conditions: [{in: ['<string>'], kind: 'scope'}],
content: {mention: true},
delivery: {mode: 'live'},
enabled: true,
eventIds: ['<string>'],
name: '<string>',
ownerUserId: '<string>'
}
})
};
fetch('https://api.ravion.com/notification-rules', 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.ravion.com/notification-rules",
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([
'data' => [
'audiences' => [
[
'destination_id' => '<string>',
'kind' => 'destination'
]
],
'conditions' => [
[
'in' => [
'<string>'
],
'kind' => 'scope'
]
],
'content' => [
'mention' => true
],
'delivery' => [
'mode' => 'live'
],
'enabled' => true,
'eventIds' => [
'<string>'
],
'name' => '<string>',
'ownerUserId' => '<string>'
]
]),
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.ravion.com/notification-rules"
payload := strings.NewReader("{\n \"data\": {\n \"audiences\": [\n {\n \"destination_id\": \"<string>\",\n \"kind\": \"destination\"\n }\n ],\n \"conditions\": [\n {\n \"in\": [\n \"<string>\"\n ],\n \"kind\": \"scope\"\n }\n ],\n \"content\": {\n \"mention\": true\n },\n \"delivery\": {\n \"mode\": \"live\"\n },\n \"enabled\": true,\n \"eventIds\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"ownerUserId\": \"<string>\"\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.ravion.com/notification-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"audiences\": [\n {\n \"destination_id\": \"<string>\",\n \"kind\": \"destination\"\n }\n ],\n \"conditions\": [\n {\n \"in\": [\n \"<string>\"\n ],\n \"kind\": \"scope\"\n }\n ],\n \"content\": {\n \"mention\": true\n },\n \"delivery\": {\n \"mode\": \"live\"\n },\n \"enabled\": true,\n \"eventIds\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"ownerUserId\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ravion.com/notification-rules")
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 \"data\": {\n \"audiences\": [\n {\n \"destination_id\": \"<string>\",\n \"kind\": \"destination\"\n }\n ],\n \"conditions\": [\n {\n \"in\": [\n \"<string>\"\n ],\n \"kind\": \"scope\"\n }\n ],\n \"content\": {\n \"mention\": true\n },\n \"delivery\": {\n \"mode\": \"live\"\n },\n \"enabled\": true,\n \"eventIds\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"ownerUserId\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"audiences": [
{
"destination_id": "<string>",
"kind": "destination"
}
],
"conditions": [
{
"field": "PROJECT",
"in": [
"<string>"
],
"kind": "scope"
}
],
"content": {
"mention": true,
"verbosity": "COMPACT"
},
"createdAt": "2023-11-07T05:31:56Z",
"delivery": {
"mode": "live"
},
"enabled": true,
"eventIds": [
"<string>"
],
"id": "<string>",
"name": "<string>",
"organizationId": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"ownerUserId": "<string>"
}
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}Body
application/json
Request body for creating resources, excluding read-only properties
Filters a model to only include properties visible during Create lifecycle.
Show child attributes
Show child attributes
Response
The request has succeeded and a new resource has been created as a result.
Show child attributes
Show child attributes
Was this page helpful?