Update a trigger
curl --request PATCH \
--url https://api.quiva.ai/trigger/triggers/{trigger_type}/{topic} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"subject": "<string>",
"trigger_type": "<string>",
"gateway_mapping": {
"error": "<string>",
"gateway": "<string>",
"is_public": true,
"method": "GET",
"path": "/api/resource",
"subject": "<string>",
"timeout": 30000,
"traffic_distribution": {
"1": 100
}
},
"source": {
"advertise": true,
"allow_trace": true,
"name": "<string>",
"subject": "<string>",
"description": "<string>",
"info_url": "<string>"
},
"target": {
"name": "<string>",
"subject": "<string>",
"account": "<string>",
"local_subject": "<string>",
"share": true,
"allow_trace": true
}
}
'import requests
url = "https://api.quiva.ai/trigger/triggers/{trigger_type}/{topic}"
payload = {
"name": "<string>",
"description": "<string>",
"subject": "<string>",
"trigger_type": "<string>",
"gateway_mapping": {
"error": "<string>",
"gateway": "<string>",
"is_public": True,
"method": "GET",
"path": "/api/resource",
"subject": "<string>",
"timeout": 30000,
"traffic_distribution": { "1": 100 }
},
"source": {
"advertise": True,
"allow_trace": True,
"name": "<string>",
"subject": "<string>",
"description": "<string>",
"info_url": "<string>"
},
"target": {
"name": "<string>",
"subject": "<string>",
"account": "<string>",
"local_subject": "<string>",
"share": True,
"allow_trace": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
subject: '<string>',
trigger_type: '<string>',
gateway_mapping: {
error: '<string>',
gateway: '<string>',
is_public: true,
method: 'GET',
path: '/api/resource',
subject: '<string>',
timeout: 30000,
traffic_distribution: {'1': 100}
},
source: {
advertise: true,
allow_trace: true,
name: '<string>',
subject: '<string>',
description: '<string>',
info_url: '<string>'
},
target: {
name: '<string>',
subject: '<string>',
account: '<string>',
local_subject: '<string>',
share: true,
allow_trace: true
}
})
};
fetch('https://api.quiva.ai/trigger/triggers/{trigger_type}/{topic}', 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.quiva.ai/trigger/triggers/{trigger_type}/{topic}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'subject' => '<string>',
'trigger_type' => '<string>',
'gateway_mapping' => [
'error' => '<string>',
'gateway' => '<string>',
'is_public' => true,
'method' => 'GET',
'path' => '/api/resource',
'subject' => '<string>',
'timeout' => 30000,
'traffic_distribution' => [
'1' => 100
]
],
'source' => [
'advertise' => true,
'allow_trace' => true,
'name' => '<string>',
'subject' => '<string>',
'description' => '<string>',
'info_url' => '<string>'
],
'target' => [
'name' => '<string>',
'subject' => '<string>',
'account' => '<string>',
'local_subject' => '<string>',
'share' => true,
'allow_trace' => true
]
]),
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.quiva.ai/trigger/triggers/{trigger_type}/{topic}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"subject\": \"<string>\",\n \"trigger_type\": \"<string>\",\n \"gateway_mapping\": {\n \"error\": \"<string>\",\n \"gateway\": \"<string>\",\n \"is_public\": true,\n \"method\": \"GET\",\n \"path\": \"/api/resource\",\n \"subject\": \"<string>\",\n \"timeout\": 30000,\n \"traffic_distribution\": {\n \"1\": 100\n }\n },\n \"source\": {\n \"advertise\": true,\n \"allow_trace\": true,\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"description\": \"<string>\",\n \"info_url\": \"<string>\"\n },\n \"target\": {\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"account\": \"<string>\",\n \"local_subject\": \"<string>\",\n \"share\": true,\n \"allow_trace\": true\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.quiva.ai/trigger/triggers/{trigger_type}/{topic}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"subject\": \"<string>\",\n \"trigger_type\": \"<string>\",\n \"gateway_mapping\": {\n \"error\": \"<string>\",\n \"gateway\": \"<string>\",\n \"is_public\": true,\n \"method\": \"GET\",\n \"path\": \"/api/resource\",\n \"subject\": \"<string>\",\n \"timeout\": 30000,\n \"traffic_distribution\": {\n \"1\": 100\n }\n },\n \"source\": {\n \"advertise\": true,\n \"allow_trace\": true,\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"description\": \"<string>\",\n \"info_url\": \"<string>\"\n },\n \"target\": {\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"account\": \"<string>\",\n \"local_subject\": \"<string>\",\n \"share\": true,\n \"allow_trace\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.quiva.ai/trigger/triggers/{trigger_type}/{topic}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"subject\": \"<string>\",\n \"trigger_type\": \"<string>\",\n \"gateway_mapping\": {\n \"error\": \"<string>\",\n \"gateway\": \"<string>\",\n \"is_public\": true,\n \"method\": \"GET\",\n \"path\": \"/api/resource\",\n \"subject\": \"<string>\",\n \"timeout\": 30000,\n \"traffic_distribution\": {\n \"1\": 100\n }\n },\n \"source\": {\n \"advertise\": true,\n \"allow_trace\": true,\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"description\": \"<string>\",\n \"info_url\": \"<string>\"\n },\n \"target\": {\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"account\": \"<string>\",\n \"local_subject\": \"<string>\",\n \"share\": true,\n \"allow_trace\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"body": {},
"metadata": {
"subject": "ms.trigger.gateway.my-gateway-trigger"
},
"status_code": 200
}{
"error": "Invalid request: Missing required field",
"status_code": 400
}{
"error": "Invalid request: Missing required field",
"status_code": 400
}{
"error": "Invalid request: Missing required field",
"status_code": 400
}Triggers
Update a trigger
Updates the fields given; the rest are kept. The trigger can also be named by subject in the body.
PATCH
/
trigger
/
triggers
/
{trigger_type}
/
{topic}
Update a trigger
curl --request PATCH \
--url https://api.quiva.ai/trigger/triggers/{trigger_type}/{topic} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"subject": "<string>",
"trigger_type": "<string>",
"gateway_mapping": {
"error": "<string>",
"gateway": "<string>",
"is_public": true,
"method": "GET",
"path": "/api/resource",
"subject": "<string>",
"timeout": 30000,
"traffic_distribution": {
"1": 100
}
},
"source": {
"advertise": true,
"allow_trace": true,
"name": "<string>",
"subject": "<string>",
"description": "<string>",
"info_url": "<string>"
},
"target": {
"name": "<string>",
"subject": "<string>",
"account": "<string>",
"local_subject": "<string>",
"share": true,
"allow_trace": true
}
}
'import requests
url = "https://api.quiva.ai/trigger/triggers/{trigger_type}/{topic}"
payload = {
"name": "<string>",
"description": "<string>",
"subject": "<string>",
"trigger_type": "<string>",
"gateway_mapping": {
"error": "<string>",
"gateway": "<string>",
"is_public": True,
"method": "GET",
"path": "/api/resource",
"subject": "<string>",
"timeout": 30000,
"traffic_distribution": { "1": 100 }
},
"source": {
"advertise": True,
"allow_trace": True,
"name": "<string>",
"subject": "<string>",
"description": "<string>",
"info_url": "<string>"
},
"target": {
"name": "<string>",
"subject": "<string>",
"account": "<string>",
"local_subject": "<string>",
"share": True,
"allow_trace": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
subject: '<string>',
trigger_type: '<string>',
gateway_mapping: {
error: '<string>',
gateway: '<string>',
is_public: true,
method: 'GET',
path: '/api/resource',
subject: '<string>',
timeout: 30000,
traffic_distribution: {'1': 100}
},
source: {
advertise: true,
allow_trace: true,
name: '<string>',
subject: '<string>',
description: '<string>',
info_url: '<string>'
},
target: {
name: '<string>',
subject: '<string>',
account: '<string>',
local_subject: '<string>',
share: true,
allow_trace: true
}
})
};
fetch('https://api.quiva.ai/trigger/triggers/{trigger_type}/{topic}', 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.quiva.ai/trigger/triggers/{trigger_type}/{topic}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'subject' => '<string>',
'trigger_type' => '<string>',
'gateway_mapping' => [
'error' => '<string>',
'gateway' => '<string>',
'is_public' => true,
'method' => 'GET',
'path' => '/api/resource',
'subject' => '<string>',
'timeout' => 30000,
'traffic_distribution' => [
'1' => 100
]
],
'source' => [
'advertise' => true,
'allow_trace' => true,
'name' => '<string>',
'subject' => '<string>',
'description' => '<string>',
'info_url' => '<string>'
],
'target' => [
'name' => '<string>',
'subject' => '<string>',
'account' => '<string>',
'local_subject' => '<string>',
'share' => true,
'allow_trace' => true
]
]),
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.quiva.ai/trigger/triggers/{trigger_type}/{topic}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"subject\": \"<string>\",\n \"trigger_type\": \"<string>\",\n \"gateway_mapping\": {\n \"error\": \"<string>\",\n \"gateway\": \"<string>\",\n \"is_public\": true,\n \"method\": \"GET\",\n \"path\": \"/api/resource\",\n \"subject\": \"<string>\",\n \"timeout\": 30000,\n \"traffic_distribution\": {\n \"1\": 100\n }\n },\n \"source\": {\n \"advertise\": true,\n \"allow_trace\": true,\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"description\": \"<string>\",\n \"info_url\": \"<string>\"\n },\n \"target\": {\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"account\": \"<string>\",\n \"local_subject\": \"<string>\",\n \"share\": true,\n \"allow_trace\": true\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.quiva.ai/trigger/triggers/{trigger_type}/{topic}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"subject\": \"<string>\",\n \"trigger_type\": \"<string>\",\n \"gateway_mapping\": {\n \"error\": \"<string>\",\n \"gateway\": \"<string>\",\n \"is_public\": true,\n \"method\": \"GET\",\n \"path\": \"/api/resource\",\n \"subject\": \"<string>\",\n \"timeout\": 30000,\n \"traffic_distribution\": {\n \"1\": 100\n }\n },\n \"source\": {\n \"advertise\": true,\n \"allow_trace\": true,\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"description\": \"<string>\",\n \"info_url\": \"<string>\"\n },\n \"target\": {\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"account\": \"<string>\",\n \"local_subject\": \"<string>\",\n \"share\": true,\n \"allow_trace\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.quiva.ai/trigger/triggers/{trigger_type}/{topic}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"subject\": \"<string>\",\n \"trigger_type\": \"<string>\",\n \"gateway_mapping\": {\n \"error\": \"<string>\",\n \"gateway\": \"<string>\",\n \"is_public\": true,\n \"method\": \"GET\",\n \"path\": \"/api/resource\",\n \"subject\": \"<string>\",\n \"timeout\": 30000,\n \"traffic_distribution\": {\n \"1\": 100\n }\n },\n \"source\": {\n \"advertise\": true,\n \"allow_trace\": true,\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"description\": \"<string>\",\n \"info_url\": \"<string>\"\n },\n \"target\": {\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"account\": \"<string>\",\n \"local_subject\": \"<string>\",\n \"share\": true,\n \"allow_trace\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"body": {},
"metadata": {
"subject": "ms.trigger.gateway.my-gateway-trigger"
},
"status_code": 200
}{
"error": "Invalid request: Missing required field",
"status_code": 400
}{
"error": "Invalid request: Missing required field",
"status_code": 400
}{
"error": "Invalid request: Missing required field",
"status_code": 400
}Authorizations
bearerAuthapiKeyAuth
Path Parameters
Body
application/json