Crea webhook
curl --request POST \
--url https://service.e-manager.io/api/v1/integrations/webhooks \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"label": "Produzione tracking",
"url": "https://example.com/webhooks/e-manager",
"events": [
"tracking.order_shipped",
"tracking.delivered"
]
}
'import requests
url = "https://service.e-manager.io/api/v1/integrations/webhooks"
payload = {
"label": "Produzione tracking",
"url": "https://example.com/webhooks/e-manager",
"events": ["tracking.order_shipped", "tracking.delivered"]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: 'Produzione tracking',
url: 'https://example.com/webhooks/e-manager',
events: ['tracking.order_shipped', 'tracking.delivered']
})
};
fetch('https://service.e-manager.io/api/v1/integrations/webhooks', 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://service.e-manager.io/api/v1/integrations/webhooks",
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([
'label' => 'Produzione tracking',
'url' => 'https://example.com/webhooks/e-manager',
'events' => [
'tracking.order_shipped',
'tracking.delivered'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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://service.e-manager.io/api/v1/integrations/webhooks"
payload := strings.NewReader("{\n \"label\": \"Produzione tracking\",\n \"url\": \"https://example.com/webhooks/e-manager\",\n \"events\": [\n \"tracking.order_shipped\",\n \"tracking.delivered\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://service.e-manager.io/api/v1/integrations/webhooks")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"Produzione tracking\",\n \"url\": \"https://example.com/webhooks/e-manager\",\n \"events\": [\n \"tracking.order_shipped\",\n \"tracking.delivered\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://service.e-manager.io/api/v1/integrations/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"Produzione tracking\",\n \"url\": \"https://example.com/webhooks/e-manager\",\n \"events\": [\n \"tracking.order_shipped\",\n \"tracking.delivered\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "Produzione tracking",
"url": "https://example.com/webhooks/e-manager",
"secretLast4": "a1b2",
"events": [
"tracking.order_shipped",
"tracking.delivered"
],
"isActive": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"disabledAt": "2023-11-07T05:31:56Z",
"lastDelivery": {
"status": "success",
"deliveredAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
},
"secret": "whsec_0123456789abcdef"
}Webhook
Crea webhook
Registra un nuovo endpoint webhook HTTPS con etichetta ed eventi sottoscritti. Il secret (whsec_...) è restituito solo in questa risposta. Richiede scope webhooks:manage. Massimo 10 endpoint attivi per company.
POST
/
v1
/
integrations
/
webhooks
Crea webhook
curl --request POST \
--url https://service.e-manager.io/api/v1/integrations/webhooks \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"label": "Produzione tracking",
"url": "https://example.com/webhooks/e-manager",
"events": [
"tracking.order_shipped",
"tracking.delivered"
]
}
'import requests
url = "https://service.e-manager.io/api/v1/integrations/webhooks"
payload = {
"label": "Produzione tracking",
"url": "https://example.com/webhooks/e-manager",
"events": ["tracking.order_shipped", "tracking.delivered"]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: 'Produzione tracking',
url: 'https://example.com/webhooks/e-manager',
events: ['tracking.order_shipped', 'tracking.delivered']
})
};
fetch('https://service.e-manager.io/api/v1/integrations/webhooks', 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://service.e-manager.io/api/v1/integrations/webhooks",
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([
'label' => 'Produzione tracking',
'url' => 'https://example.com/webhooks/e-manager',
'events' => [
'tracking.order_shipped',
'tracking.delivered'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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://service.e-manager.io/api/v1/integrations/webhooks"
payload := strings.NewReader("{\n \"label\": \"Produzione tracking\",\n \"url\": \"https://example.com/webhooks/e-manager\",\n \"events\": [\n \"tracking.order_shipped\",\n \"tracking.delivered\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://service.e-manager.io/api/v1/integrations/webhooks")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"Produzione tracking\",\n \"url\": \"https://example.com/webhooks/e-manager\",\n \"events\": [\n \"tracking.order_shipped\",\n \"tracking.delivered\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://service.e-manager.io/api/v1/integrations/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"Produzione tracking\",\n \"url\": \"https://example.com/webhooks/e-manager\",\n \"events\": [\n \"tracking.order_shipped\",\n \"tracking.delivered\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "Produzione tracking",
"url": "https://example.com/webhooks/e-manager",
"secretLast4": "a1b2",
"events": [
"tracking.order_shipped",
"tracking.delivered"
],
"isActive": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"disabledAt": "2023-11-07T05:31:56Z",
"lastDelivery": {
"status": "success",
"deliveredAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
},
"secret": "whsec_0123456789abcdef"
}Authorizations
Body
application/json
Minimum string length:
1Example:
"Produzione tracking"
Example:
"https://example.com/webhooks/e-manager"
Available options:
tracking.order_shipped, tracking.in_transit, tracking.out_for_delivery, tracking.delay, tracking.pickup_point, tracking.delivery_failed, tracking.delivered, tracking.* Example:
[
"tracking.order_shipped",
"tracking.delivered"
]
Response
201 - application/json
Example:
"Produzione tracking"
Example:
"https://example.com/webhooks/e-manager"
Example:
"a1b2"
Example:
[
"tracking.order_shipped",
"tracking.delivered"
]
Example:
true
Show child attributes
Show child attributes
Example:
"whsec_0123456789abcdef"
Was this page helpful?

