Atualizar webhook pelo id
curl --request PATCH \
--url https://api.malga.io/v1/webhooks/{id} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>' \
--data '
{
"event": "<string>",
"endpoint": "<string>",
"version": 1.1,
"status": true
}
'import requests
url = "https://api.malga.io/v1/webhooks/{id}"
payload = {
"event": "<string>",
"endpoint": "<string>",
"version": 1.1,
"status": True
}
headers = {
"X-Client-Id": "<api-key>",
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-Client-Id': '<api-key>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({event: '<string>', endpoint: '<string>', version: 1.1, status: true})
};
fetch('https://api.malga.io/v1/webhooks/{id}', 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.malga.io/v1/webhooks/{id}",
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([
'event' => '<string>',
'endpoint' => '<string>',
'version' => 1.1,
'status' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>",
"X-Client-Id: <api-key>"
],
]);
$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.malga.io/v1/webhooks/{id}"
payload := strings.NewReader("{\n \"event\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"version\": 1.1,\n \"status\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Api-Key", "<api-key>")
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.malga.io/v1/webhooks/{id}")
.header("X-Client-Id", "<api-key>")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"event\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"version\": 1.1,\n \"status\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.malga.io/v1/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Client-Id"] = '<api-key>'
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"event\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"version\": 1.1,\n \"status\": true\n}"
response = http.request(request)
puts response.read_bodyWebhooks
Atualizar webhook pelo id
PATCH
/
v1
/
webhooks
/
{id}
Atualizar webhook pelo id
curl --request PATCH \
--url https://api.malga.io/v1/webhooks/{id} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>' \
--data '
{
"event": "<string>",
"endpoint": "<string>",
"version": 1.1,
"status": true
}
'import requests
url = "https://api.malga.io/v1/webhooks/{id}"
payload = {
"event": "<string>",
"endpoint": "<string>",
"version": 1.1,
"status": True
}
headers = {
"X-Client-Id": "<api-key>",
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-Client-Id': '<api-key>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({event: '<string>', endpoint: '<string>', version: 1.1, status: true})
};
fetch('https://api.malga.io/v1/webhooks/{id}', 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.malga.io/v1/webhooks/{id}",
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([
'event' => '<string>',
'endpoint' => '<string>',
'version' => 1.1,
'status' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>",
"X-Client-Id: <api-key>"
],
]);
$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.malga.io/v1/webhooks/{id}"
payload := strings.NewReader("{\n \"event\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"version\": 1.1,\n \"status\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Api-Key", "<api-key>")
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.malga.io/v1/webhooks/{id}")
.header("X-Client-Id", "<api-key>")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"event\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"version\": 1.1,\n \"status\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.malga.io/v1/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Client-Id"] = '<api-key>'
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"event\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"version\": 1.1,\n \"status\": true\n}"
response = http.request(request)
puts response.read_bodyPath Parameters
Id do webhook que deseja alterar
Body
application/json
Evento que deseja receber notificações no seu webhook conforme descrito na seção Eventos suportados para notificação via webhooks. Deve ser criado um webhook para cada evento, podendo ser utilizado o wildcard * no lugar do evento para receber todos os eventos em um único webhook.
URL do seu sistema que deverá receber as notificações de evento, o valor não pode se repetir em outro webhook.
Versão da api da Malga que seu webhook implementa
Identifica se o webhooks está ativo ou não para receber notificações de evento da Malga
Available options:
true, false Response
200
The record has been successfully updated.
Was this page helpful?
⌘I