curl --request POST \
--url https://api.notifense.com/v1/accounts/{accountId}/assets/{assetId}/alertRules/{eventType} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"recipient": {
"culture": "<unknown>",
"timeZone": "<unknown>",
"phoneNumber": "<string>",
"description": "<string>"
},
"channel": {
"call": {},
"sms": {
"isInteractive": true
},
"telegram": {
"chatId": 123,
"isInteractive": true
},
"email": {
"emailAddress": "<string>",
"isInteractive": true
}
},
"isDisabled": true,
"daysOfWeek": [],
"timeOfDay": {
"from": "<string>",
"to": "<string>"
},
"dates": {
"from": "2023-12-25",
"to": "2023-12-25"
},
"insideGeofences": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"outsideGeofences": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
]
'import requests
url = "https://api.notifense.com/v1/accounts/{accountId}/assets/{assetId}/alertRules/{eventType}"
payload = [
{
"recipient": {
"culture": "<unknown>",
"timeZone": "<unknown>",
"phoneNumber": "<string>",
"description": "<string>"
},
"channel": {
"call": {},
"sms": { "isInteractive": True },
"telegram": {
"chatId": 123,
"isInteractive": True
},
"email": {
"emailAddress": "<string>",
"isInteractive": True
}
},
"isDisabled": True,
"daysOfWeek": [],
"timeOfDay": {
"from": "<string>",
"to": "<string>"
},
"dates": {
"from": "2023-12-25",
"to": "2023-12-25"
},
"insideGeofences": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"outsideGeofences": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
]
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([
{
recipient: {
culture: '<unknown>',
timeZone: '<unknown>',
phoneNumber: '<string>',
description: '<string>'
},
channel: {
call: {},
sms: {isInteractive: true},
telegram: {chatId: 123, isInteractive: true},
email: {emailAddress: '<string>', isInteractive: true}
},
isDisabled: true,
daysOfWeek: [],
timeOfDay: {from: '<string>', to: '<string>'},
dates: {from: '2023-12-25', to: '2023-12-25'},
insideGeofences: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
outsideGeofences: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
}
])
};
fetch('https://api.notifense.com/v1/accounts/{accountId}/assets/{assetId}/alertRules/{eventType}', 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.notifense.com/v1/accounts/{accountId}/assets/{assetId}/alertRules/{eventType}",
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([
[
'recipient' => [
'culture' => '<unknown>',
'timeZone' => '<unknown>',
'phoneNumber' => '<string>',
'description' => '<string>'
],
'channel' => [
'call' => [
],
'sms' => [
'isInteractive' => true
],
'telegram' => [
'chatId' => 123,
'isInteractive' => true
],
'email' => [
'emailAddress' => '<string>',
'isInteractive' => true
]
],
'isDisabled' => true,
'daysOfWeek' => [
],
'timeOfDay' => [
'from' => '<string>',
'to' => '<string>'
],
'dates' => [
'from' => '2023-12-25',
'to' => '2023-12-25'
],
'insideGeofences' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'outsideGeofences' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]
]),
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.notifense.com/v1/accounts/{accountId}/assets/{assetId}/alertRules/{eventType}"
payload := strings.NewReader("[\n {\n \"recipient\": {\n \"culture\": \"<unknown>\",\n \"timeZone\": \"<unknown>\",\n \"phoneNumber\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"channel\": {\n \"call\": {},\n \"sms\": {\n \"isInteractive\": true\n },\n \"telegram\": {\n \"chatId\": 123,\n \"isInteractive\": true\n },\n \"email\": {\n \"emailAddress\": \"<string>\",\n \"isInteractive\": true\n }\n },\n \"isDisabled\": true,\n \"daysOfWeek\": [],\n \"timeOfDay\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"dates\": {\n \"from\": \"2023-12-25\",\n \"to\": \"2023-12-25\"\n },\n \"insideGeofences\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"outsideGeofences\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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.notifense.com/v1/accounts/{accountId}/assets/{assetId}/alertRules/{eventType}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"recipient\": {\n \"culture\": \"<unknown>\",\n \"timeZone\": \"<unknown>\",\n \"phoneNumber\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"channel\": {\n \"call\": {},\n \"sms\": {\n \"isInteractive\": true\n },\n \"telegram\": {\n \"chatId\": 123,\n \"isInteractive\": true\n },\n \"email\": {\n \"emailAddress\": \"<string>\",\n \"isInteractive\": true\n }\n },\n \"isDisabled\": true,\n \"daysOfWeek\": [],\n \"timeOfDay\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"dates\": {\n \"from\": \"2023-12-25\",\n \"to\": \"2023-12-25\"\n },\n \"insideGeofences\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"outsideGeofences\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.notifense.com/v1/accounts/{accountId}/assets/{assetId}/alertRules/{eventType}")
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 {\n \"recipient\": {\n \"culture\": \"<unknown>\",\n \"timeZone\": \"<unknown>\",\n \"phoneNumber\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"channel\": {\n \"call\": {},\n \"sms\": {\n \"isInteractive\": true\n },\n \"telegram\": {\n \"chatId\": 123,\n \"isInteractive\": true\n },\n \"email\": {\n \"emailAddress\": \"<string>\",\n \"isInteractive\": true\n }\n },\n \"isDisabled\": true,\n \"daysOfWeek\": [],\n \"timeOfDay\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"dates\": {\n \"from\": \"2023-12-25\",\n \"to\": \"2023-12-25\"\n },\n \"insideGeofences\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"outsideGeofences\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n }\n]"
response = http.request(request)
puts response.read_body{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}Set alert rules
Sets all alert rules for a specific asset and event type.
curl --request POST \
--url https://api.notifense.com/v1/accounts/{accountId}/assets/{assetId}/alertRules/{eventType} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"recipient": {
"culture": "<unknown>",
"timeZone": "<unknown>",
"phoneNumber": "<string>",
"description": "<string>"
},
"channel": {
"call": {},
"sms": {
"isInteractive": true
},
"telegram": {
"chatId": 123,
"isInteractive": true
},
"email": {
"emailAddress": "<string>",
"isInteractive": true
}
},
"isDisabled": true,
"daysOfWeek": [],
"timeOfDay": {
"from": "<string>",
"to": "<string>"
},
"dates": {
"from": "2023-12-25",
"to": "2023-12-25"
},
"insideGeofences": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"outsideGeofences": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
]
'import requests
url = "https://api.notifense.com/v1/accounts/{accountId}/assets/{assetId}/alertRules/{eventType}"
payload = [
{
"recipient": {
"culture": "<unknown>",
"timeZone": "<unknown>",
"phoneNumber": "<string>",
"description": "<string>"
},
"channel": {
"call": {},
"sms": { "isInteractive": True },
"telegram": {
"chatId": 123,
"isInteractive": True
},
"email": {
"emailAddress": "<string>",
"isInteractive": True
}
},
"isDisabled": True,
"daysOfWeek": [],
"timeOfDay": {
"from": "<string>",
"to": "<string>"
},
"dates": {
"from": "2023-12-25",
"to": "2023-12-25"
},
"insideGeofences": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"outsideGeofences": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
]
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([
{
recipient: {
culture: '<unknown>',
timeZone: '<unknown>',
phoneNumber: '<string>',
description: '<string>'
},
channel: {
call: {},
sms: {isInteractive: true},
telegram: {chatId: 123, isInteractive: true},
email: {emailAddress: '<string>', isInteractive: true}
},
isDisabled: true,
daysOfWeek: [],
timeOfDay: {from: '<string>', to: '<string>'},
dates: {from: '2023-12-25', to: '2023-12-25'},
insideGeofences: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
outsideGeofences: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
}
])
};
fetch('https://api.notifense.com/v1/accounts/{accountId}/assets/{assetId}/alertRules/{eventType}', 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.notifense.com/v1/accounts/{accountId}/assets/{assetId}/alertRules/{eventType}",
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([
[
'recipient' => [
'culture' => '<unknown>',
'timeZone' => '<unknown>',
'phoneNumber' => '<string>',
'description' => '<string>'
],
'channel' => [
'call' => [
],
'sms' => [
'isInteractive' => true
],
'telegram' => [
'chatId' => 123,
'isInteractive' => true
],
'email' => [
'emailAddress' => '<string>',
'isInteractive' => true
]
],
'isDisabled' => true,
'daysOfWeek' => [
],
'timeOfDay' => [
'from' => '<string>',
'to' => '<string>'
],
'dates' => [
'from' => '2023-12-25',
'to' => '2023-12-25'
],
'insideGeofences' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'outsideGeofences' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]
]),
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.notifense.com/v1/accounts/{accountId}/assets/{assetId}/alertRules/{eventType}"
payload := strings.NewReader("[\n {\n \"recipient\": {\n \"culture\": \"<unknown>\",\n \"timeZone\": \"<unknown>\",\n \"phoneNumber\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"channel\": {\n \"call\": {},\n \"sms\": {\n \"isInteractive\": true\n },\n \"telegram\": {\n \"chatId\": 123,\n \"isInteractive\": true\n },\n \"email\": {\n \"emailAddress\": \"<string>\",\n \"isInteractive\": true\n }\n },\n \"isDisabled\": true,\n \"daysOfWeek\": [],\n \"timeOfDay\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"dates\": {\n \"from\": \"2023-12-25\",\n \"to\": \"2023-12-25\"\n },\n \"insideGeofences\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"outsideGeofences\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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.notifense.com/v1/accounts/{accountId}/assets/{assetId}/alertRules/{eventType}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"recipient\": {\n \"culture\": \"<unknown>\",\n \"timeZone\": \"<unknown>\",\n \"phoneNumber\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"channel\": {\n \"call\": {},\n \"sms\": {\n \"isInteractive\": true\n },\n \"telegram\": {\n \"chatId\": 123,\n \"isInteractive\": true\n },\n \"email\": {\n \"emailAddress\": \"<string>\",\n \"isInteractive\": true\n }\n },\n \"isDisabled\": true,\n \"daysOfWeek\": [],\n \"timeOfDay\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"dates\": {\n \"from\": \"2023-12-25\",\n \"to\": \"2023-12-25\"\n },\n \"insideGeofences\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"outsideGeofences\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.notifense.com/v1/accounts/{accountId}/assets/{assetId}/alertRules/{eventType}")
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 {\n \"recipient\": {\n \"culture\": \"<unknown>\",\n \"timeZone\": \"<unknown>\",\n \"phoneNumber\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"channel\": {\n \"call\": {},\n \"sms\": {\n \"isInteractive\": true\n },\n \"telegram\": {\n \"chatId\": 123,\n \"isInteractive\": true\n },\n \"email\": {\n \"emailAddress\": \"<string>\",\n \"isInteractive\": true\n }\n },\n \"isDisabled\": true,\n \"daysOfWeek\": [],\n \"timeOfDay\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"dates\": {\n \"from\": \"2023-12-25\",\n \"to\": \"2023-12-25\"\n },\n \"insideGeofences\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"outsideGeofences\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n }\n]"
response = http.request(request)
puts response.read_body{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 Body
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Indicates whether this alert rule is disabled, or null to disable this filter.
The days of the week on which this alert rule is active, or null to disable this filter.
0, 1, 2, 3, 4, 5, 6 The times of the day during which this alert rule is active, or null to disable this filter. Range may cross midnight (e.g. from 22:00 to 06:00).
Show child attributes
Show child attributes
The dates between which this alert rule is active, or null to disable this filter.
Show child attributes
Show child attributes
The geofences in any of which the asset must be for the alert rule to be active, or null to disable this filter.
The geofences outside all of which the asset must be for the alert rule to be active, or null to disable this filter.
Response
No Content