curl --request POST \
--url https://app.heyoo.ai/api/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Employee Advocacy Campaign",
"description": "<string>",
"shareContext": "<string>",
"objective": "<string>",
"destinationUrl": "<string>",
"startDate": "<string>",
"shareRewardAmount": 123,
"clickRewardAmount": 123,
"maxRewardPerEmployee": 123,
"totalBudget": 123,
"endDate": "<string>",
"domain": "<string>",
"image": "<string>",
"tagIds": [
"123e4567-e89b-12d3-a456-426614174000"
],
"groupIds": [
"223e4567-e89b-12d3-a456-426614174001"
],
"resources": [
"<string>"
],
"targetShares": 123,
"contentPillarId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://app.heyoo.ai/api/campaigns"
payload = {
"name": "Employee Advocacy Campaign",
"description": "<string>",
"shareContext": "<string>",
"objective": "<string>",
"destinationUrl": "<string>",
"startDate": "<string>",
"shareRewardAmount": 123,
"clickRewardAmount": 123,
"maxRewardPerEmployee": 123,
"totalBudget": 123,
"endDate": "<string>",
"domain": "<string>",
"image": "<string>",
"tagIds": ["123e4567-e89b-12d3-a456-426614174000"],
"groupIds": ["223e4567-e89b-12d3-a456-426614174001"],
"resources": ["<string>"],
"targetShares": 123,
"contentPillarId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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({
name: 'Employee Advocacy Campaign',
description: '<string>',
shareContext: '<string>',
objective: '<string>',
destinationUrl: '<string>',
startDate: '<string>',
shareRewardAmount: 123,
clickRewardAmount: 123,
maxRewardPerEmployee: 123,
totalBudget: 123,
endDate: '<string>',
domain: '<string>',
image: '<string>',
tagIds: ['123e4567-e89b-12d3-a456-426614174000'],
groupIds: ['223e4567-e89b-12d3-a456-426614174001'],
resources: ['<string>'],
targetShares: 123,
contentPillarId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://app.heyoo.ai/api/campaigns', 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",
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([
'name' => 'Employee Advocacy Campaign',
'description' => '<string>',
'shareContext' => '<string>',
'objective' => '<string>',
'destinationUrl' => '<string>',
'startDate' => '<string>',
'shareRewardAmount' => 123,
'clickRewardAmount' => 123,
'maxRewardPerEmployee' => 123,
'totalBudget' => 123,
'endDate' => '<string>',
'domain' => '<string>',
'image' => '<string>',
'tagIds' => [
'123e4567-e89b-12d3-a456-426614174000'
],
'groupIds' => [
'223e4567-e89b-12d3-a456-426614174001'
],
'resources' => [
'<string>'
],
'targetShares' => 123,
'contentPillarId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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://app.heyoo.ai/api/campaigns"
payload := strings.NewReader("{\n \"name\": \"Employee Advocacy Campaign\",\n \"description\": \"<string>\",\n \"shareContext\": \"<string>\",\n \"objective\": \"<string>\",\n \"destinationUrl\": \"<string>\",\n \"startDate\": \"<string>\",\n \"shareRewardAmount\": 123,\n \"clickRewardAmount\": 123,\n \"maxRewardPerEmployee\": 123,\n \"totalBudget\": 123,\n \"endDate\": \"<string>\",\n \"domain\": \"<string>\",\n \"image\": \"<string>\",\n \"tagIds\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"groupIds\": [\n \"223e4567-e89b-12d3-a456-426614174001\"\n ],\n \"resources\": [\n \"<string>\"\n ],\n \"targetShares\": 123,\n \"contentPillarId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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://app.heyoo.ai/api/campaigns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Employee Advocacy Campaign\",\n \"description\": \"<string>\",\n \"shareContext\": \"<string>\",\n \"objective\": \"<string>\",\n \"destinationUrl\": \"<string>\",\n \"startDate\": \"<string>\",\n \"shareRewardAmount\": 123,\n \"clickRewardAmount\": 123,\n \"maxRewardPerEmployee\": 123,\n \"totalBudget\": 123,\n \"endDate\": \"<string>\",\n \"domain\": \"<string>\",\n \"image\": \"<string>\",\n \"tagIds\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"groupIds\": [\n \"223e4567-e89b-12d3-a456-426614174001\"\n ],\n \"resources\": [\n \"<string>\"\n ],\n \"targetShares\": 123,\n \"contentPillarId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.heyoo.ai/api/campaigns")
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 \"name\": \"Employee Advocacy Campaign\",\n \"description\": \"<string>\",\n \"shareContext\": \"<string>\",\n \"objective\": \"<string>\",\n \"destinationUrl\": \"<string>\",\n \"startDate\": \"<string>\",\n \"shareRewardAmount\": 123,\n \"clickRewardAmount\": 123,\n \"maxRewardPerEmployee\": 123,\n \"totalBudget\": 123,\n \"endDate\": \"<string>\",\n \"domain\": \"<string>\",\n \"image\": \"<string>\",\n \"tagIds\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"groupIds\": [\n \"223e4567-e89b-12d3-a456-426614174001\"\n ],\n \"resources\": [\n \"<string>\"\n ],\n \"targetShares\": 123,\n \"contentPillarId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
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"
}
}Create a campaign
Create a new campaign for the authenticated workspace.
curl --request POST \
--url https://app.heyoo.ai/api/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Employee Advocacy Campaign",
"description": "<string>",
"shareContext": "<string>",
"objective": "<string>",
"destinationUrl": "<string>",
"startDate": "<string>",
"shareRewardAmount": 123,
"clickRewardAmount": 123,
"maxRewardPerEmployee": 123,
"totalBudget": 123,
"endDate": "<string>",
"domain": "<string>",
"image": "<string>",
"tagIds": [
"123e4567-e89b-12d3-a456-426614174000"
],
"groupIds": [
"223e4567-e89b-12d3-a456-426614174001"
],
"resources": [
"<string>"
],
"targetShares": 123,
"contentPillarId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://app.heyoo.ai/api/campaigns"
payload = {
"name": "Employee Advocacy Campaign",
"description": "<string>",
"shareContext": "<string>",
"objective": "<string>",
"destinationUrl": "<string>",
"startDate": "<string>",
"shareRewardAmount": 123,
"clickRewardAmount": 123,
"maxRewardPerEmployee": 123,
"totalBudget": 123,
"endDate": "<string>",
"domain": "<string>",
"image": "<string>",
"tagIds": ["123e4567-e89b-12d3-a456-426614174000"],
"groupIds": ["223e4567-e89b-12d3-a456-426614174001"],
"resources": ["<string>"],
"targetShares": 123,
"contentPillarId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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({
name: 'Employee Advocacy Campaign',
description: '<string>',
shareContext: '<string>',
objective: '<string>',
destinationUrl: '<string>',
startDate: '<string>',
shareRewardAmount: 123,
clickRewardAmount: 123,
maxRewardPerEmployee: 123,
totalBudget: 123,
endDate: '<string>',
domain: '<string>',
image: '<string>',
tagIds: ['123e4567-e89b-12d3-a456-426614174000'],
groupIds: ['223e4567-e89b-12d3-a456-426614174001'],
resources: ['<string>'],
targetShares: 123,
contentPillarId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://app.heyoo.ai/api/campaigns', 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",
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([
'name' => 'Employee Advocacy Campaign',
'description' => '<string>',
'shareContext' => '<string>',
'objective' => '<string>',
'destinationUrl' => '<string>',
'startDate' => '<string>',
'shareRewardAmount' => 123,
'clickRewardAmount' => 123,
'maxRewardPerEmployee' => 123,
'totalBudget' => 123,
'endDate' => '<string>',
'domain' => '<string>',
'image' => '<string>',
'tagIds' => [
'123e4567-e89b-12d3-a456-426614174000'
],
'groupIds' => [
'223e4567-e89b-12d3-a456-426614174001'
],
'resources' => [
'<string>'
],
'targetShares' => 123,
'contentPillarId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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://app.heyoo.ai/api/campaigns"
payload := strings.NewReader("{\n \"name\": \"Employee Advocacy Campaign\",\n \"description\": \"<string>\",\n \"shareContext\": \"<string>\",\n \"objective\": \"<string>\",\n \"destinationUrl\": \"<string>\",\n \"startDate\": \"<string>\",\n \"shareRewardAmount\": 123,\n \"clickRewardAmount\": 123,\n \"maxRewardPerEmployee\": 123,\n \"totalBudget\": 123,\n \"endDate\": \"<string>\",\n \"domain\": \"<string>\",\n \"image\": \"<string>\",\n \"tagIds\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"groupIds\": [\n \"223e4567-e89b-12d3-a456-426614174001\"\n ],\n \"resources\": [\n \"<string>\"\n ],\n \"targetShares\": 123,\n \"contentPillarId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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://app.heyoo.ai/api/campaigns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Employee Advocacy Campaign\",\n \"description\": \"<string>\",\n \"shareContext\": \"<string>\",\n \"objective\": \"<string>\",\n \"destinationUrl\": \"<string>\",\n \"startDate\": \"<string>\",\n \"shareRewardAmount\": 123,\n \"clickRewardAmount\": 123,\n \"maxRewardPerEmployee\": 123,\n \"totalBudget\": 123,\n \"endDate\": \"<string>\",\n \"domain\": \"<string>\",\n \"image\": \"<string>\",\n \"tagIds\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"groupIds\": [\n \"223e4567-e89b-12d3-a456-426614174001\"\n ],\n \"resources\": [\n \"<string>\"\n ],\n \"targetShares\": 123,\n \"contentPillarId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.heyoo.ai/api/campaigns")
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 \"name\": \"Employee Advocacy Campaign\",\n \"description\": \"<string>\",\n \"shareContext\": \"<string>\",\n \"objective\": \"<string>\",\n \"destinationUrl\": \"<string>\",\n \"startDate\": \"<string>\",\n \"shareRewardAmount\": 123,\n \"clickRewardAmount\": 123,\n \"maxRewardPerEmployee\": 123,\n \"totalBudget\": 123,\n \"endDate\": \"<string>\",\n \"domain\": \"<string>\",\n \"image\": \"<string>\",\n \"tagIds\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"groupIds\": [\n \"223e4567-e89b-12d3-a456-426614174001\"\n ],\n \"resources\": [\n \"<string>\"\n ],\n \"targetShares\": 123,\n \"contentPillarId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
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
Body
The name of the campaign
"Employee Advocacy Campaign"
The description of the campaign
The share context of the campaign
The objective of the campaign
The status of the campaign
draft, published, archived The destination URL of the campaign
The domain of the campaign
The image of the campaign
The unique IDs of the tags assigned to the campaign.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$["123e4567-e89b-12d3-a456-426614174000"]
The unique IDs of the groups assigned to the campaign.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$["223e4567-e89b-12d3-a456-426614174001"]
The unique ID of the content pillar assigned to the campaign.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Response
The created campaign
The unique ID of the campaign.
The name of the campaign.
The status of the campaign.
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?

