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
}
'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));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))
}Webhooks
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
}
'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));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))
}Path 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.
Related topics
Atualizar customer pelo idDeletar webhook pelo idWebhooks v1.1Pagamentos com Pix na MalgaWas this page helpful?
⌘I