cURL
curl --request PUT \
--url 'https://api.minimo.it/public/v1/automation-rules' \
--header 'Authorization: Bearer YOUR_MINIMO_KEY' \
--header 'Content-Type: application/json' \
--data '{"rules": [{"key": "confirmation", "name": "Booking confirmation", "event": "booking.created", "template": "TRF4MS9"}, {"key": "reminder", "name": "Reminder 2 hours before", "event": "booking.created", "template": "RMD2HRS", "offset": "-PT2H", "dateField": "booking_at"}]}'const res = await fetch('https://api.minimo.it/public/v1/automation-rules', {
method: 'PUT',
headers: {
Authorization: 'Bearer YOUR_MINIMO_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({"rules": [{"key": "confirmation", "name": "Booking confirmation", "event": "booking.created", "template": "TRF4MS9"}, {"key": "reminder", "name": "Reminder 2 hours before", "event": "booking.created", "template": "RMD2HRS", "offset": "-PT2H", "dateField": "booking_at"}]}),
});
const { data } = await res.json();
console.log(data);import requests
res = requests.put(
'https://api.minimo.it/public/v1/automation-rules',
headers={'Authorization': 'Bearer YOUR_MINIMO_KEY'},
json={"rules": [{"key": "confirmation", "name": "Booking confirmation", "event": "booking.created", "template": "TRF4MS9"}, {"key": "reminder", "name": "Reminder 2 hours before", "event": "booking.created", "template": "RMD2HRS", "offset": "-PT2H", "dateField": "booking_at"}]},
)
print(res.status_code, res.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.minimo.it/public/v1/automation-rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'rules' => [
[
'key' => 'confirmation',
'name' => 'Booking confirmation',
'event' => 'booking.created',
'template' => 'TRF4MS9'
],
[
'key' => 'reminder',
'name' => 'Reminder 2 hours before',
'event' => 'booking.created',
'template' => 'RMD2HRS',
'offset' => '-PT2H',
'dateField' => 'booking_at'
]
]
]),
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.minimo.it/public/v1/automation-rules"
payload := strings.NewReader("{\n \"rules\": [\n {\n \"key\": \"confirmation\",\n \"name\": \"Booking confirmation\",\n \"event\": \"booking.created\",\n \"template\": \"TRF4MS9\"\n },\n {\n \"key\": \"reminder\",\n \"name\": \"Reminder 2 hours before\",\n \"event\": \"booking.created\",\n \"template\": \"RMD2HRS\",\n \"offset\": \"-PT2H\",\n \"dateField\": \"booking_at\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.minimo.it/public/v1/automation-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rules\": [\n {\n \"key\": \"confirmation\",\n \"name\": \"Booking confirmation\",\n \"event\": \"booking.created\",\n \"template\": \"TRF4MS9\"\n },\n {\n \"key\": \"reminder\",\n \"name\": \"Reminder 2 hours before\",\n \"event\": \"booking.created\",\n \"template\": \"RMD2HRS\",\n \"offset\": \"-PT2H\",\n \"dateField\": \"booking_at\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.minimo.it/public/v1/automation-rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"rules\": [\n {\n \"key\": \"confirmation\",\n \"name\": \"Booking confirmation\",\n \"event\": \"booking.created\",\n \"template\": \"TRF4MS9\"\n },\n {\n \"key\": \"reminder\",\n \"name\": \"Reminder 2 hours before\",\n \"event\": \"booking.created\",\n \"template\": \"RMD2HRS\",\n \"offset\": \"-PT2H\",\n \"dateField\": \"booking_at\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"key": "confirmation",
"name": "Booking confirmation",
"event": "booking.created",
"template": 1201,
"templateUid": "TRF4MS9",
"offset": null,
"dateField": null,
"timing": "Immediately",
"enabled": true,
"cancelOn": [
"booking.cancelled"
],
"rescheduleOn": [],
"source": "default"
},
{
"key": "reminder",
"name": "Reminder 2 hours before",
"event": "booking.created",
"template": 1202,
"templateUid": "RMD2HRS",
"offset": "-PT2H",
"dateField": "booking_at",
"timing": "2 hours before",
"enabled": true,
"cancelOn": [
"booking.cancelled"
],
"rescheduleOn": [
"booking.updated"
],
"source": "default"
}
]
}{
"status": "FAIL",
"message": "INVALID_PARAMETERS",
"userMessage": "Set the origins allowed to embed the widgets first."
}{
"status": "FAIL",
"message": "INVALID_PARAMETERS",
"userMessage": "Set the origins allowed to embed the widgets first."
}Rules
Save Default Rules
Create or update rules for every restaurant, by key
PUT
/
public
/
v1
/
automation-rules
cURL
curl --request PUT \
--url 'https://api.minimo.it/public/v1/automation-rules' \
--header 'Authorization: Bearer YOUR_MINIMO_KEY' \
--header 'Content-Type: application/json' \
--data '{"rules": [{"key": "confirmation", "name": "Booking confirmation", "event": "booking.created", "template": "TRF4MS9"}, {"key": "reminder", "name": "Reminder 2 hours before", "event": "booking.created", "template": "RMD2HRS", "offset": "-PT2H", "dateField": "booking_at"}]}'const res = await fetch('https://api.minimo.it/public/v1/automation-rules', {
method: 'PUT',
headers: {
Authorization: 'Bearer YOUR_MINIMO_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({"rules": [{"key": "confirmation", "name": "Booking confirmation", "event": "booking.created", "template": "TRF4MS9"}, {"key": "reminder", "name": "Reminder 2 hours before", "event": "booking.created", "template": "RMD2HRS", "offset": "-PT2H", "dateField": "booking_at"}]}),
});
const { data } = await res.json();
console.log(data);import requests
res = requests.put(
'https://api.minimo.it/public/v1/automation-rules',
headers={'Authorization': 'Bearer YOUR_MINIMO_KEY'},
json={"rules": [{"key": "confirmation", "name": "Booking confirmation", "event": "booking.created", "template": "TRF4MS9"}, {"key": "reminder", "name": "Reminder 2 hours before", "event": "booking.created", "template": "RMD2HRS", "offset": "-PT2H", "dateField": "booking_at"}]},
)
print(res.status_code, res.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.minimo.it/public/v1/automation-rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'rules' => [
[
'key' => 'confirmation',
'name' => 'Booking confirmation',
'event' => 'booking.created',
'template' => 'TRF4MS9'
],
[
'key' => 'reminder',
'name' => 'Reminder 2 hours before',
'event' => 'booking.created',
'template' => 'RMD2HRS',
'offset' => '-PT2H',
'dateField' => 'booking_at'
]
]
]),
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.minimo.it/public/v1/automation-rules"
payload := strings.NewReader("{\n \"rules\": [\n {\n \"key\": \"confirmation\",\n \"name\": \"Booking confirmation\",\n \"event\": \"booking.created\",\n \"template\": \"TRF4MS9\"\n },\n {\n \"key\": \"reminder\",\n \"name\": \"Reminder 2 hours before\",\n \"event\": \"booking.created\",\n \"template\": \"RMD2HRS\",\n \"offset\": \"-PT2H\",\n \"dateField\": \"booking_at\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.minimo.it/public/v1/automation-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rules\": [\n {\n \"key\": \"confirmation\",\n \"name\": \"Booking confirmation\",\n \"event\": \"booking.created\",\n \"template\": \"TRF4MS9\"\n },\n {\n \"key\": \"reminder\",\n \"name\": \"Reminder 2 hours before\",\n \"event\": \"booking.created\",\n \"template\": \"RMD2HRS\",\n \"offset\": \"-PT2H\",\n \"dateField\": \"booking_at\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.minimo.it/public/v1/automation-rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"rules\": [\n {\n \"key\": \"confirmation\",\n \"name\": \"Booking confirmation\",\n \"event\": \"booking.created\",\n \"template\": \"TRF4MS9\"\n },\n {\n \"key\": \"reminder\",\n \"name\": \"Reminder 2 hours before\",\n \"event\": \"booking.created\",\n \"template\": \"RMD2HRS\",\n \"offset\": \"-PT2H\",\n \"dateField\": \"booking_at\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"key": "confirmation",
"name": "Booking confirmation",
"event": "booking.created",
"template": 1201,
"templateUid": "TRF4MS9",
"offset": null,
"dateField": null,
"timing": "Immediately",
"enabled": true,
"cancelOn": [
"booking.cancelled"
],
"rescheduleOn": [],
"source": "default"
},
{
"key": "reminder",
"name": "Reminder 2 hours before",
"event": "booking.created",
"template": 1202,
"templateUid": "RMD2HRS",
"offset": "-PT2H",
"dateField": "booking_at",
"timing": "2 hours before",
"enabled": true,
"cancelOn": [
"booking.cancelled"
],
"rescheduleOn": [
"booking.updated"
],
"source": "default"
}
]
}{
"status": "FAIL",
"message": "INVALID_PARAMETERS",
"userMessage": "Set the origins allowed to embed the widgets first."
}{
"status": "FAIL",
"message": "INVALID_PARAMETERS",
"userMessage": "Set the origins allowed to embed the widgets first."
}Guide: Rules. Errors: Errors and limits.