curl --request POST \
--url https://api.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inputs": [
{
"active": true,
"id": 12
}
]
}
'import requests
url = "https://api.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update"
payload = { "inputs": [
{
"active": True,
"id": 12
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({inputs: [{active: true, id: 12}]})
};
fetch('https://api.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update', 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.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update",
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([
'inputs' => [
[
'active' => true,
'id' => 12
]
]
]),
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.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update"
payload := strings.NewReader("{\n \"inputs\": [\n {\n \"active\": true,\n \"id\": 12\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": [\n {\n \"active\": true,\n \"id\": 12\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputs\": [\n {\n \"active\": true,\n \"id\": 12\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"completedAt": "2020-04-17T02:19:26.283Z",
"results": [
{
"active": true,
"createdAt": "2019-06-06T16:56:16.652Z",
"eventType": "contact.propertyChange",
"id": "1234",
"propertyName": "firstname",
"updatedAt": "2019-08-06T16:56:16.652Z"
},
{
"active": false,
"createdAt": "2019-06-06T16:56:16.652Z",
"eventType": "contact.create",
"id": "4567",
"updatedAt": "2019-08-06T16:56:16.652Z"
}
],
"startedAt": "2020-04-17T02:19:26.256Z",
"status": "COMPLETE"
}{
"completedAt": "2020-04-17T02:19:26.283Z",
"errors": [
{
"category": "SUBSCRIPTION_ID_NOT_FOUND",
"context": {
"subscriptionIds": [
"4567"
]
},
"message": "Failed to find subscriptions by id `4567`. Try again using a different subscriptionId.",
"status": "error",
"subCategory": "SubscriptionErrors.SUBSCRIPTION_IDS_NOT_FOUND"
}
],
"numErrors": 1,
"results": [
{
"active": true,
"createdAt": "2019-06-06T16:56:16.652Z",
"eventType": "contact.propertyChange",
"id": "1234",
"propertyName": "firstname",
"updatedAt": "2019-08-06T16:56:16.652Z"
}
],
"startedAt": "2020-04-17T02:19:26.256Z",
"status": "COMPLETE"
}{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}Batch create event subscriptions
Crie assinaturas de eventos em lote para o aplicativo especificado.
curl --request POST \
--url https://api.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inputs": [
{
"active": true,
"id": 12
}
]
}
'import requests
url = "https://api.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update"
payload = { "inputs": [
{
"active": True,
"id": 12
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({inputs: [{active: true, id: 12}]})
};
fetch('https://api.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update', 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.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update",
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([
'inputs' => [
[
'active' => true,
'id' => 12
]
]
]),
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.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update"
payload := strings.NewReader("{\n \"inputs\": [\n {\n \"active\": true,\n \"id\": 12\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": [\n {\n \"active\": true,\n \"id\": 12\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputs\": [\n {\n \"active\": true,\n \"id\": 12\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"completedAt": "2020-04-17T02:19:26.283Z",
"results": [
{
"active": true,
"createdAt": "2019-06-06T16:56:16.652Z",
"eventType": "contact.propertyChange",
"id": "1234",
"propertyName": "firstname",
"updatedAt": "2019-08-06T16:56:16.652Z"
},
{
"active": false,
"createdAt": "2019-06-06T16:56:16.652Z",
"eventType": "contact.create",
"id": "4567",
"updatedAt": "2019-08-06T16:56:16.652Z"
}
],
"startedAt": "2020-04-17T02:19:26.256Z",
"status": "COMPLETE"
}{
"completedAt": "2020-04-17T02:19:26.283Z",
"errors": [
{
"category": "SUBSCRIPTION_ID_NOT_FOUND",
"context": {
"subscriptionIds": [
"4567"
]
},
"message": "Failed to find subscriptions by id `4567`. Try again using a different subscriptionId.",
"status": "error",
"subCategory": "SubscriptionErrors.SUBSCRIPTION_IDS_NOT_FOUND"
}
],
"numErrors": 1,
"results": [
{
"active": true,
"createdAt": "2019-06-06T16:56:16.652Z",
"eventType": "contact.propertyChange",
"id": "1234",
"propertyName": "firstname",
"updatedAt": "2019-08-06T16:56:16.652Z"
}
],
"startedAt": "2020-04-17T02:19:26.256Z",
"status": "COMPLETE"
}{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}Supported products
Supported products
Autorizações
The access token received from the authorization server in the OAuth 2.0 flow.
Parâmetros de caminho
O ID do aplicativo de destino.
Corpo
Updated details for the specified subscriptions.
Uma matriz de objetos SubscriptionBatchUpdateRequest, cada um representando as configurações atualizadas para uma assinatura de webhook específica na operação em lote.
Show child attributes
Show child attributes
Resposta
successful operation
A data/hora em que a operação em lote foi concluída, no formato ISO 8601.
Uma matriz contendo as assinaturas de webhook processadas com sucesso a partir da operação em lote.
Show child attributes
Show child attributes
A data/hora em que a operação em lote começou a ser processada, no formato ISO 8601.
O status da operação em lote. Os valores aceitos são "PENDING", "PROCESSING", "CANCELED" ou "COMPLETE".
CANCELED, COMPLETE, PENDING, PROCESSING Um objeto que contém URLs para recursos ou operações relacionadas.
Show child attributes
Show child attributes
A data/hora em que a operação em lote foi solicitada, no formato ISO 8601.