Retrieve a campaign
curl --request GET \
--url https://app.heyoo.ai/api/campaigns/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.heyoo.ai/api/campaigns/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.heyoo.ai/api/campaigns/{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://app.heyoo.ai/api/campaigns/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://app.heyoo.ai/api/campaigns/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.heyoo.ai/api/campaigns/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.heyoo.ai/api/campaigns/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"status": "draft",
"createdAt": "<string>",
"description": "<string>",
"destinationUrl": "<string>",
"clicks": 123,
"shares": 123,
"startDate": "<string>",
"endDate": "<string>",
"targetShares": 123,
"hasShared": true
}{
"error": {
"code": "bad_request",
"message": "The requested resource was not found.",
"doc_url": "https://docs.heyoo.ai/api-reference/errors#bad-request"
}
}{
"error": {
"code": "unauthorized",
"message": "The requested resource was not found.",
"doc_url": "https://docs.heyoo.ai/api-reference/errors#unauthorized"
}
}{
"error": {
"code": "forbidden",
"message": "The requested resource was not found.",
"doc_url": "https://docs.heyoo.ai/api-reference/errors#forbidden"
}
}{
"error": {
"code": "not_found",
"message": "The requested resource was not found.",
"doc_url": "https://docs.heyoo.ai/api-reference/errors#not-found"
}
}{
"error": {
"code": "conflict",
"message": "The requested resource was not found.",
"doc_url": "https://docs.heyoo.ai/api-reference/errors#conflict"
}
}{
"error": {
"code": "invite_expired",
"message": "The requested resource was not found.",
"doc_url": "https://docs.heyoo.ai/api-reference/errors#invite-expired"
}
}{
"error": {
"code": "unprocessable_entity",
"message": "The requested resource was not found.",
"doc_url": "https://docs.heyoo.ai/api-reference/errors#unprocessable-entity"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "The requested resource was not found.",
"doc_url": "https://docs.heyoo.ai/api-reference/errors#rate-limit_exceeded"
}
}{
"error": {
"code": "internal_server_error",
"message": "The requested resource was not found.",
"doc_url": "https://docs.heyoo.ai/api-reference/errors#internal-server_error"
}
}Campaigns
Retrieve a campaign
Retrieve a campaign in the workspace.
GET
/
campaigns
/
{id}
Retrieve a campaign
curl --request GET \
--url https://app.heyoo.ai/api/campaigns/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.heyoo.ai/api/campaigns/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.heyoo.ai/api/campaigns/{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://app.heyoo.ai/api/campaigns/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://app.heyoo.ai/api/campaigns/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.heyoo.ai/api/campaigns/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.heyoo.ai/api/campaigns/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"status": "draft",
"createdAt": "<string>",
"description": "<string>",
"destinationUrl": "<string>",
"clicks": 123,
"shares": 123,
"startDate": "<string>",
"endDate": "<string>",
"targetShares": 123,
"hasShared": true
}{
"error": {
"code": "bad_request",
"message": "The requested resource was not found.",
"doc_url": "https://docs.heyoo.ai/api-reference/errors#bad-request"
}
}{
"error": {
"code": "unauthorized",
"message": "The requested resource was not found.",
"doc_url": "https://docs.heyoo.ai/api-reference/errors#unauthorized"
}
}{
"error": {
"code": "forbidden",
"message": "The requested resource was not found.",
"doc_url": "https://docs.heyoo.ai/api-reference/errors#forbidden"
}
}{
"error": {
"code": "not_found",
"message": "The requested resource was not found.",
"doc_url": "https://docs.heyoo.ai/api-reference/errors#not-found"
}
}{
"error": {
"code": "conflict",
"message": "The requested resource was not found.",
"doc_url": "https://docs.heyoo.ai/api-reference/errors#conflict"
}
}{
"error": {
"code": "invite_expired",
"message": "The requested resource was not found.",
"doc_url": "https://docs.heyoo.ai/api-reference/errors#invite-expired"
}
}{
"error": {
"code": "unprocessable_entity",
"message": "The requested resource was not found.",
"doc_url": "https://docs.heyoo.ai/api-reference/errors#unprocessable-entity"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "The requested resource was not found.",
"doc_url": "https://docs.heyoo.ai/api-reference/errors#rate-limit_exceeded"
}
}{
"error": {
"code": "internal_server_error",
"message": "The requested resource was not found.",
"doc_url": "https://docs.heyoo.ai/api-reference/errors#internal-server_error"
}
}Authorizations
Default authentication mechanism
Path Parameters
The ID of the campaign to retrieve.
Response
The campaign.
The unique ID of the campaign.
The name of the campaign.
The status of the campaign.
Available options:
draft, published, archived The creation date of the campaign.
The description of the campaign.
The destination URL of the campaign.
The number of clicks the campaign has received.
The number of shares the campaign has received.
The start date of the campaign.
The end date of the campaign.
The target shares for the campaign.
Whether the authenticated user has shared this campaign.
Was this page helpful?

