Get campaign data for a given campaign
curl --request GET \
--url https://api.hubapi.com/email/public/v1/campaigns/{campaign_id}import requests
url = "https://api.hubapi.com/email/public/v1/campaigns/{campaign_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.hubapi.com/email/public/v1/campaigns/{campaign_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.hubapi.com/email/public/v1/campaigns/{campaign_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hubapi.com/email/public/v1/campaigns/{campaign_id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.hubapi.com/email/public/v1/campaigns/{campaign_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/email/public/v1/campaigns/{campaign_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"appId": 123,
"appName": "<string>",
"contentId": 123,
"counters": {
"delivered": 123,
"open": 123,
"processed": 123,
"sent": 123
},
"id": 123,
"name": "<string>",
"numIncluded": 123,
"numQueued": 123,
"subType": "<string>",
"subject": "<string>",
"type": "<string>"
}{
"category": "<string>",
"correlationId": "<string>",
"message": "<string>",
"subCategory": "<string>",
"errors": [
{
"message": "<string>",
"in": "<string>",
"code": "<string>",
"subCategory": "<string>",
"context": {}
}
],
"context": {},
"links": {}
}Campañas
Get campaign data for a given campaign
GET
/
email
/
public
/
v1
/
campaigns
/
{campaign_id}
Get campaign data for a given campaign
curl --request GET \
--url https://api.hubapi.com/email/public/v1/campaigns/{campaign_id}import requests
url = "https://api.hubapi.com/email/public/v1/campaigns/{campaign_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.hubapi.com/email/public/v1/campaigns/{campaign_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.hubapi.com/email/public/v1/campaigns/{campaign_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hubapi.com/email/public/v1/campaigns/{campaign_id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.hubapi.com/email/public/v1/campaigns/{campaign_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/email/public/v1/campaigns/{campaign_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"appId": 123,
"appName": "<string>",
"contentId": 123,
"counters": {
"delivered": 123,
"open": 123,
"processed": 123,
"sent": 123
},
"id": 123,
"name": "<string>",
"numIncluded": 123,
"numQueued": 123,
"subType": "<string>",
"subject": "<string>",
"type": "<string>"
}{
"category": "<string>",
"correlationId": "<string>",
"message": "<string>",
"subCategory": "<string>",
"errors": [
{
"message": "<string>",
"in": "<string>",
"code": "<string>",
"subCategory": "<string>",
"context": {}
}
],
"context": {},
"links": {}
}Scope requirements
Scope requirements
Parámetros de ruta
The Internal HubSpot ID of the email that you want to get the details for.
Respuesta
Campaign data retrieved successfully
The application ID
The application name
The content ID
Show child attributes
Show child attributes
The campaign ID
The campaign name
Number of recipients included
Number of recipients queued
The campaign sub-type
The email subject
The campaign type
Última modificación el 3 de abril de 2026