POST Record (POST)
{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create
HEADERS

private-app-legacy
{{apiKey}}
QUERY PARAMS

externalEventId
subscriberState
BODY json

{
  "inputs": [
    {
      "contactProperties": {},
      "email": "",
      "interactionDateTime": 0,
      "properties": {}
    }
  ]
}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/post "{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create" {:headers {:private-app-legacy "{{apiKey}}"}
                                                                                                                                    :content-type :json
                                                                                                                                    :form-params {:inputs [{:contactProperties {}
                                                                                                                                                            :email ""
                                                                                                                                                            :interactionDateTime 0
                                                                                                                                                            :properties {}}]}})
require "http/client"

url = "{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create"
headers = HTTP::Headers{
  "private-app-legacy" => "{{apiKey}}"
  "content-type" => "application/json"
}
reqBody = "{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}"

response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Post,
    RequestUri = new Uri("{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create"),
    Headers =
    {
        { "private-app-legacy", "{{apiKey}}" },
    },
    Content = new StringContent("{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}")
    {
        Headers =
        {
            ContentType = new MediaTypeHeaderValue("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create"

	payload := strings.NewReader("{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("private-app-legacy", "{{apiKey}}")
	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
POST /baseUrl/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 138

{
  "inputs": [
    {
      "contactProperties": {},
      "email": "",
      "interactionDateTime": 0,
      "properties": {}
    }
  ]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create")
  .setHeader("private-app-legacy", "{{apiKey}}")
  .setHeader("content-type", "application/json")
  .setBody("{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create"))
    .header("private-app-legacy", "{{apiKey}}")
    .header("content-type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}"))
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}");
Request request = new Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create")
  .post(body)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create")
  .header("private-app-legacy", "{{apiKey}}")
  .header("content-type", "application/json")
  .body("{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}")
  .asString();
const data = JSON.stringify({
  inputs: [
    {
      contactProperties: {},
      email: '',
      interactionDateTime: 0,
      properties: {}
    }
  ]
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('POST', '{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  data: {
    inputs: [{contactProperties: {}, email: '', interactionDateTime: 0, properties: {}}]
  }
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create';
const options = {
  method: 'POST',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: '{"inputs":[{"contactProperties":{},"email":"","interactionDateTime":0,"properties":{}}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create',
  method: 'POST',
  headers: {
    'private-app-legacy': '{{apiKey}}',
    'content-type': 'application/json'
  },
  processData: false,
  data: '{\n  "inputs": [\n    {\n      "contactProperties": {},\n      "email": "",\n      "interactionDateTime": 0,\n      "properties": {}\n    }\n  ]\n}'
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}")
val request = Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create")
  .post(body)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'POST',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create',
  headers: {
    'private-app-legacy': '{{apiKey}}',
    'content-type': 'application/json'
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({
  inputs: [{contactProperties: {}, email: '', interactionDateTime: 0, properties: {}}]
}));
req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: {
    inputs: [{contactProperties: {}, email: '', interactionDateTime: 0, properties: {}}]
  },
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('POST', '{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create');

req.headers({
  'private-app-legacy': '{{apiKey}}',
  'content-type': 'application/json'
});

req.type('json');
req.send({
  inputs: [
    {
      contactProperties: {},
      email: '',
      interactionDateTime: 0,
      properties: {}
    }
  ]
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  data: {
    inputs: [{contactProperties: {}, email: '', interactionDateTime: 0, properties: {}}]
  }
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create';
const options = {
  method: 'POST',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: '{"inputs":[{"contactProperties":{},"email":"","interactionDateTime":0,"properties":{}}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"inputs": @[ @{ @"contactProperties": @{  }, @"email": @"", @"interactionDateTime": @0, @"properties": @{  } } ] };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create" in
let headers = Header.add_list (Header.init ()) [
  ("private-app-legacy", "{{apiKey}}");
  ("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create",
  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' => [
        [
                'contactProperties' => [
                                
                ],
                'email' => '',
                'interactionDateTime' => 0,
                'properties' => [
                                
                ]
        ]
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "content-type: application/json",
    "private-app-legacy: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('POST', '{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create', [
  'body' => '{
  "inputs": [
    {
      "contactProperties": {},
      "email": "",
      "interactionDateTime": 0,
      "properties": {}
    }
  ]
}',
  'headers' => [
    'content-type' => 'application/json',
    'private-app-legacy' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  'inputs' => [
    [
        'contactProperties' => [
                
        ],
        'email' => '',
        'interactionDateTime' => 0,
        'properties' => [
                
        ]
    ]
  ]
]));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  'inputs' => [
    [
        'contactProperties' => [
                
        ],
        'email' => '',
        'interactionDateTime' => 0,
        'properties' => [
                
        ]
    ]
  ]
]));
$request->setRequestUrl('{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "inputs": [
    {
      "contactProperties": {},
      "email": "",
      "interactionDateTime": 0,
      "properties": {}
    }
  ]
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "inputs": [
    {
      "contactProperties": {},
      "email": "",
      "interactionDateTime": 0,
      "properties": {}
    }
  ]
}'
import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}"

headers = {
    'private-app-legacy': "{{apiKey}}",
    'content-type': "application/json"
}

conn.request("POST", "/baseUrl/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create"

payload = { "inputs": [
        {
            "contactProperties": {},
            "email": "",
            "interactionDateTime": 0,
            "properties": {}
        }
    ] }
headers = {
    "private-app-legacy": "{{apiKey}}",
    "content-type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create"

payload <- "{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}"

encode <- "json"

response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
  headers: {'Content-Type' => 'application/json'}
)

response = conn.post('/baseUrl/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create') do |req|
  req.headers['private-app-legacy'] = '{{apiKey}}'
  req.body = "{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}"
end

puts response.status
puts response.body
use serde_json::json;
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create";

    let payload = json!({"inputs": (
            json!({
                "contactProperties": json!({}),
                "email": "",
                "interactionDateTime": 0,
                "properties": json!({})
            })
        )});

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
    headers.insert("content-type", "application/json".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.post(url)
        .headers(headers)
        .json(&payload)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request POST \
  --url {{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create \
  --header 'content-type: application/json' \
  --header 'private-app-legacy: {{apiKey}}' \
  --data '{
  "inputs": [
    {
      "contactProperties": {},
      "email": "",
      "interactionDateTime": 0,
      "properties": {}
    }
  ]
}'
echo '{
  "inputs": [
    {
      "contactProperties": {},
      "email": "",
      "interactionDateTime": 0,
      "properties": {}
    }
  ]
}' |  \
  http POST {{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create \
  content-type:application/json \
  private-app-legacy:'{{apiKey}}'
wget --quiet \
  --method POST \
  --header 'private-app-legacy: {{apiKey}}' \
  --header 'content-type: application/json' \
  --body-data '{\n  "inputs": [\n    {\n      "contactProperties": {},\n      "email": "",\n      "interactionDateTime": 0,\n      "properties": {}\n    }\n  ]\n}' \
  --output-document \
  - {{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create
import Foundation

let headers = [
  "private-app-legacy": "{{apiKey}}",
  "content-type": "application/json"
]
let parameters = ["inputs": [
    [
      "contactProperties": [],
      "email": "",
      "interactionDateTime": 0,
      "properties": []
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/email-create")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
*/*
RESPONSE BODY text

{
  "category": "VALIDATION_ERROR",
  "correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
  "links": {
    "knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
  },
  "message": "Invalid input (details will vary based on the error)"
}
POST Record
{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create
HEADERS

private-app-legacy
{{apiKey}}
QUERY PARAMS

externalEventId
subscriberState
BODY json

{
  "inputs": [
    {
      "interactionDateTime": 0,
      "properties": {},
      "vid": 0
    }
  ]
}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/post "{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create" {:headers {:private-app-legacy "{{apiKey}}"}
                                                                                                                              :content-type :json
                                                                                                                              :form-params {:inputs [{:interactionDateTime 0
                                                                                                                                                      :properties {}
                                                                                                                                                      :vid 0}]}})
require "http/client"

url = "{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create"
headers = HTTP::Headers{
  "private-app-legacy" => "{{apiKey}}"
  "content-type" => "application/json"
}
reqBody = "{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}"

response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Post,
    RequestUri = new Uri("{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create"),
    Headers =
    {
        { "private-app-legacy", "{{apiKey}}" },
    },
    Content = new StringContent("{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}")
    {
        Headers =
        {
            ContentType = new MediaTypeHeaderValue("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create"

	payload := strings.NewReader("{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("private-app-legacy", "{{apiKey}}")
	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
POST /baseUrl/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 104

{
  "inputs": [
    {
      "interactionDateTime": 0,
      "properties": {},
      "vid": 0
    }
  ]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create")
  .setHeader("private-app-legacy", "{{apiKey}}")
  .setHeader("content-type", "application/json")
  .setBody("{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create"))
    .header("private-app-legacy", "{{apiKey}}")
    .header("content-type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}"))
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}");
Request request = new Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create")
  .post(body)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create")
  .header("private-app-legacy", "{{apiKey}}")
  .header("content-type", "application/json")
  .body("{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}")
  .asString();
const data = JSON.stringify({
  inputs: [
    {
      interactionDateTime: 0,
      properties: {},
      vid: 0
    }
  ]
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('POST', '{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  data: {inputs: [{interactionDateTime: 0, properties: {}, vid: 0}]}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create';
const options = {
  method: 'POST',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: '{"inputs":[{"interactionDateTime":0,"properties":{},"vid":0}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create',
  method: 'POST',
  headers: {
    'private-app-legacy': '{{apiKey}}',
    'content-type': 'application/json'
  },
  processData: false,
  data: '{\n  "inputs": [\n    {\n      "interactionDateTime": 0,\n      "properties": {},\n      "vid": 0\n    }\n  ]\n}'
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}")
val request = Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create")
  .post(body)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'POST',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create',
  headers: {
    'private-app-legacy': '{{apiKey}}',
    'content-type': 'application/json'
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({inputs: [{interactionDateTime: 0, properties: {}, vid: 0}]}));
req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: {inputs: [{interactionDateTime: 0, properties: {}, vid: 0}]},
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('POST', '{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create');

req.headers({
  'private-app-legacy': '{{apiKey}}',
  'content-type': 'application/json'
});

req.type('json');
req.send({
  inputs: [
    {
      interactionDateTime: 0,
      properties: {},
      vid: 0
    }
  ]
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  data: {inputs: [{interactionDateTime: 0, properties: {}, vid: 0}]}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create';
const options = {
  method: 'POST',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: '{"inputs":[{"interactionDateTime":0,"properties":{},"vid":0}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"inputs": @[ @{ @"interactionDateTime": @0, @"properties": @{  }, @"vid": @0 } ] };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create" in
let headers = Header.add_list (Header.init ()) [
  ("private-app-legacy", "{{apiKey}}");
  ("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create",
  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' => [
        [
                'interactionDateTime' => 0,
                'properties' => [
                                
                ],
                'vid' => 0
        ]
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "content-type: application/json",
    "private-app-legacy: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('POST', '{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create', [
  'body' => '{
  "inputs": [
    {
      "interactionDateTime": 0,
      "properties": {},
      "vid": 0
    }
  ]
}',
  'headers' => [
    'content-type' => 'application/json',
    'private-app-legacy' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  'inputs' => [
    [
        'interactionDateTime' => 0,
        'properties' => [
                
        ],
        'vid' => 0
    ]
  ]
]));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  'inputs' => [
    [
        'interactionDateTime' => 0,
        'properties' => [
                
        ],
        'vid' => 0
    ]
  ]
]));
$request->setRequestUrl('{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "inputs": [
    {
      "interactionDateTime": 0,
      "properties": {},
      "vid": 0
    }
  ]
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "inputs": [
    {
      "interactionDateTime": 0,
      "properties": {},
      "vid": 0
    }
  ]
}'
import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}"

headers = {
    'private-app-legacy': "{{apiKey}}",
    'content-type': "application/json"
}

conn.request("POST", "/baseUrl/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create"

payload = { "inputs": [
        {
            "interactionDateTime": 0,
            "properties": {},
            "vid": 0
        }
    ] }
headers = {
    "private-app-legacy": "{{apiKey}}",
    "content-type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create"

payload <- "{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}"

encode <- "json"

response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
  headers: {'Content-Type' => 'application/json'}
)

response = conn.post('/baseUrl/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create') do |req|
  req.headers['private-app-legacy'] = '{{apiKey}}'
  req.body = "{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}"
end

puts response.status
puts response.body
use serde_json::json;
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create";

    let payload = json!({"inputs": (
            json!({
                "interactionDateTime": 0,
                "properties": json!({}),
                "vid": 0
            })
        )});

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
    headers.insert("content-type", "application/json".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.post(url)
        .headers(headers)
        .json(&payload)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request POST \
  --url {{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create \
  --header 'content-type: application/json' \
  --header 'private-app-legacy: {{apiKey}}' \
  --data '{
  "inputs": [
    {
      "interactionDateTime": 0,
      "properties": {},
      "vid": 0
    }
  ]
}'
echo '{
  "inputs": [
    {
      "interactionDateTime": 0,
      "properties": {},
      "vid": 0
    }
  ]
}' |  \
  http POST {{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create \
  content-type:application/json \
  private-app-legacy:'{{apiKey}}'
wget --quiet \
  --method POST \
  --header 'private-app-legacy: {{apiKey}}' \
  --header 'content-type: application/json' \
  --body-data '{\n  "inputs": [\n    {\n      "interactionDateTime": 0,\n      "properties": {},\n      "vid": 0\n    }\n  ]\n}' \
  --output-document \
  - {{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create
import Foundation

let headers = [
  "private-app-legacy": "{{apiKey}}",
  "content-type": "application/json"
]
let parameters = ["inputs": [
    [
      "interactionDateTime": 0,
      "properties": [],
      "vid": 0
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/marketing/v3/marketing-events/attendance/:externalEventId/:subscriberState/create")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
*/*
RESPONSE BODY text

{
  "category": "VALIDATION_ERROR",
  "correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
  "links": {
    "knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
  },
  "message": "Invalid input (details will vary based on the error)"
}
DELETE delete--marketing-v3-marketing-events-events-{externalEventId}_archive
{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId
HEADERS

private-app-legacy
{{apiKey}}
QUERY PARAMS

externalAccountId
externalEventId
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/delete "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId" {:headers {:private-app-legacy "{{apiKey}}"}
                                                                                                    :query-params {:externalAccountId ""}})
require "http/client"

url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId="
headers = HTTP::Headers{
  "private-app-legacy" => "{{apiKey}}"
}

response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Delete,
    RequestUri = new Uri("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId="),
    Headers =
    {
        { "private-app-legacy", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=");
var request = new RestRequest("", Method.Delete);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId="

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("private-app-legacy", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
DELETE /baseUrl/marketing/v3/marketing-events/events/:externalEventId?externalAccountId= HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=")
  .setHeader("private-app-legacy", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId="))
    .header("private-app-legacy", "{{apiKey}}")
    .method("DELETE", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=")
  .delete(null)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=")
  .header("private-app-legacy", "{{apiKey}}")
  .asString();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('DELETE', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'DELETE',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId',
  params: {externalAccountId: ''},
  headers: {'private-app-legacy': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=';
const options = {method: 'DELETE', headers: {'private-app-legacy': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=',
  method: 'DELETE',
  headers: {
    'private-app-legacy': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=")
  .delete(null)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'DELETE',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=',
  headers: {
    'private-app-legacy': '{{apiKey}}'
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const request = require('request');

const options = {
  method: 'DELETE',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId',
  qs: {externalAccountId: ''},
  headers: {'private-app-legacy': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('DELETE', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId');

req.query({
  externalAccountId: ''
});

req.headers({
  'private-app-legacy': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'DELETE',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId',
  params: {externalAccountId: ''},
  headers: {'private-app-legacy': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=';
const options = {method: 'DELETE', headers: {'private-app-legacy': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId="]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in

Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_HTTPHEADER => [
    "private-app-legacy: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('DELETE', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=', [
  'headers' => [
    'private-app-legacy' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId');
$request->setMethod(HTTP_METH_DELETE);

$request->setQueryData([
  'externalAccountId' => ''
]);

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
  'externalAccountId' => ''
]));

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=' -Method DELETE -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'private-app-legacy': "{{apiKey}}" }

conn.request("DELETE", "/baseUrl/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId"

querystring = {"externalAccountId":""}

headers = {"private-app-legacy": "{{apiKey}}"}

response = requests.delete(url, headers=headers, params=querystring)

print(response.json())
library(httr)

url <- "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId"

queryString <- list(externalAccountId = "")

response <- VERB("DELETE", url, query = queryString, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["private-app-legacy"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.delete('/baseUrl/marketing/v3/marketing-events/events/:externalEventId') do |req|
  req.headers['private-app-legacy'] = '{{apiKey}}'
  req.params['externalAccountId'] = ''
end

puts response.status
puts response.body
use std::str::FromStr;
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId";

    let querystring = [
        ("externalAccountId", ""),
    ];

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
        .query(&querystring)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request DELETE \
  --url '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=' \
  --header 'private-app-legacy: {{apiKey}}'
http DELETE '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=' \
  private-app-legacy:'{{apiKey}}'
wget --quiet \
  --method DELETE \
  --header 'private-app-legacy: {{apiKey}}' \
  --output-document \
  - '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId='
import Foundation

let headers = ["private-app-legacy": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
*/*
RESPONSE BODY text

{
  "category": "VALIDATION_ERROR",
  "correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
  "links": {
    "knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
  },
  "message": "Invalid input (details will vary based on the error)"
}
GET get--marketing-v3-marketing-events-events-{externalEventId}_getById
{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId
QUERY PARAMS

externalAccountId
externalEventId
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId" {:query-params {:externalAccountId ""}})
require "http/client"

url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId="

response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId="),
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId="

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/marketing/v3/marketing-events/events/:externalEventId?externalAccountId= HTTP/1.1
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId="))
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=")
  .get()
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=")
  .asString();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('GET', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId',
  params: {externalAccountId: ''}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=',
  method: 'GET',
  headers: {}
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=")
  .get()
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=',
  headers: {}
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId',
  qs: {externalAccountId: ''}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId');

req.query({
  externalAccountId: ''
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId',
  params: {externalAccountId: ''}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId="]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=" in

Client.call `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=",
  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;
}
request('GET', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=');

echo $response->getBody();
setUrl('{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData([
  'externalAccountId' => ''
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
  'externalAccountId' => ''
]));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=' -Method GET 
$response = Invoke-RestMethod -Uri '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=' -Method GET 
import http.client

conn = http.client.HTTPSConnection("example.com")

conn.request("GET", "/baseUrl/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId"

querystring = {"externalAccountId":""}

response = requests.get(url, params=querystring)

print(response.json())
library(httr)

url <- "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId"

queryString <- list(externalAccountId = "")

response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=")

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
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/marketing/v3/marketing-events/events/:externalEventId') do |req|
  req.params['externalAccountId'] = ''
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId";

    let querystring = [
        ("externalAccountId", ""),
    ];

    let client = reqwest::Client::new();
    let response = client.get(url)
        .query(&querystring)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId='
http GET '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId='
wget --quiet \
  --method GET \
  --output-document \
  - '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId='
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
*/*
RESPONSE BODY text

{
  "category": "VALIDATION_ERROR",
  "correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
  "links": {
    "knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
  },
  "message": "Invalid input (details will vary based on the error)"
}
PATCH patch--marketing-v3-marketing-events-events-{externalEventId}_update
{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId
HEADERS

private-app-legacy
{{apiKey}}
QUERY PARAMS

externalAccountId
externalEventId
BODY json

{
  "customProperties": [
    {
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    }
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "startDateTime": ""
}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"startDateTime\": \"\"\n}");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/patch "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId" {:headers {:private-app-legacy "{{apiKey}}"}
                                                                                                   :query-params {:externalAccountId ""}
                                                                                                   :content-type :json
                                                                                                   :form-params {:customProperties [{:name ""
                                                                                                                                     :persistenceTimestamp 0
                                                                                                                                     :requestId ""
                                                                                                                                     :selectedByUser false
                                                                                                                                     :selectedByUserTimestamp 0
                                                                                                                                     :source ""
                                                                                                                                     :sourceId ""
                                                                                                                                     :sourceLabel ""
                                                                                                                                     :sourceMetadata ""
                                                                                                                                     :sourceVid []
                                                                                                                                     :timestamp 0
                                                                                                                                     :updatedByUserId 0
                                                                                                                                     :useTimestampAsPersistenceTimestamp false
                                                                                                                                     :value ""}]
                                                                                                                 :endDateTime ""
                                                                                                                 :eventCancelled false
                                                                                                                 :eventDescription ""
                                                                                                                 :eventName ""
                                                                                                                 :eventOrganizer ""
                                                                                                                 :eventType ""
                                                                                                                 :eventUrl ""
                                                                                                                 :startDateTime ""}})
require "http/client"

url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId="
headers = HTTP::Headers{
  "private-app-legacy" => "{{apiKey}}"
  "content-type" => "application/json"
}
reqBody = "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"startDateTime\": \"\"\n}"

response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Patch,
    RequestUri = new Uri("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId="),
    Headers =
    {
        { "private-app-legacy", "{{apiKey}}" },
    },
    Content = new StringContent("{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"startDateTime\": \"\"\n}")
    {
        Headers =
        {
            ContentType = new MediaTypeHeaderValue("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=");
var request = new RestRequest("", Method.Patch);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"startDateTime\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId="

	payload := strings.NewReader("{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"startDateTime\": \"\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("private-app-legacy", "{{apiKey}}")
	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
PATCH /baseUrl/marketing/v3/marketing-events/events/:externalEventId?externalAccountId= HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 598

{
  "customProperties": [
    {
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    }
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "startDateTime": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=")
  .setHeader("private-app-legacy", "{{apiKey}}")
  .setHeader("content-type", "application/json")
  .setBody("{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"startDateTime\": \"\"\n}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId="))
    .header("private-app-legacy", "{{apiKey}}")
    .header("content-type", "application/json")
    .method("PATCH", HttpRequest.BodyPublishers.ofString("{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"startDateTime\": \"\"\n}"))
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"startDateTime\": \"\"\n}");
Request request = new Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=")
  .patch(body)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=")
  .header("private-app-legacy", "{{apiKey}}")
  .header("content-type", "application/json")
  .body("{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"startDateTime\": \"\"\n}")
  .asString();
const data = JSON.stringify({
  customProperties: [
    {
      name: '',
      persistenceTimestamp: 0,
      requestId: '',
      selectedByUser: false,
      selectedByUserTimestamp: 0,
      source: '',
      sourceId: '',
      sourceLabel: '',
      sourceMetadata: '',
      sourceVid: [],
      timestamp: 0,
      updatedByUserId: 0,
      useTimestampAsPersistenceTimestamp: false,
      value: ''
    }
  ],
  endDateTime: '',
  eventCancelled: false,
  eventDescription: '',
  eventName: '',
  eventOrganizer: '',
  eventType: '',
  eventUrl: '',
  startDateTime: ''
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('PATCH', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'PATCH',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId',
  params: {externalAccountId: ''},
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  data: {
    customProperties: [
      {
        name: '',
        persistenceTimestamp: 0,
        requestId: '',
        selectedByUser: false,
        selectedByUserTimestamp: 0,
        source: '',
        sourceId: '',
        sourceLabel: '',
        sourceMetadata: '',
        sourceVid: [],
        timestamp: 0,
        updatedByUserId: 0,
        useTimestampAsPersistenceTimestamp: false,
        value: ''
      }
    ],
    endDateTime: '',
    eventCancelled: false,
    eventDescription: '',
    eventName: '',
    eventOrganizer: '',
    eventType: '',
    eventUrl: '',
    startDateTime: ''
  }
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=';
const options = {
  method: 'PATCH',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: '{"customProperties":[{"name":"","persistenceTimestamp":0,"requestId":"","selectedByUser":false,"selectedByUserTimestamp":0,"source":"","sourceId":"","sourceLabel":"","sourceMetadata":"","sourceVid":[],"timestamp":0,"updatedByUserId":0,"useTimestampAsPersistenceTimestamp":false,"value":""}],"endDateTime":"","eventCancelled":false,"eventDescription":"","eventName":"","eventOrganizer":"","eventType":"","eventUrl":"","startDateTime":""}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=',
  method: 'PATCH',
  headers: {
    'private-app-legacy': '{{apiKey}}',
    'content-type': 'application/json'
  },
  processData: false,
  data: '{\n  "customProperties": [\n    {\n      "name": "",\n      "persistenceTimestamp": 0,\n      "requestId": "",\n      "selectedByUser": false,\n      "selectedByUserTimestamp": 0,\n      "source": "",\n      "sourceId": "",\n      "sourceLabel": "",\n      "sourceMetadata": "",\n      "sourceVid": [],\n      "timestamp": 0,\n      "updatedByUserId": 0,\n      "useTimestampAsPersistenceTimestamp": false,\n      "value": ""\n    }\n  ],\n  "endDateTime": "",\n  "eventCancelled": false,\n  "eventDescription": "",\n  "eventName": "",\n  "eventOrganizer": "",\n  "eventType": "",\n  "eventUrl": "",\n  "startDateTime": ""\n}'
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"startDateTime\": \"\"\n}")
val request = Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=")
  .patch(body)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'PATCH',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=',
  headers: {
    'private-app-legacy': '{{apiKey}}',
    'content-type': 'application/json'
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({
  customProperties: [
    {
      name: '',
      persistenceTimestamp: 0,
      requestId: '',
      selectedByUser: false,
      selectedByUserTimestamp: 0,
      source: '',
      sourceId: '',
      sourceLabel: '',
      sourceMetadata: '',
      sourceVid: [],
      timestamp: 0,
      updatedByUserId: 0,
      useTimestampAsPersistenceTimestamp: false,
      value: ''
    }
  ],
  endDateTime: '',
  eventCancelled: false,
  eventDescription: '',
  eventName: '',
  eventOrganizer: '',
  eventType: '',
  eventUrl: '',
  startDateTime: ''
}));
req.end();
const request = require('request');

const options = {
  method: 'PATCH',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId',
  qs: {externalAccountId: ''},
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: {
    customProperties: [
      {
        name: '',
        persistenceTimestamp: 0,
        requestId: '',
        selectedByUser: false,
        selectedByUserTimestamp: 0,
        source: '',
        sourceId: '',
        sourceLabel: '',
        sourceMetadata: '',
        sourceVid: [],
        timestamp: 0,
        updatedByUserId: 0,
        useTimestampAsPersistenceTimestamp: false,
        value: ''
      }
    ],
    endDateTime: '',
    eventCancelled: false,
    eventDescription: '',
    eventName: '',
    eventOrganizer: '',
    eventType: '',
    eventUrl: '',
    startDateTime: ''
  },
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('PATCH', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId');

req.query({
  externalAccountId: ''
});

req.headers({
  'private-app-legacy': '{{apiKey}}',
  'content-type': 'application/json'
});

req.type('json');
req.send({
  customProperties: [
    {
      name: '',
      persistenceTimestamp: 0,
      requestId: '',
      selectedByUser: false,
      selectedByUserTimestamp: 0,
      source: '',
      sourceId: '',
      sourceLabel: '',
      sourceMetadata: '',
      sourceVid: [],
      timestamp: 0,
      updatedByUserId: 0,
      useTimestampAsPersistenceTimestamp: false,
      value: ''
    }
  ],
  endDateTime: '',
  eventCancelled: false,
  eventDescription: '',
  eventName: '',
  eventOrganizer: '',
  eventType: '',
  eventUrl: '',
  startDateTime: ''
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'PATCH',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId',
  params: {externalAccountId: ''},
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  data: {
    customProperties: [
      {
        name: '',
        persistenceTimestamp: 0,
        requestId: '',
        selectedByUser: false,
        selectedByUserTimestamp: 0,
        source: '',
        sourceId: '',
        sourceLabel: '',
        sourceMetadata: '',
        sourceVid: [],
        timestamp: 0,
        updatedByUserId: 0,
        useTimestampAsPersistenceTimestamp: false,
        value: ''
      }
    ],
    endDateTime: '',
    eventCancelled: false,
    eventDescription: '',
    eventName: '',
    eventOrganizer: '',
    eventType: '',
    eventUrl: '',
    startDateTime: ''
  }
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=';
const options = {
  method: 'PATCH',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: '{"customProperties":[{"name":"","persistenceTimestamp":0,"requestId":"","selectedByUser":false,"selectedByUserTimestamp":0,"source":"","sourceId":"","sourceLabel":"","sourceMetadata":"","sourceVid":[],"timestamp":0,"updatedByUserId":0,"useTimestampAsPersistenceTimestamp":false,"value":""}],"endDateTime":"","eventCancelled":false,"eventDescription":"","eventName":"","eventOrganizer":"","eventType":"","eventUrl":"","startDateTime":""}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"customProperties": @[ @{ @"name": @"", @"persistenceTimestamp": @0, @"requestId": @"", @"selectedByUser": @NO, @"selectedByUserTimestamp": @0, @"source": @"", @"sourceId": @"", @"sourceLabel": @"", @"sourceMetadata": @"", @"sourceVid": @[  ], @"timestamp": @0, @"updatedByUserId": @0, @"useTimestampAsPersistenceTimestamp": @NO, @"value": @"" } ],
                              @"endDateTime": @"",
                              @"eventCancelled": @NO,
                              @"eventDescription": @"",
                              @"eventName": @"",
                              @"eventOrganizer": @"",
                              @"eventType": @"",
                              @"eventUrl": @"",
                              @"startDateTime": @"" };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId="]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=" in
let headers = Header.add_list (Header.init ()) [
  ("private-app-legacy", "{{apiKey}}");
  ("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"startDateTime\": \"\"\n}" in

Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PATCH",
  CURLOPT_POSTFIELDS => json_encode([
    'customProperties' => [
        [
                'name' => '',
                'persistenceTimestamp' => 0,
                'requestId' => '',
                'selectedByUser' => null,
                'selectedByUserTimestamp' => 0,
                'source' => '',
                'sourceId' => '',
                'sourceLabel' => '',
                'sourceMetadata' => '',
                'sourceVid' => [
                                
                ],
                'timestamp' => 0,
                'updatedByUserId' => 0,
                'useTimestampAsPersistenceTimestamp' => null,
                'value' => ''
        ]
    ],
    'endDateTime' => '',
    'eventCancelled' => null,
    'eventDescription' => '',
    'eventName' => '',
    'eventOrganizer' => '',
    'eventType' => '',
    'eventUrl' => '',
    'startDateTime' => ''
  ]),
  CURLOPT_HTTPHEADER => [
    "content-type: application/json",
    "private-app-legacy: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('PATCH', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=', [
  'body' => '{
  "customProperties": [
    {
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    }
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "startDateTime": ""
}',
  'headers' => [
    'content-type' => 'application/json',
    'private-app-legacy' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);

$request->setQueryData([
  'externalAccountId' => ''
]);

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  'customProperties' => [
    [
        'name' => '',
        'persistenceTimestamp' => 0,
        'requestId' => '',
        'selectedByUser' => null,
        'selectedByUserTimestamp' => 0,
        'source' => '',
        'sourceId' => '',
        'sourceLabel' => '',
        'sourceMetadata' => '',
        'sourceVid' => [
                
        ],
        'timestamp' => 0,
        'updatedByUserId' => 0,
        'useTimestampAsPersistenceTimestamp' => null,
        'value' => ''
    ]
  ],
  'endDateTime' => '',
  'eventCancelled' => null,
  'eventDescription' => '',
  'eventName' => '',
  'eventOrganizer' => '',
  'eventType' => '',
  'eventUrl' => '',
  'startDateTime' => ''
]));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  'customProperties' => [
    [
        'name' => '',
        'persistenceTimestamp' => 0,
        'requestId' => '',
        'selectedByUser' => null,
        'selectedByUserTimestamp' => 0,
        'source' => '',
        'sourceId' => '',
        'sourceLabel' => '',
        'sourceMetadata' => '',
        'sourceVid' => [
                
        ],
        'timestamp' => 0,
        'updatedByUserId' => 0,
        'useTimestampAsPersistenceTimestamp' => null,
        'value' => ''
    ]
  ],
  'endDateTime' => '',
  'eventCancelled' => null,
  'eventDescription' => '',
  'eventName' => '',
  'eventOrganizer' => '',
  'eventType' => '',
  'eventUrl' => '',
  'startDateTime' => ''
]));
$request->setRequestUrl('{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId');
$request->setRequestMethod('PATCH');
$request->setBody($body);

$request->setQuery(new http\QueryString([
  'externalAccountId' => ''
]));

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
  "customProperties": [
    {
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    }
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "startDateTime": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
  "customProperties": [
    {
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    }
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "startDateTime": ""
}'
import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"startDateTime\": \"\"\n}"

headers = {
    'private-app-legacy': "{{apiKey}}",
    'content-type': "application/json"
}

conn.request("PATCH", "/baseUrl/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId"

querystring = {"externalAccountId":""}

payload = {
    "customProperties": [
        {
            "name": "",
            "persistenceTimestamp": 0,
            "requestId": "",
            "selectedByUser": False,
            "selectedByUserTimestamp": 0,
            "source": "",
            "sourceId": "",
            "sourceLabel": "",
            "sourceMetadata": "",
            "sourceVid": [],
            "timestamp": 0,
            "updatedByUserId": 0,
            "useTimestampAsPersistenceTimestamp": False,
            "value": ""
        }
    ],
    "endDateTime": "",
    "eventCancelled": False,
    "eventDescription": "",
    "eventName": "",
    "eventOrganizer": "",
    "eventType": "",
    "eventUrl": "",
    "startDateTime": ""
}
headers = {
    "private-app-legacy": "{{apiKey}}",
    "content-type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers, params=querystring)

print(response.json())
library(httr)

url <- "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId"

queryString <- list(externalAccountId = "")

payload <- "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"startDateTime\": \"\"\n}"

encode <- "json"

response <- VERB("PATCH", url, body = payload, query = queryString, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"startDateTime\": \"\"\n}"

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
  headers: {'Content-Type' => 'application/json'}
)

response = conn.patch('/baseUrl/marketing/v3/marketing-events/events/:externalEventId') do |req|
  req.headers['private-app-legacy'] = '{{apiKey}}'
  req.params['externalAccountId'] = ''
  req.body = "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"startDateTime\": \"\"\n}"
end

puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId";

    let querystring = [
        ("externalAccountId", ""),
    ];

    let payload = json!({
        "customProperties": (
            json!({
                "name": "",
                "persistenceTimestamp": 0,
                "requestId": "",
                "selectedByUser": false,
                "selectedByUserTimestamp": 0,
                "source": "",
                "sourceId": "",
                "sourceLabel": "",
                "sourceMetadata": "",
                "sourceVid": (),
                "timestamp": 0,
                "updatedByUserId": 0,
                "useTimestampAsPersistenceTimestamp": false,
                "value": ""
            })
        ),
        "endDateTime": "",
        "eventCancelled": false,
        "eventDescription": "",
        "eventName": "",
        "eventOrganizer": "",
        "eventType": "",
        "eventUrl": "",
        "startDateTime": ""
    });

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
    headers.insert("content-type", "application/json".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
        .query(&querystring)
        .headers(headers)
        .json(&payload)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request PATCH \
  --url '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=' \
  --header 'content-type: application/json' \
  --header 'private-app-legacy: {{apiKey}}' \
  --data '{
  "customProperties": [
    {
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    }
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "startDateTime": ""
}'
echo '{
  "customProperties": [
    {
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    }
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "startDateTime": ""
}' |  \
  http PATCH '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=' \
  content-type:application/json \
  private-app-legacy:'{{apiKey}}'
wget --quiet \
  --method PATCH \
  --header 'private-app-legacy: {{apiKey}}' \
  --header 'content-type: application/json' \
  --body-data '{\n  "customProperties": [\n    {\n      "name": "",\n      "persistenceTimestamp": 0,\n      "requestId": "",\n      "selectedByUser": false,\n      "selectedByUserTimestamp": 0,\n      "source": "",\n      "sourceId": "",\n      "sourceLabel": "",\n      "sourceMetadata": "",\n      "sourceVid": [],\n      "timestamp": 0,\n      "updatedByUserId": 0,\n      "useTimestampAsPersistenceTimestamp": false,\n      "value": ""\n    }\n  ],\n  "endDateTime": "",\n  "eventCancelled": false,\n  "eventDescription": "",\n  "eventName": "",\n  "eventOrganizer": "",\n  "eventType": "",\n  "eventUrl": "",\n  "startDateTime": ""\n}' \
  --output-document \
  - '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId='
import Foundation

let headers = [
  "private-app-legacy": "{{apiKey}}",
  "content-type": "application/json"
]
let parameters = [
  "customProperties": [
    [
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    ]
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "startDateTime": ""
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId?externalAccountId=")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
*/*
RESPONSE BODY text

{
  "category": "VALIDATION_ERROR",
  "correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
  "links": {
    "knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
  },
  "message": "Invalid input (details will vary based on the error)"
}
POST post--marketing-v3-marketing-events-events-delete_archiveBatch
{{baseUrl}}/marketing/v3/marketing-events/events/delete
HEADERS

private-app-legacy
{{apiKey}}
BODY json

{
  "inputs": [
    {
      "appId": 0,
      "externalAccountId": "",
      "externalEventId": ""
    }
  ]
}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/marketing/v3/marketing-events/events/delete");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n  \"inputs\": [\n    {\n      \"appId\": 0,\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\"\n    }\n  ]\n}");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/post "{{baseUrl}}/marketing/v3/marketing-events/events/delete" {:headers {:private-app-legacy "{{apiKey}}"}
                                                                                        :content-type :json
                                                                                        :form-params {:inputs [{:appId 0
                                                                                                                :externalAccountId ""
                                                                                                                :externalEventId ""}]}})
require "http/client"

url = "{{baseUrl}}/marketing/v3/marketing-events/events/delete"
headers = HTTP::Headers{
  "private-app-legacy" => "{{apiKey}}"
  "content-type" => "application/json"
}
reqBody = "{\n  \"inputs\": [\n    {\n      \"appId\": 0,\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\"\n    }\n  ]\n}"

response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Post,
    RequestUri = new Uri("{{baseUrl}}/marketing/v3/marketing-events/events/delete"),
    Headers =
    {
        { "private-app-legacy", "{{apiKey}}" },
    },
    Content = new StringContent("{\n  \"inputs\": [\n    {\n      \"appId\": 0,\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\"\n    }\n  ]\n}")
    {
        Headers =
        {
            ContentType = new MediaTypeHeaderValue("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/marketing/v3/marketing-events/events/delete");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n  \"inputs\": [\n    {\n      \"appId\": 0,\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\"\n    }\n  ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/marketing/v3/marketing-events/events/delete"

	payload := strings.NewReader("{\n  \"inputs\": [\n    {\n      \"appId\": 0,\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("private-app-legacy", "{{apiKey}}")
	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
POST /baseUrl/marketing/v3/marketing-events/events/delete HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 110

{
  "inputs": [
    {
      "appId": 0,
      "externalAccountId": "",
      "externalEventId": ""
    }
  ]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/marketing/v3/marketing-events/events/delete")
  .setHeader("private-app-legacy", "{{apiKey}}")
  .setHeader("content-type", "application/json")
  .setBody("{\n  \"inputs\": [\n    {\n      \"appId\": 0,\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\"\n    }\n  ]\n}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/marketing/v3/marketing-events/events/delete"))
    .header("private-app-legacy", "{{apiKey}}")
    .header("content-type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"inputs\": [\n    {\n      \"appId\": 0,\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\"\n    }\n  ]\n}"))
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"inputs\": [\n    {\n      \"appId\": 0,\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\"\n    }\n  ]\n}");
Request request = new Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events/delete")
  .post(body)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/marketing/v3/marketing-events/events/delete")
  .header("private-app-legacy", "{{apiKey}}")
  .header("content-type", "application/json")
  .body("{\n  \"inputs\": [\n    {\n      \"appId\": 0,\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\"\n    }\n  ]\n}")
  .asString();
const data = JSON.stringify({
  inputs: [
    {
      appId: 0,
      externalAccountId: '',
      externalEventId: ''
    }
  ]
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('POST', '{{baseUrl}}/marketing/v3/marketing-events/events/delete');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/delete',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  data: {inputs: [{appId: 0, externalAccountId: '', externalEventId: ''}]}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/marketing/v3/marketing-events/events/delete';
const options = {
  method: 'POST',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: '{"inputs":[{"appId":0,"externalAccountId":"","externalEventId":""}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/delete',
  method: 'POST',
  headers: {
    'private-app-legacy': '{{apiKey}}',
    'content-type': 'application/json'
  },
  processData: false,
  data: '{\n  "inputs": [\n    {\n      "appId": 0,\n      "externalAccountId": "",\n      "externalEventId": ""\n    }\n  ]\n}'
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n  \"inputs\": [\n    {\n      \"appId\": 0,\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\"\n    }\n  ]\n}")
val request = Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events/delete")
  .post(body)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'POST',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/marketing/v3/marketing-events/events/delete',
  headers: {
    'private-app-legacy': '{{apiKey}}',
    'content-type': 'application/json'
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({inputs: [{appId: 0, externalAccountId: '', externalEventId: ''}]}));
req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/delete',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: {inputs: [{appId: 0, externalAccountId: '', externalEventId: ''}]},
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('POST', '{{baseUrl}}/marketing/v3/marketing-events/events/delete');

req.headers({
  'private-app-legacy': '{{apiKey}}',
  'content-type': 'application/json'
});

req.type('json');
req.send({
  inputs: [
    {
      appId: 0,
      externalAccountId: '',
      externalEventId: ''
    }
  ]
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/delete',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  data: {inputs: [{appId: 0, externalAccountId: '', externalEventId: ''}]}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/marketing/v3/marketing-events/events/delete';
const options = {
  method: 'POST',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: '{"inputs":[{"appId":0,"externalAccountId":"","externalEventId":""}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"inputs": @[ @{ @"appId": @0, @"externalAccountId": @"", @"externalEventId": @"" } ] };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/marketing/v3/marketing-events/events/delete"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/marketing/v3/marketing-events/events/delete" in
let headers = Header.add_list (Header.init ()) [
  ("private-app-legacy", "{{apiKey}}");
  ("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n  \"inputs\": [\n    {\n      \"appId\": 0,\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\"\n    }\n  ]\n}" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/marketing/v3/marketing-events/events/delete",
  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' => [
        [
                'appId' => 0,
                'externalAccountId' => '',
                'externalEventId' => ''
        ]
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "content-type: application/json",
    "private-app-legacy: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('POST', '{{baseUrl}}/marketing/v3/marketing-events/events/delete', [
  'body' => '{
  "inputs": [
    {
      "appId": 0,
      "externalAccountId": "",
      "externalEventId": ""
    }
  ]
}',
  'headers' => [
    'content-type' => 'application/json',
    'private-app-legacy' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/marketing/v3/marketing-events/events/delete');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  'inputs' => [
    [
        'appId' => 0,
        'externalAccountId' => '',
        'externalEventId' => ''
    ]
  ]
]));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  'inputs' => [
    [
        'appId' => 0,
        'externalAccountId' => '',
        'externalEventId' => ''
    ]
  ]
]));
$request->setRequestUrl('{{baseUrl}}/marketing/v3/marketing-events/events/delete');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/marketing/v3/marketing-events/events/delete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "inputs": [
    {
      "appId": 0,
      "externalAccountId": "",
      "externalEventId": ""
    }
  ]
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/marketing/v3/marketing-events/events/delete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "inputs": [
    {
      "appId": 0,
      "externalAccountId": "",
      "externalEventId": ""
    }
  ]
}'
import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\n  \"inputs\": [\n    {\n      \"appId\": 0,\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\"\n    }\n  ]\n}"

headers = {
    'private-app-legacy': "{{apiKey}}",
    'content-type': "application/json"
}

conn.request("POST", "/baseUrl/marketing/v3/marketing-events/events/delete", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/marketing/v3/marketing-events/events/delete"

payload = { "inputs": [
        {
            "appId": 0,
            "externalAccountId": "",
            "externalEventId": ""
        }
    ] }
headers = {
    "private-app-legacy": "{{apiKey}}",
    "content-type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/marketing/v3/marketing-events/events/delete"

payload <- "{\n  \"inputs\": [\n    {\n      \"appId\": 0,\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\"\n    }\n  ]\n}"

encode <- "json"

response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/marketing/v3/marketing-events/events/delete")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n  \"inputs\": [\n    {\n      \"appId\": 0,\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
  headers: {'Content-Type' => 'application/json'}
)

response = conn.post('/baseUrl/marketing/v3/marketing-events/events/delete') do |req|
  req.headers['private-app-legacy'] = '{{apiKey}}'
  req.body = "{\n  \"inputs\": [\n    {\n      \"appId\": 0,\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\"\n    }\n  ]\n}"
end

puts response.status
puts response.body
use serde_json::json;
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/marketing/v3/marketing-events/events/delete";

    let payload = json!({"inputs": (
            json!({
                "appId": 0,
                "externalAccountId": "",
                "externalEventId": ""
            })
        )});

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
    headers.insert("content-type", "application/json".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.post(url)
        .headers(headers)
        .json(&payload)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request POST \
  --url {{baseUrl}}/marketing/v3/marketing-events/events/delete \
  --header 'content-type: application/json' \
  --header 'private-app-legacy: {{apiKey}}' \
  --data '{
  "inputs": [
    {
      "appId": 0,
      "externalAccountId": "",
      "externalEventId": ""
    }
  ]
}'
echo '{
  "inputs": [
    {
      "appId": 0,
      "externalAccountId": "",
      "externalEventId": ""
    }
  ]
}' |  \
  http POST {{baseUrl}}/marketing/v3/marketing-events/events/delete \
  content-type:application/json \
  private-app-legacy:'{{apiKey}}'
wget --quiet \
  --method POST \
  --header 'private-app-legacy: {{apiKey}}' \
  --header 'content-type: application/json' \
  --body-data '{\n  "inputs": [\n    {\n      "appId": 0,\n      "externalAccountId": "",\n      "externalEventId": ""\n    }\n  ]\n}' \
  --output-document \
  - {{baseUrl}}/marketing/v3/marketing-events/events/delete
import Foundation

let headers = [
  "private-app-legacy": "{{apiKey}}",
  "content-type": "application/json"
]
let parameters = ["inputs": [
    [
      "appId": 0,
      "externalAccountId": "",
      "externalEventId": ""
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/marketing/v3/marketing-events/events/delete")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
*/*
RESPONSE BODY text

{
  "category": "VALIDATION_ERROR",
  "correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
  "links": {
    "knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
  },
  "message": "Invalid input (details will vary based on the error)"
}
POST post--marketing-v3-marketing-events-events-upsert_doUpsert
{{baseUrl}}/marketing/v3/marketing-events/events/upsert
HEADERS

private-app-legacy
{{apiKey}}
BODY json

{
  "inputs": [
    {
      "customProperties": [
        {
          "name": "",
          "persistenceTimestamp": 0,
          "requestId": "",
          "selectedByUser": false,
          "selectedByUserTimestamp": 0,
          "source": "",
          "sourceId": "",
          "sourceLabel": "",
          "sourceMetadata": "",
          "sourceVid": [],
          "timestamp": 0,
          "updatedByUserId": 0,
          "useTimestampAsPersistenceTimestamp": false,
          "value": ""
        }
      ],
      "endDateTime": "",
      "eventCancelled": false,
      "eventDescription": "",
      "eventName": "",
      "eventOrganizer": "",
      "eventType": "",
      "eventUrl": "",
      "externalAccountId": "",
      "externalEventId": "",
      "startDateTime": ""
    }
  ]
}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/marketing/v3/marketing-events/events/upsert");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n  \"inputs\": [\n    {\n      \"customProperties\": [\n        {\n          \"name\": \"\",\n          \"persistenceTimestamp\": 0,\n          \"requestId\": \"\",\n          \"selectedByUser\": false,\n          \"selectedByUserTimestamp\": 0,\n          \"source\": \"\",\n          \"sourceId\": \"\",\n          \"sourceLabel\": \"\",\n          \"sourceMetadata\": \"\",\n          \"sourceVid\": [],\n          \"timestamp\": 0,\n          \"updatedByUserId\": 0,\n          \"useTimestampAsPersistenceTimestamp\": false,\n          \"value\": \"\"\n        }\n      ],\n      \"endDateTime\": \"\",\n      \"eventCancelled\": false,\n      \"eventDescription\": \"\",\n      \"eventName\": \"\",\n      \"eventOrganizer\": \"\",\n      \"eventType\": \"\",\n      \"eventUrl\": \"\",\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\",\n      \"startDateTime\": \"\"\n    }\n  ]\n}");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/post "{{baseUrl}}/marketing/v3/marketing-events/events/upsert" {:headers {:private-app-legacy "{{apiKey}}"}
                                                                                        :content-type :json
                                                                                        :form-params {:inputs [{:customProperties [{:name ""
                                                                                                                                    :persistenceTimestamp 0
                                                                                                                                    :requestId ""
                                                                                                                                    :selectedByUser false
                                                                                                                                    :selectedByUserTimestamp 0
                                                                                                                                    :source ""
                                                                                                                                    :sourceId ""
                                                                                                                                    :sourceLabel ""
                                                                                                                                    :sourceMetadata ""
                                                                                                                                    :sourceVid []
                                                                                                                                    :timestamp 0
                                                                                                                                    :updatedByUserId 0
                                                                                                                                    :useTimestampAsPersistenceTimestamp false
                                                                                                                                    :value ""}]
                                                                                                                :endDateTime ""
                                                                                                                :eventCancelled false
                                                                                                                :eventDescription ""
                                                                                                                :eventName ""
                                                                                                                :eventOrganizer ""
                                                                                                                :eventType ""
                                                                                                                :eventUrl ""
                                                                                                                :externalAccountId ""
                                                                                                                :externalEventId ""
                                                                                                                :startDateTime ""}]}})
require "http/client"

url = "{{baseUrl}}/marketing/v3/marketing-events/events/upsert"
headers = HTTP::Headers{
  "private-app-legacy" => "{{apiKey}}"
  "content-type" => "application/json"
}
reqBody = "{\n  \"inputs\": [\n    {\n      \"customProperties\": [\n        {\n          \"name\": \"\",\n          \"persistenceTimestamp\": 0,\n          \"requestId\": \"\",\n          \"selectedByUser\": false,\n          \"selectedByUserTimestamp\": 0,\n          \"source\": \"\",\n          \"sourceId\": \"\",\n          \"sourceLabel\": \"\",\n          \"sourceMetadata\": \"\",\n          \"sourceVid\": [],\n          \"timestamp\": 0,\n          \"updatedByUserId\": 0,\n          \"useTimestampAsPersistenceTimestamp\": false,\n          \"value\": \"\"\n        }\n      ],\n      \"endDateTime\": \"\",\n      \"eventCancelled\": false,\n      \"eventDescription\": \"\",\n      \"eventName\": \"\",\n      \"eventOrganizer\": \"\",\n      \"eventType\": \"\",\n      \"eventUrl\": \"\",\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\",\n      \"startDateTime\": \"\"\n    }\n  ]\n}"

response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Post,
    RequestUri = new Uri("{{baseUrl}}/marketing/v3/marketing-events/events/upsert"),
    Headers =
    {
        { "private-app-legacy", "{{apiKey}}" },
    },
    Content = new StringContent("{\n  \"inputs\": [\n    {\n      \"customProperties\": [\n        {\n          \"name\": \"\",\n          \"persistenceTimestamp\": 0,\n          \"requestId\": \"\",\n          \"selectedByUser\": false,\n          \"selectedByUserTimestamp\": 0,\n          \"source\": \"\",\n          \"sourceId\": \"\",\n          \"sourceLabel\": \"\",\n          \"sourceMetadata\": \"\",\n          \"sourceVid\": [],\n          \"timestamp\": 0,\n          \"updatedByUserId\": 0,\n          \"useTimestampAsPersistenceTimestamp\": false,\n          \"value\": \"\"\n        }\n      ],\n      \"endDateTime\": \"\",\n      \"eventCancelled\": false,\n      \"eventDescription\": \"\",\n      \"eventName\": \"\",\n      \"eventOrganizer\": \"\",\n      \"eventType\": \"\",\n      \"eventUrl\": \"\",\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\",\n      \"startDateTime\": \"\"\n    }\n  ]\n}")
    {
        Headers =
        {
            ContentType = new MediaTypeHeaderValue("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/marketing/v3/marketing-events/events/upsert");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n  \"inputs\": [\n    {\n      \"customProperties\": [\n        {\n          \"name\": \"\",\n          \"persistenceTimestamp\": 0,\n          \"requestId\": \"\",\n          \"selectedByUser\": false,\n          \"selectedByUserTimestamp\": 0,\n          \"source\": \"\",\n          \"sourceId\": \"\",\n          \"sourceLabel\": \"\",\n          \"sourceMetadata\": \"\",\n          \"sourceVid\": [],\n          \"timestamp\": 0,\n          \"updatedByUserId\": 0,\n          \"useTimestampAsPersistenceTimestamp\": false,\n          \"value\": \"\"\n        }\n      ],\n      \"endDateTime\": \"\",\n      \"eventCancelled\": false,\n      \"eventDescription\": \"\",\n      \"eventName\": \"\",\n      \"eventOrganizer\": \"\",\n      \"eventType\": \"\",\n      \"eventUrl\": \"\",\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\",\n      \"startDateTime\": \"\"\n    }\n  ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/marketing/v3/marketing-events/events/upsert"

	payload := strings.NewReader("{\n  \"inputs\": [\n    {\n      \"customProperties\": [\n        {\n          \"name\": \"\",\n          \"persistenceTimestamp\": 0,\n          \"requestId\": \"\",\n          \"selectedByUser\": false,\n          \"selectedByUserTimestamp\": 0,\n          \"source\": \"\",\n          \"sourceId\": \"\",\n          \"sourceLabel\": \"\",\n          \"sourceMetadata\": \"\",\n          \"sourceVid\": [],\n          \"timestamp\": 0,\n          \"updatedByUserId\": 0,\n          \"useTimestampAsPersistenceTimestamp\": false,\n          \"value\": \"\"\n        }\n      ],\n      \"endDateTime\": \"\",\n      \"eventCancelled\": false,\n      \"eventDescription\": \"\",\n      \"eventName\": \"\",\n      \"eventOrganizer\": \"\",\n      \"eventType\": \"\",\n      \"eventUrl\": \"\",\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\",\n      \"startDateTime\": \"\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("private-app-legacy", "{{apiKey}}")
	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
POST /baseUrl/marketing/v3/marketing-events/events/upsert HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 792

{
  "inputs": [
    {
      "customProperties": [
        {
          "name": "",
          "persistenceTimestamp": 0,
          "requestId": "",
          "selectedByUser": false,
          "selectedByUserTimestamp": 0,
          "source": "",
          "sourceId": "",
          "sourceLabel": "",
          "sourceMetadata": "",
          "sourceVid": [],
          "timestamp": 0,
          "updatedByUserId": 0,
          "useTimestampAsPersistenceTimestamp": false,
          "value": ""
        }
      ],
      "endDateTime": "",
      "eventCancelled": false,
      "eventDescription": "",
      "eventName": "",
      "eventOrganizer": "",
      "eventType": "",
      "eventUrl": "",
      "externalAccountId": "",
      "externalEventId": "",
      "startDateTime": ""
    }
  ]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/marketing/v3/marketing-events/events/upsert")
  .setHeader("private-app-legacy", "{{apiKey}}")
  .setHeader("content-type", "application/json")
  .setBody("{\n  \"inputs\": [\n    {\n      \"customProperties\": [\n        {\n          \"name\": \"\",\n          \"persistenceTimestamp\": 0,\n          \"requestId\": \"\",\n          \"selectedByUser\": false,\n          \"selectedByUserTimestamp\": 0,\n          \"source\": \"\",\n          \"sourceId\": \"\",\n          \"sourceLabel\": \"\",\n          \"sourceMetadata\": \"\",\n          \"sourceVid\": [],\n          \"timestamp\": 0,\n          \"updatedByUserId\": 0,\n          \"useTimestampAsPersistenceTimestamp\": false,\n          \"value\": \"\"\n        }\n      ],\n      \"endDateTime\": \"\",\n      \"eventCancelled\": false,\n      \"eventDescription\": \"\",\n      \"eventName\": \"\",\n      \"eventOrganizer\": \"\",\n      \"eventType\": \"\",\n      \"eventUrl\": \"\",\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\",\n      \"startDateTime\": \"\"\n    }\n  ]\n}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/marketing/v3/marketing-events/events/upsert"))
    .header("private-app-legacy", "{{apiKey}}")
    .header("content-type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"inputs\": [\n    {\n      \"customProperties\": [\n        {\n          \"name\": \"\",\n          \"persistenceTimestamp\": 0,\n          \"requestId\": \"\",\n          \"selectedByUser\": false,\n          \"selectedByUserTimestamp\": 0,\n          \"source\": \"\",\n          \"sourceId\": \"\",\n          \"sourceLabel\": \"\",\n          \"sourceMetadata\": \"\",\n          \"sourceVid\": [],\n          \"timestamp\": 0,\n          \"updatedByUserId\": 0,\n          \"useTimestampAsPersistenceTimestamp\": false,\n          \"value\": \"\"\n        }\n      ],\n      \"endDateTime\": \"\",\n      \"eventCancelled\": false,\n      \"eventDescription\": \"\",\n      \"eventName\": \"\",\n      \"eventOrganizer\": \"\",\n      \"eventType\": \"\",\n      \"eventUrl\": \"\",\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\",\n      \"startDateTime\": \"\"\n    }\n  ]\n}"))
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"inputs\": [\n    {\n      \"customProperties\": [\n        {\n          \"name\": \"\",\n          \"persistenceTimestamp\": 0,\n          \"requestId\": \"\",\n          \"selectedByUser\": false,\n          \"selectedByUserTimestamp\": 0,\n          \"source\": \"\",\n          \"sourceId\": \"\",\n          \"sourceLabel\": \"\",\n          \"sourceMetadata\": \"\",\n          \"sourceVid\": [],\n          \"timestamp\": 0,\n          \"updatedByUserId\": 0,\n          \"useTimestampAsPersistenceTimestamp\": false,\n          \"value\": \"\"\n        }\n      ],\n      \"endDateTime\": \"\",\n      \"eventCancelled\": false,\n      \"eventDescription\": \"\",\n      \"eventName\": \"\",\n      \"eventOrganizer\": \"\",\n      \"eventType\": \"\",\n      \"eventUrl\": \"\",\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\",\n      \"startDateTime\": \"\"\n    }\n  ]\n}");
Request request = new Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events/upsert")
  .post(body)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/marketing/v3/marketing-events/events/upsert")
  .header("private-app-legacy", "{{apiKey}}")
  .header("content-type", "application/json")
  .body("{\n  \"inputs\": [\n    {\n      \"customProperties\": [\n        {\n          \"name\": \"\",\n          \"persistenceTimestamp\": 0,\n          \"requestId\": \"\",\n          \"selectedByUser\": false,\n          \"selectedByUserTimestamp\": 0,\n          \"source\": \"\",\n          \"sourceId\": \"\",\n          \"sourceLabel\": \"\",\n          \"sourceMetadata\": \"\",\n          \"sourceVid\": [],\n          \"timestamp\": 0,\n          \"updatedByUserId\": 0,\n          \"useTimestampAsPersistenceTimestamp\": false,\n          \"value\": \"\"\n        }\n      ],\n      \"endDateTime\": \"\",\n      \"eventCancelled\": false,\n      \"eventDescription\": \"\",\n      \"eventName\": \"\",\n      \"eventOrganizer\": \"\",\n      \"eventType\": \"\",\n      \"eventUrl\": \"\",\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\",\n      \"startDateTime\": \"\"\n    }\n  ]\n}")
  .asString();
const data = JSON.stringify({
  inputs: [
    {
      customProperties: [
        {
          name: '',
          persistenceTimestamp: 0,
          requestId: '',
          selectedByUser: false,
          selectedByUserTimestamp: 0,
          source: '',
          sourceId: '',
          sourceLabel: '',
          sourceMetadata: '',
          sourceVid: [],
          timestamp: 0,
          updatedByUserId: 0,
          useTimestampAsPersistenceTimestamp: false,
          value: ''
        }
      ],
      endDateTime: '',
      eventCancelled: false,
      eventDescription: '',
      eventName: '',
      eventOrganizer: '',
      eventType: '',
      eventUrl: '',
      externalAccountId: '',
      externalEventId: '',
      startDateTime: ''
    }
  ]
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('POST', '{{baseUrl}}/marketing/v3/marketing-events/events/upsert');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/upsert',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  data: {
    inputs: [
      {
        customProperties: [
          {
            name: '',
            persistenceTimestamp: 0,
            requestId: '',
            selectedByUser: false,
            selectedByUserTimestamp: 0,
            source: '',
            sourceId: '',
            sourceLabel: '',
            sourceMetadata: '',
            sourceVid: [],
            timestamp: 0,
            updatedByUserId: 0,
            useTimestampAsPersistenceTimestamp: false,
            value: ''
          }
        ],
        endDateTime: '',
        eventCancelled: false,
        eventDescription: '',
        eventName: '',
        eventOrganizer: '',
        eventType: '',
        eventUrl: '',
        externalAccountId: '',
        externalEventId: '',
        startDateTime: ''
      }
    ]
  }
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/marketing/v3/marketing-events/events/upsert';
const options = {
  method: 'POST',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: '{"inputs":[{"customProperties":[{"name":"","persistenceTimestamp":0,"requestId":"","selectedByUser":false,"selectedByUserTimestamp":0,"source":"","sourceId":"","sourceLabel":"","sourceMetadata":"","sourceVid":[],"timestamp":0,"updatedByUserId":0,"useTimestampAsPersistenceTimestamp":false,"value":""}],"endDateTime":"","eventCancelled":false,"eventDescription":"","eventName":"","eventOrganizer":"","eventType":"","eventUrl":"","externalAccountId":"","externalEventId":"","startDateTime":""}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/upsert',
  method: 'POST',
  headers: {
    'private-app-legacy': '{{apiKey}}',
    'content-type': 'application/json'
  },
  processData: false,
  data: '{\n  "inputs": [\n    {\n      "customProperties": [\n        {\n          "name": "",\n          "persistenceTimestamp": 0,\n          "requestId": "",\n          "selectedByUser": false,\n          "selectedByUserTimestamp": 0,\n          "source": "",\n          "sourceId": "",\n          "sourceLabel": "",\n          "sourceMetadata": "",\n          "sourceVid": [],\n          "timestamp": 0,\n          "updatedByUserId": 0,\n          "useTimestampAsPersistenceTimestamp": false,\n          "value": ""\n        }\n      ],\n      "endDateTime": "",\n      "eventCancelled": false,\n      "eventDescription": "",\n      "eventName": "",\n      "eventOrganizer": "",\n      "eventType": "",\n      "eventUrl": "",\n      "externalAccountId": "",\n      "externalEventId": "",\n      "startDateTime": ""\n    }\n  ]\n}'
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n  \"inputs\": [\n    {\n      \"customProperties\": [\n        {\n          \"name\": \"\",\n          \"persistenceTimestamp\": 0,\n          \"requestId\": \"\",\n          \"selectedByUser\": false,\n          \"selectedByUserTimestamp\": 0,\n          \"source\": \"\",\n          \"sourceId\": \"\",\n          \"sourceLabel\": \"\",\n          \"sourceMetadata\": \"\",\n          \"sourceVid\": [],\n          \"timestamp\": 0,\n          \"updatedByUserId\": 0,\n          \"useTimestampAsPersistenceTimestamp\": false,\n          \"value\": \"\"\n        }\n      ],\n      \"endDateTime\": \"\",\n      \"eventCancelled\": false,\n      \"eventDescription\": \"\",\n      \"eventName\": \"\",\n      \"eventOrganizer\": \"\",\n      \"eventType\": \"\",\n      \"eventUrl\": \"\",\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\",\n      \"startDateTime\": \"\"\n    }\n  ]\n}")
val request = Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events/upsert")
  .post(body)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'POST',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/marketing/v3/marketing-events/events/upsert',
  headers: {
    'private-app-legacy': '{{apiKey}}',
    'content-type': 'application/json'
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({
  inputs: [
    {
      customProperties: [
        {
          name: '',
          persistenceTimestamp: 0,
          requestId: '',
          selectedByUser: false,
          selectedByUserTimestamp: 0,
          source: '',
          sourceId: '',
          sourceLabel: '',
          sourceMetadata: '',
          sourceVid: [],
          timestamp: 0,
          updatedByUserId: 0,
          useTimestampAsPersistenceTimestamp: false,
          value: ''
        }
      ],
      endDateTime: '',
      eventCancelled: false,
      eventDescription: '',
      eventName: '',
      eventOrganizer: '',
      eventType: '',
      eventUrl: '',
      externalAccountId: '',
      externalEventId: '',
      startDateTime: ''
    }
  ]
}));
req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/upsert',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: {
    inputs: [
      {
        customProperties: [
          {
            name: '',
            persistenceTimestamp: 0,
            requestId: '',
            selectedByUser: false,
            selectedByUserTimestamp: 0,
            source: '',
            sourceId: '',
            sourceLabel: '',
            sourceMetadata: '',
            sourceVid: [],
            timestamp: 0,
            updatedByUserId: 0,
            useTimestampAsPersistenceTimestamp: false,
            value: ''
          }
        ],
        endDateTime: '',
        eventCancelled: false,
        eventDescription: '',
        eventName: '',
        eventOrganizer: '',
        eventType: '',
        eventUrl: '',
        externalAccountId: '',
        externalEventId: '',
        startDateTime: ''
      }
    ]
  },
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('POST', '{{baseUrl}}/marketing/v3/marketing-events/events/upsert');

req.headers({
  'private-app-legacy': '{{apiKey}}',
  'content-type': 'application/json'
});

req.type('json');
req.send({
  inputs: [
    {
      customProperties: [
        {
          name: '',
          persistenceTimestamp: 0,
          requestId: '',
          selectedByUser: false,
          selectedByUserTimestamp: 0,
          source: '',
          sourceId: '',
          sourceLabel: '',
          sourceMetadata: '',
          sourceVid: [],
          timestamp: 0,
          updatedByUserId: 0,
          useTimestampAsPersistenceTimestamp: false,
          value: ''
        }
      ],
      endDateTime: '',
      eventCancelled: false,
      eventDescription: '',
      eventName: '',
      eventOrganizer: '',
      eventType: '',
      eventUrl: '',
      externalAccountId: '',
      externalEventId: '',
      startDateTime: ''
    }
  ]
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/upsert',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  data: {
    inputs: [
      {
        customProperties: [
          {
            name: '',
            persistenceTimestamp: 0,
            requestId: '',
            selectedByUser: false,
            selectedByUserTimestamp: 0,
            source: '',
            sourceId: '',
            sourceLabel: '',
            sourceMetadata: '',
            sourceVid: [],
            timestamp: 0,
            updatedByUserId: 0,
            useTimestampAsPersistenceTimestamp: false,
            value: ''
          }
        ],
        endDateTime: '',
        eventCancelled: false,
        eventDescription: '',
        eventName: '',
        eventOrganizer: '',
        eventType: '',
        eventUrl: '',
        externalAccountId: '',
        externalEventId: '',
        startDateTime: ''
      }
    ]
  }
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/marketing/v3/marketing-events/events/upsert';
const options = {
  method: 'POST',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: '{"inputs":[{"customProperties":[{"name":"","persistenceTimestamp":0,"requestId":"","selectedByUser":false,"selectedByUserTimestamp":0,"source":"","sourceId":"","sourceLabel":"","sourceMetadata":"","sourceVid":[],"timestamp":0,"updatedByUserId":0,"useTimestampAsPersistenceTimestamp":false,"value":""}],"endDateTime":"","eventCancelled":false,"eventDescription":"","eventName":"","eventOrganizer":"","eventType":"","eventUrl":"","externalAccountId":"","externalEventId":"","startDateTime":""}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"inputs": @[ @{ @"customProperties": @[ @{ @"name": @"", @"persistenceTimestamp": @0, @"requestId": @"", @"selectedByUser": @NO, @"selectedByUserTimestamp": @0, @"source": @"", @"sourceId": @"", @"sourceLabel": @"", @"sourceMetadata": @"", @"sourceVid": @[  ], @"timestamp": @0, @"updatedByUserId": @0, @"useTimestampAsPersistenceTimestamp": @NO, @"value": @"" } ], @"endDateTime": @"", @"eventCancelled": @NO, @"eventDescription": @"", @"eventName": @"", @"eventOrganizer": @"", @"eventType": @"", @"eventUrl": @"", @"externalAccountId": @"", @"externalEventId": @"", @"startDateTime": @"" } ] };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/marketing/v3/marketing-events/events/upsert"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/marketing/v3/marketing-events/events/upsert" in
let headers = Header.add_list (Header.init ()) [
  ("private-app-legacy", "{{apiKey}}");
  ("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n  \"inputs\": [\n    {\n      \"customProperties\": [\n        {\n          \"name\": \"\",\n          \"persistenceTimestamp\": 0,\n          \"requestId\": \"\",\n          \"selectedByUser\": false,\n          \"selectedByUserTimestamp\": 0,\n          \"source\": \"\",\n          \"sourceId\": \"\",\n          \"sourceLabel\": \"\",\n          \"sourceMetadata\": \"\",\n          \"sourceVid\": [],\n          \"timestamp\": 0,\n          \"updatedByUserId\": 0,\n          \"useTimestampAsPersistenceTimestamp\": false,\n          \"value\": \"\"\n        }\n      ],\n      \"endDateTime\": \"\",\n      \"eventCancelled\": false,\n      \"eventDescription\": \"\",\n      \"eventName\": \"\",\n      \"eventOrganizer\": \"\",\n      \"eventType\": \"\",\n      \"eventUrl\": \"\",\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\",\n      \"startDateTime\": \"\"\n    }\n  ]\n}" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/marketing/v3/marketing-events/events/upsert",
  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' => [
        [
                'customProperties' => [
                                [
                                                                'name' => '',
                                                                'persistenceTimestamp' => 0,
                                                                'requestId' => '',
                                                                'selectedByUser' => null,
                                                                'selectedByUserTimestamp' => 0,
                                                                'source' => '',
                                                                'sourceId' => '',
                                                                'sourceLabel' => '',
                                                                'sourceMetadata' => '',
                                                                'sourceVid' => [
                                                                                                                                
                                                                ],
                                                                'timestamp' => 0,
                                                                'updatedByUserId' => 0,
                                                                'useTimestampAsPersistenceTimestamp' => null,
                                                                'value' => ''
                                ]
                ],
                'endDateTime' => '',
                'eventCancelled' => null,
                'eventDescription' => '',
                'eventName' => '',
                'eventOrganizer' => '',
                'eventType' => '',
                'eventUrl' => '',
                'externalAccountId' => '',
                'externalEventId' => '',
                'startDateTime' => ''
        ]
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "content-type: application/json",
    "private-app-legacy: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('POST', '{{baseUrl}}/marketing/v3/marketing-events/events/upsert', [
  'body' => '{
  "inputs": [
    {
      "customProperties": [
        {
          "name": "",
          "persistenceTimestamp": 0,
          "requestId": "",
          "selectedByUser": false,
          "selectedByUserTimestamp": 0,
          "source": "",
          "sourceId": "",
          "sourceLabel": "",
          "sourceMetadata": "",
          "sourceVid": [],
          "timestamp": 0,
          "updatedByUserId": 0,
          "useTimestampAsPersistenceTimestamp": false,
          "value": ""
        }
      ],
      "endDateTime": "",
      "eventCancelled": false,
      "eventDescription": "",
      "eventName": "",
      "eventOrganizer": "",
      "eventType": "",
      "eventUrl": "",
      "externalAccountId": "",
      "externalEventId": "",
      "startDateTime": ""
    }
  ]
}',
  'headers' => [
    'content-type' => 'application/json',
    'private-app-legacy' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/marketing/v3/marketing-events/events/upsert');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  'inputs' => [
    [
        'customProperties' => [
                [
                                'name' => '',
                                'persistenceTimestamp' => 0,
                                'requestId' => '',
                                'selectedByUser' => null,
                                'selectedByUserTimestamp' => 0,
                                'source' => '',
                                'sourceId' => '',
                                'sourceLabel' => '',
                                'sourceMetadata' => '',
                                'sourceVid' => [
                                                                
                                ],
                                'timestamp' => 0,
                                'updatedByUserId' => 0,
                                'useTimestampAsPersistenceTimestamp' => null,
                                'value' => ''
                ]
        ],
        'endDateTime' => '',
        'eventCancelled' => null,
        'eventDescription' => '',
        'eventName' => '',
        'eventOrganizer' => '',
        'eventType' => '',
        'eventUrl' => '',
        'externalAccountId' => '',
        'externalEventId' => '',
        'startDateTime' => ''
    ]
  ]
]));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  'inputs' => [
    [
        'customProperties' => [
                [
                                'name' => '',
                                'persistenceTimestamp' => 0,
                                'requestId' => '',
                                'selectedByUser' => null,
                                'selectedByUserTimestamp' => 0,
                                'source' => '',
                                'sourceId' => '',
                                'sourceLabel' => '',
                                'sourceMetadata' => '',
                                'sourceVid' => [
                                                                
                                ],
                                'timestamp' => 0,
                                'updatedByUserId' => 0,
                                'useTimestampAsPersistenceTimestamp' => null,
                                'value' => ''
                ]
        ],
        'endDateTime' => '',
        'eventCancelled' => null,
        'eventDescription' => '',
        'eventName' => '',
        'eventOrganizer' => '',
        'eventType' => '',
        'eventUrl' => '',
        'externalAccountId' => '',
        'externalEventId' => '',
        'startDateTime' => ''
    ]
  ]
]));
$request->setRequestUrl('{{baseUrl}}/marketing/v3/marketing-events/events/upsert');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/marketing/v3/marketing-events/events/upsert' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "inputs": [
    {
      "customProperties": [
        {
          "name": "",
          "persistenceTimestamp": 0,
          "requestId": "",
          "selectedByUser": false,
          "selectedByUserTimestamp": 0,
          "source": "",
          "sourceId": "",
          "sourceLabel": "",
          "sourceMetadata": "",
          "sourceVid": [],
          "timestamp": 0,
          "updatedByUserId": 0,
          "useTimestampAsPersistenceTimestamp": false,
          "value": ""
        }
      ],
      "endDateTime": "",
      "eventCancelled": false,
      "eventDescription": "",
      "eventName": "",
      "eventOrganizer": "",
      "eventType": "",
      "eventUrl": "",
      "externalAccountId": "",
      "externalEventId": "",
      "startDateTime": ""
    }
  ]
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/marketing/v3/marketing-events/events/upsert' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "inputs": [
    {
      "customProperties": [
        {
          "name": "",
          "persistenceTimestamp": 0,
          "requestId": "",
          "selectedByUser": false,
          "selectedByUserTimestamp": 0,
          "source": "",
          "sourceId": "",
          "sourceLabel": "",
          "sourceMetadata": "",
          "sourceVid": [],
          "timestamp": 0,
          "updatedByUserId": 0,
          "useTimestampAsPersistenceTimestamp": false,
          "value": ""
        }
      ],
      "endDateTime": "",
      "eventCancelled": false,
      "eventDescription": "",
      "eventName": "",
      "eventOrganizer": "",
      "eventType": "",
      "eventUrl": "",
      "externalAccountId": "",
      "externalEventId": "",
      "startDateTime": ""
    }
  ]
}'
import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\n  \"inputs\": [\n    {\n      \"customProperties\": [\n        {\n          \"name\": \"\",\n          \"persistenceTimestamp\": 0,\n          \"requestId\": \"\",\n          \"selectedByUser\": false,\n          \"selectedByUserTimestamp\": 0,\n          \"source\": \"\",\n          \"sourceId\": \"\",\n          \"sourceLabel\": \"\",\n          \"sourceMetadata\": \"\",\n          \"sourceVid\": [],\n          \"timestamp\": 0,\n          \"updatedByUserId\": 0,\n          \"useTimestampAsPersistenceTimestamp\": false,\n          \"value\": \"\"\n        }\n      ],\n      \"endDateTime\": \"\",\n      \"eventCancelled\": false,\n      \"eventDescription\": \"\",\n      \"eventName\": \"\",\n      \"eventOrganizer\": \"\",\n      \"eventType\": \"\",\n      \"eventUrl\": \"\",\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\",\n      \"startDateTime\": \"\"\n    }\n  ]\n}"

headers = {
    'private-app-legacy': "{{apiKey}}",
    'content-type': "application/json"
}

conn.request("POST", "/baseUrl/marketing/v3/marketing-events/events/upsert", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/marketing/v3/marketing-events/events/upsert"

payload = { "inputs": [
        {
            "customProperties": [
                {
                    "name": "",
                    "persistenceTimestamp": 0,
                    "requestId": "",
                    "selectedByUser": False,
                    "selectedByUserTimestamp": 0,
                    "source": "",
                    "sourceId": "",
                    "sourceLabel": "",
                    "sourceMetadata": "",
                    "sourceVid": [],
                    "timestamp": 0,
                    "updatedByUserId": 0,
                    "useTimestampAsPersistenceTimestamp": False,
                    "value": ""
                }
            ],
            "endDateTime": "",
            "eventCancelled": False,
            "eventDescription": "",
            "eventName": "",
            "eventOrganizer": "",
            "eventType": "",
            "eventUrl": "",
            "externalAccountId": "",
            "externalEventId": "",
            "startDateTime": ""
        }
    ] }
headers = {
    "private-app-legacy": "{{apiKey}}",
    "content-type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/marketing/v3/marketing-events/events/upsert"

payload <- "{\n  \"inputs\": [\n    {\n      \"customProperties\": [\n        {\n          \"name\": \"\",\n          \"persistenceTimestamp\": 0,\n          \"requestId\": \"\",\n          \"selectedByUser\": false,\n          \"selectedByUserTimestamp\": 0,\n          \"source\": \"\",\n          \"sourceId\": \"\",\n          \"sourceLabel\": \"\",\n          \"sourceMetadata\": \"\",\n          \"sourceVid\": [],\n          \"timestamp\": 0,\n          \"updatedByUserId\": 0,\n          \"useTimestampAsPersistenceTimestamp\": false,\n          \"value\": \"\"\n        }\n      ],\n      \"endDateTime\": \"\",\n      \"eventCancelled\": false,\n      \"eventDescription\": \"\",\n      \"eventName\": \"\",\n      \"eventOrganizer\": \"\",\n      \"eventType\": \"\",\n      \"eventUrl\": \"\",\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\",\n      \"startDateTime\": \"\"\n    }\n  ]\n}"

encode <- "json"

response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/marketing/v3/marketing-events/events/upsert")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n  \"inputs\": [\n    {\n      \"customProperties\": [\n        {\n          \"name\": \"\",\n          \"persistenceTimestamp\": 0,\n          \"requestId\": \"\",\n          \"selectedByUser\": false,\n          \"selectedByUserTimestamp\": 0,\n          \"source\": \"\",\n          \"sourceId\": \"\",\n          \"sourceLabel\": \"\",\n          \"sourceMetadata\": \"\",\n          \"sourceVid\": [],\n          \"timestamp\": 0,\n          \"updatedByUserId\": 0,\n          \"useTimestampAsPersistenceTimestamp\": false,\n          \"value\": \"\"\n        }\n      ],\n      \"endDateTime\": \"\",\n      \"eventCancelled\": false,\n      \"eventDescription\": \"\",\n      \"eventName\": \"\",\n      \"eventOrganizer\": \"\",\n      \"eventType\": \"\",\n      \"eventUrl\": \"\",\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\",\n      \"startDateTime\": \"\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
  headers: {'Content-Type' => 'application/json'}
)

response = conn.post('/baseUrl/marketing/v3/marketing-events/events/upsert') do |req|
  req.headers['private-app-legacy'] = '{{apiKey}}'
  req.body = "{\n  \"inputs\": [\n    {\n      \"customProperties\": [\n        {\n          \"name\": \"\",\n          \"persistenceTimestamp\": 0,\n          \"requestId\": \"\",\n          \"selectedByUser\": false,\n          \"selectedByUserTimestamp\": 0,\n          \"source\": \"\",\n          \"sourceId\": \"\",\n          \"sourceLabel\": \"\",\n          \"sourceMetadata\": \"\",\n          \"sourceVid\": [],\n          \"timestamp\": 0,\n          \"updatedByUserId\": 0,\n          \"useTimestampAsPersistenceTimestamp\": false,\n          \"value\": \"\"\n        }\n      ],\n      \"endDateTime\": \"\",\n      \"eventCancelled\": false,\n      \"eventDescription\": \"\",\n      \"eventName\": \"\",\n      \"eventOrganizer\": \"\",\n      \"eventType\": \"\",\n      \"eventUrl\": \"\",\n      \"externalAccountId\": \"\",\n      \"externalEventId\": \"\",\n      \"startDateTime\": \"\"\n    }\n  ]\n}"
end

puts response.status
puts response.body
use serde_json::json;
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/marketing/v3/marketing-events/events/upsert";

    let payload = json!({"inputs": (
            json!({
                "customProperties": (
                    json!({
                        "name": "",
                        "persistenceTimestamp": 0,
                        "requestId": "",
                        "selectedByUser": false,
                        "selectedByUserTimestamp": 0,
                        "source": "",
                        "sourceId": "",
                        "sourceLabel": "",
                        "sourceMetadata": "",
                        "sourceVid": (),
                        "timestamp": 0,
                        "updatedByUserId": 0,
                        "useTimestampAsPersistenceTimestamp": false,
                        "value": ""
                    })
                ),
                "endDateTime": "",
                "eventCancelled": false,
                "eventDescription": "",
                "eventName": "",
                "eventOrganizer": "",
                "eventType": "",
                "eventUrl": "",
                "externalAccountId": "",
                "externalEventId": "",
                "startDateTime": ""
            })
        )});

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
    headers.insert("content-type", "application/json".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.post(url)
        .headers(headers)
        .json(&payload)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request POST \
  --url {{baseUrl}}/marketing/v3/marketing-events/events/upsert \
  --header 'content-type: application/json' \
  --header 'private-app-legacy: {{apiKey}}' \
  --data '{
  "inputs": [
    {
      "customProperties": [
        {
          "name": "",
          "persistenceTimestamp": 0,
          "requestId": "",
          "selectedByUser": false,
          "selectedByUserTimestamp": 0,
          "source": "",
          "sourceId": "",
          "sourceLabel": "",
          "sourceMetadata": "",
          "sourceVid": [],
          "timestamp": 0,
          "updatedByUserId": 0,
          "useTimestampAsPersistenceTimestamp": false,
          "value": ""
        }
      ],
      "endDateTime": "",
      "eventCancelled": false,
      "eventDescription": "",
      "eventName": "",
      "eventOrganizer": "",
      "eventType": "",
      "eventUrl": "",
      "externalAccountId": "",
      "externalEventId": "",
      "startDateTime": ""
    }
  ]
}'
echo '{
  "inputs": [
    {
      "customProperties": [
        {
          "name": "",
          "persistenceTimestamp": 0,
          "requestId": "",
          "selectedByUser": false,
          "selectedByUserTimestamp": 0,
          "source": "",
          "sourceId": "",
          "sourceLabel": "",
          "sourceMetadata": "",
          "sourceVid": [],
          "timestamp": 0,
          "updatedByUserId": 0,
          "useTimestampAsPersistenceTimestamp": false,
          "value": ""
        }
      ],
      "endDateTime": "",
      "eventCancelled": false,
      "eventDescription": "",
      "eventName": "",
      "eventOrganizer": "",
      "eventType": "",
      "eventUrl": "",
      "externalAccountId": "",
      "externalEventId": "",
      "startDateTime": ""
    }
  ]
}' |  \
  http POST {{baseUrl}}/marketing/v3/marketing-events/events/upsert \
  content-type:application/json \
  private-app-legacy:'{{apiKey}}'
wget --quiet \
  --method POST \
  --header 'private-app-legacy: {{apiKey}}' \
  --header 'content-type: application/json' \
  --body-data '{\n  "inputs": [\n    {\n      "customProperties": [\n        {\n          "name": "",\n          "persistenceTimestamp": 0,\n          "requestId": "",\n          "selectedByUser": false,\n          "selectedByUserTimestamp": 0,\n          "source": "",\n          "sourceId": "",\n          "sourceLabel": "",\n          "sourceMetadata": "",\n          "sourceVid": [],\n          "timestamp": 0,\n          "updatedByUserId": 0,\n          "useTimestampAsPersistenceTimestamp": false,\n          "value": ""\n        }\n      ],\n      "endDateTime": "",\n      "eventCancelled": false,\n      "eventDescription": "",\n      "eventName": "",\n      "eventOrganizer": "",\n      "eventType": "",\n      "eventUrl": "",\n      "externalAccountId": "",\n      "externalEventId": "",\n      "startDateTime": ""\n    }\n  ]\n}' \
  --output-document \
  - {{baseUrl}}/marketing/v3/marketing-events/events/upsert
import Foundation

let headers = [
  "private-app-legacy": "{{apiKey}}",
  "content-type": "application/json"
]
let parameters = ["inputs": [
    [
      "customProperties": [
        [
          "name": "",
          "persistenceTimestamp": 0,
          "requestId": "",
          "selectedByUser": false,
          "selectedByUserTimestamp": 0,
          "source": "",
          "sourceId": "",
          "sourceLabel": "",
          "sourceMetadata": "",
          "sourceVid": [],
          "timestamp": 0,
          "updatedByUserId": 0,
          "useTimestampAsPersistenceTimestamp": false,
          "value": ""
        ]
      ],
      "endDateTime": "",
      "eventCancelled": false,
      "eventDescription": "",
      "eventName": "",
      "eventOrganizer": "",
      "eventType": "",
      "eventUrl": "",
      "externalAccountId": "",
      "externalEventId": "",
      "startDateTime": ""
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/marketing/v3/marketing-events/events/upsert")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
*/*
RESPONSE BODY text

{
  "category": "VALIDATION_ERROR",
  "correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
  "links": {
    "knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
  },
  "message": "Invalid input (details will vary based on the error)"
}
POST post--marketing-v3-marketing-events-events-{externalEventId}-cancel_doCancel
{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel
HEADERS

private-app-legacy
{{apiKey}}
QUERY PARAMS

externalAccountId
externalEventId
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId=");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/post "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel" {:headers {:private-app-legacy "{{apiKey}}"}
                                                                                                         :query-params {:externalAccountId ""}})
require "http/client"

url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId="
headers = HTTP::Headers{
  "private-app-legacy" => "{{apiKey}}"
}

response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Post,
    RequestUri = new Uri("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId="),
    Headers =
    {
        { "private-app-legacy", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId=");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId="

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("private-app-legacy", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
POST /baseUrl/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId= HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId=")
  .setHeader("private-app-legacy", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId="))
    .header("private-app-legacy", "{{apiKey}}")
    .method("POST", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId=")
  .post(null)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId=")
  .header("private-app-legacy", "{{apiKey}}")
  .asString();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('POST', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId=');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel',
  params: {externalAccountId: ''},
  headers: {'private-app-legacy': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId=';
const options = {method: 'POST', headers: {'private-app-legacy': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId=',
  method: 'POST',
  headers: {
    'private-app-legacy': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId=")
  .post(null)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'POST',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId=',
  headers: {
    'private-app-legacy': '{{apiKey}}'
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel',
  qs: {externalAccountId: ''},
  headers: {'private-app-legacy': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('POST', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel');

req.query({
  externalAccountId: ''
});

req.headers({
  'private-app-legacy': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel',
  params: {externalAccountId: ''},
  headers: {'private-app-legacy': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId=';
const options = {method: 'POST', headers: {'private-app-legacy': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId="]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId=" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in

Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId=",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => [
    "private-app-legacy: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('POST', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId=', [
  'headers' => [
    'private-app-legacy' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel');
$request->setMethod(HTTP_METH_POST);

$request->setQueryData([
  'externalAccountId' => ''
]);

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
  'externalAccountId' => ''
]));

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId=' -Method POST -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'private-app-legacy': "{{apiKey}}" }

conn.request("POST", "/baseUrl/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId=", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel"

querystring = {"externalAccountId":""}

headers = {"private-app-legacy": "{{apiKey}}"}

response = requests.post(url, headers=headers, params=querystring)

print(response.json())
library(httr)

url <- "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel"

queryString <- list(externalAccountId = "")

response <- VERB("POST", url, query = queryString, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId=")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.post('/baseUrl/marketing/v3/marketing-events/events/:externalEventId/cancel') do |req|
  req.headers['private-app-legacy'] = '{{apiKey}}'
  req.params['externalAccountId'] = ''
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel";

    let querystring = [
        ("externalAccountId", ""),
    ];

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.post(url)
        .query(&querystring)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request POST \
  --url '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId=' \
  --header 'private-app-legacy: {{apiKey}}'
http POST '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId=' \
  private-app-legacy:'{{apiKey}}'
wget --quiet \
  --method POST \
  --header 'private-app-legacy: {{apiKey}}' \
  --output-document \
  - '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId='
import Foundation

let headers = ["private-app-legacy": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/cancel?externalAccountId=")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
*/*
RESPONSE BODY text

{
  "category": "VALIDATION_ERROR",
  "correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
  "links": {
    "knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
  },
  "message": "Invalid input (details will vary based on the error)"
}
POST post--marketing-v3-marketing-events-events-{externalEventId}-complete_complete
{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete
HEADERS

private-app-legacy
{{apiKey}}
QUERY PARAMS

externalAccountId
externalEventId
BODY json

{
  "endDateTime": "",
  "startDateTime": ""
}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId=");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n  \"endDateTime\": \"\",\n  \"startDateTime\": \"\"\n}");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/post "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete" {:headers {:private-app-legacy "{{apiKey}}"}
                                                                                                           :query-params {:externalAccountId ""}
                                                                                                           :content-type :json
                                                                                                           :form-params {:endDateTime ""
                                                                                                                         :startDateTime ""}})
require "http/client"

url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId="
headers = HTTP::Headers{
  "private-app-legacy" => "{{apiKey}}"
  "content-type" => "application/json"
}
reqBody = "{\n  \"endDateTime\": \"\",\n  \"startDateTime\": \"\"\n}"

response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Post,
    RequestUri = new Uri("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId="),
    Headers =
    {
        { "private-app-legacy", "{{apiKey}}" },
    },
    Content = new StringContent("{\n  \"endDateTime\": \"\",\n  \"startDateTime\": \"\"\n}")
    {
        Headers =
        {
            ContentType = new MediaTypeHeaderValue("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId=");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n  \"endDateTime\": \"\",\n  \"startDateTime\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId="

	payload := strings.NewReader("{\n  \"endDateTime\": \"\",\n  \"startDateTime\": \"\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("private-app-legacy", "{{apiKey}}")
	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
POST /baseUrl/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId= HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 46

{
  "endDateTime": "",
  "startDateTime": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId=")
  .setHeader("private-app-legacy", "{{apiKey}}")
  .setHeader("content-type", "application/json")
  .setBody("{\n  \"endDateTime\": \"\",\n  \"startDateTime\": \"\"\n}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId="))
    .header("private-app-legacy", "{{apiKey}}")
    .header("content-type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"endDateTime\": \"\",\n  \"startDateTime\": \"\"\n}"))
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"endDateTime\": \"\",\n  \"startDateTime\": \"\"\n}");
Request request = new Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId=")
  .post(body)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId=")
  .header("private-app-legacy", "{{apiKey}}")
  .header("content-type", "application/json")
  .body("{\n  \"endDateTime\": \"\",\n  \"startDateTime\": \"\"\n}")
  .asString();
const data = JSON.stringify({
  endDateTime: '',
  startDateTime: ''
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('POST', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId=');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete',
  params: {externalAccountId: ''},
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  data: {endDateTime: '', startDateTime: ''}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId=';
const options = {
  method: 'POST',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: '{"endDateTime":"","startDateTime":""}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId=',
  method: 'POST',
  headers: {
    'private-app-legacy': '{{apiKey}}',
    'content-type': 'application/json'
  },
  processData: false,
  data: '{\n  "endDateTime": "",\n  "startDateTime": ""\n}'
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n  \"endDateTime\": \"\",\n  \"startDateTime\": \"\"\n}")
val request = Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId=")
  .post(body)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'POST',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId=',
  headers: {
    'private-app-legacy': '{{apiKey}}',
    'content-type': 'application/json'
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({endDateTime: '', startDateTime: ''}));
req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete',
  qs: {externalAccountId: ''},
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: {endDateTime: '', startDateTime: ''},
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('POST', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete');

req.query({
  externalAccountId: ''
});

req.headers({
  'private-app-legacy': '{{apiKey}}',
  'content-type': 'application/json'
});

req.type('json');
req.send({
  endDateTime: '',
  startDateTime: ''
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete',
  params: {externalAccountId: ''},
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  data: {endDateTime: '', startDateTime: ''}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId=';
const options = {
  method: 'POST',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: '{"endDateTime":"","startDateTime":""}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"endDateTime": @"",
                              @"startDateTime": @"" };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId="]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId=" in
let headers = Header.add_list (Header.init ()) [
  ("private-app-legacy", "{{apiKey}}");
  ("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n  \"endDateTime\": \"\",\n  \"startDateTime\": \"\"\n}" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId=",
  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([
    'endDateTime' => '',
    'startDateTime' => ''
  ]),
  CURLOPT_HTTPHEADER => [
    "content-type: application/json",
    "private-app-legacy: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('POST', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId=', [
  'body' => '{
  "endDateTime": "",
  "startDateTime": ""
}',
  'headers' => [
    'content-type' => 'application/json',
    'private-app-legacy' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete');
$request->setMethod(HTTP_METH_POST);

$request->setQueryData([
  'externalAccountId' => ''
]);

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  'endDateTime' => '',
  'startDateTime' => ''
]));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  'endDateTime' => '',
  'startDateTime' => ''
]));
$request->setRequestUrl('{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setQuery(new http\QueryString([
  'externalAccountId' => ''
]));

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "endDateTime": "",
  "startDateTime": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "endDateTime": "",
  "startDateTime": ""
}'
import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\n  \"endDateTime\": \"\",\n  \"startDateTime\": \"\"\n}"

headers = {
    'private-app-legacy': "{{apiKey}}",
    'content-type': "application/json"
}

conn.request("POST", "/baseUrl/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId=", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete"

querystring = {"externalAccountId":""}

payload = {
    "endDateTime": "",
    "startDateTime": ""
}
headers = {
    "private-app-legacy": "{{apiKey}}",
    "content-type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, params=querystring)

print(response.json())
library(httr)

url <- "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete"

queryString <- list(externalAccountId = "")

payload <- "{\n  \"endDateTime\": \"\",\n  \"startDateTime\": \"\"\n}"

encode <- "json"

response <- VERB("POST", url, body = payload, query = queryString, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId=")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n  \"endDateTime\": \"\",\n  \"startDateTime\": \"\"\n}"

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
  headers: {'Content-Type' => 'application/json'}
)

response = conn.post('/baseUrl/marketing/v3/marketing-events/events/:externalEventId/complete') do |req|
  req.headers['private-app-legacy'] = '{{apiKey}}'
  req.params['externalAccountId'] = ''
  req.body = "{\n  \"endDateTime\": \"\",\n  \"startDateTime\": \"\"\n}"
end

puts response.status
puts response.body
use serde_json::json;
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete";

    let querystring = [
        ("externalAccountId", ""),
    ];

    let payload = json!({
        "endDateTime": "",
        "startDateTime": ""
    });

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
    headers.insert("content-type", "application/json".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.post(url)
        .query(&querystring)
        .headers(headers)
        .json(&payload)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request POST \
  --url '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId=' \
  --header 'content-type: application/json' \
  --header 'private-app-legacy: {{apiKey}}' \
  --data '{
  "endDateTime": "",
  "startDateTime": ""
}'
echo '{
  "endDateTime": "",
  "startDateTime": ""
}' |  \
  http POST '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId=' \
  content-type:application/json \
  private-app-legacy:'{{apiKey}}'
wget --quiet \
  --method POST \
  --header 'private-app-legacy: {{apiKey}}' \
  --header 'content-type: application/json' \
  --body-data '{\n  "endDateTime": "",\n  "startDateTime": ""\n}' \
  --output-document \
  - '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId='
import Foundation

let headers = [
  "private-app-legacy": "{{apiKey}}",
  "content-type": "application/json"
]
let parameters = [
  "endDateTime": "",
  "startDateTime": ""
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/complete?externalAccountId=")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
*/*
RESPONSE BODY text

{
  "category": "VALIDATION_ERROR",
  "correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
  "links": {
    "knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
  },
  "message": "Invalid input (details will vary based on the error)"
}
POST post--marketing-v3-marketing-events-events-{externalEventId}-{subscriberState}-email-upsert_doEmailUpsertById
{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert
HEADERS

private-app-legacy
{{apiKey}}
QUERY PARAMS

externalAccountId
externalEventId
subscriberState
BODY json

{
  "inputs": [
    {
      "contactProperties": {},
      "email": "",
      "interactionDateTime": 0,
      "properties": {}
    }
  ]
}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId=");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/post "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert" {:headers {:private-app-legacy "{{apiKey}}"}
                                                                                                                                :query-params {:externalAccountId ""}
                                                                                                                                :content-type :json
                                                                                                                                :form-params {:inputs [{:contactProperties {}
                                                                                                                                                        :email ""
                                                                                                                                                        :interactionDateTime 0
                                                                                                                                                        :properties {}}]}})
require "http/client"

url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId="
headers = HTTP::Headers{
  "private-app-legacy" => "{{apiKey}}"
  "content-type" => "application/json"
}
reqBody = "{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}"

response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Post,
    RequestUri = new Uri("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId="),
    Headers =
    {
        { "private-app-legacy", "{{apiKey}}" },
    },
    Content = new StringContent("{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}")
    {
        Headers =
        {
            ContentType = new MediaTypeHeaderValue("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId=");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId="

	payload := strings.NewReader("{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("private-app-legacy", "{{apiKey}}")
	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
POST /baseUrl/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId= HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 138

{
  "inputs": [
    {
      "contactProperties": {},
      "email": "",
      "interactionDateTime": 0,
      "properties": {}
    }
  ]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId=")
  .setHeader("private-app-legacy", "{{apiKey}}")
  .setHeader("content-type", "application/json")
  .setBody("{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId="))
    .header("private-app-legacy", "{{apiKey}}")
    .header("content-type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}"))
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}");
Request request = new Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId=")
  .post(body)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId=")
  .header("private-app-legacy", "{{apiKey}}")
  .header("content-type", "application/json")
  .body("{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}")
  .asString();
const data = JSON.stringify({
  inputs: [
    {
      contactProperties: {},
      email: '',
      interactionDateTime: 0,
      properties: {}
    }
  ]
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('POST', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId=');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert',
  params: {externalAccountId: ''},
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  data: {
    inputs: [{contactProperties: {}, email: '', interactionDateTime: 0, properties: {}}]
  }
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId=';
const options = {
  method: 'POST',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: '{"inputs":[{"contactProperties":{},"email":"","interactionDateTime":0,"properties":{}}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId=',
  method: 'POST',
  headers: {
    'private-app-legacy': '{{apiKey}}',
    'content-type': 'application/json'
  },
  processData: false,
  data: '{\n  "inputs": [\n    {\n      "contactProperties": {},\n      "email": "",\n      "interactionDateTime": 0,\n      "properties": {}\n    }\n  ]\n}'
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}")
val request = Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId=")
  .post(body)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'POST',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId=',
  headers: {
    'private-app-legacy': '{{apiKey}}',
    'content-type': 'application/json'
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({
  inputs: [{contactProperties: {}, email: '', interactionDateTime: 0, properties: {}}]
}));
req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert',
  qs: {externalAccountId: ''},
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: {
    inputs: [{contactProperties: {}, email: '', interactionDateTime: 0, properties: {}}]
  },
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('POST', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert');

req.query({
  externalAccountId: ''
});

req.headers({
  'private-app-legacy': '{{apiKey}}',
  'content-type': 'application/json'
});

req.type('json');
req.send({
  inputs: [
    {
      contactProperties: {},
      email: '',
      interactionDateTime: 0,
      properties: {}
    }
  ]
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert',
  params: {externalAccountId: ''},
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  data: {
    inputs: [{contactProperties: {}, email: '', interactionDateTime: 0, properties: {}}]
  }
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId=';
const options = {
  method: 'POST',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: '{"inputs":[{"contactProperties":{},"email":"","interactionDateTime":0,"properties":{}}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"inputs": @[ @{ @"contactProperties": @{  }, @"email": @"", @"interactionDateTime": @0, @"properties": @{  } } ] };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId="]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId=" in
let headers = Header.add_list (Header.init ()) [
  ("private-app-legacy", "{{apiKey}}");
  ("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId=",
  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' => [
        [
                'contactProperties' => [
                                
                ],
                'email' => '',
                'interactionDateTime' => 0,
                'properties' => [
                                
                ]
        ]
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "content-type: application/json",
    "private-app-legacy: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('POST', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId=', [
  'body' => '{
  "inputs": [
    {
      "contactProperties": {},
      "email": "",
      "interactionDateTime": 0,
      "properties": {}
    }
  ]
}',
  'headers' => [
    'content-type' => 'application/json',
    'private-app-legacy' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert');
$request->setMethod(HTTP_METH_POST);

$request->setQueryData([
  'externalAccountId' => ''
]);

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  'inputs' => [
    [
        'contactProperties' => [
                
        ],
        'email' => '',
        'interactionDateTime' => 0,
        'properties' => [
                
        ]
    ]
  ]
]));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  'inputs' => [
    [
        'contactProperties' => [
                
        ],
        'email' => '',
        'interactionDateTime' => 0,
        'properties' => [
                
        ]
    ]
  ]
]));
$request->setRequestUrl('{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setQuery(new http\QueryString([
  'externalAccountId' => ''
]));

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "inputs": [
    {
      "contactProperties": {},
      "email": "",
      "interactionDateTime": 0,
      "properties": {}
    }
  ]
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "inputs": [
    {
      "contactProperties": {},
      "email": "",
      "interactionDateTime": 0,
      "properties": {}
    }
  ]
}'
import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}"

headers = {
    'private-app-legacy': "{{apiKey}}",
    'content-type': "application/json"
}

conn.request("POST", "/baseUrl/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId=", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert"

querystring = {"externalAccountId":""}

payload = { "inputs": [
        {
            "contactProperties": {},
            "email": "",
            "interactionDateTime": 0,
            "properties": {}
        }
    ] }
headers = {
    "private-app-legacy": "{{apiKey}}",
    "content-type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, params=querystring)

print(response.json())
library(httr)

url <- "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert"

queryString <- list(externalAccountId = "")

payload <- "{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}"

encode <- "json"

response <- VERB("POST", url, body = payload, query = queryString, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId=")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
  headers: {'Content-Type' => 'application/json'}
)

response = conn.post('/baseUrl/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert') do |req|
  req.headers['private-app-legacy'] = '{{apiKey}}'
  req.params['externalAccountId'] = ''
  req.body = "{\n  \"inputs\": [\n    {\n      \"contactProperties\": {},\n      \"email\": \"\",\n      \"interactionDateTime\": 0,\n      \"properties\": {}\n    }\n  ]\n}"
end

puts response.status
puts response.body
use serde_json::json;
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert";

    let querystring = [
        ("externalAccountId", ""),
    ];

    let payload = json!({"inputs": (
            json!({
                "contactProperties": json!({}),
                "email": "",
                "interactionDateTime": 0,
                "properties": json!({})
            })
        )});

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
    headers.insert("content-type", "application/json".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.post(url)
        .query(&querystring)
        .headers(headers)
        .json(&payload)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request POST \
  --url '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId=' \
  --header 'content-type: application/json' \
  --header 'private-app-legacy: {{apiKey}}' \
  --data '{
  "inputs": [
    {
      "contactProperties": {},
      "email": "",
      "interactionDateTime": 0,
      "properties": {}
    }
  ]
}'
echo '{
  "inputs": [
    {
      "contactProperties": {},
      "email": "",
      "interactionDateTime": 0,
      "properties": {}
    }
  ]
}' |  \
  http POST '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId=' \
  content-type:application/json \
  private-app-legacy:'{{apiKey}}'
wget --quiet \
  --method POST \
  --header 'private-app-legacy: {{apiKey}}' \
  --header 'content-type: application/json' \
  --body-data '{\n  "inputs": [\n    {\n      "contactProperties": {},\n      "email": "",\n      "interactionDateTime": 0,\n      "properties": {}\n    }\n  ]\n}' \
  --output-document \
  - '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId='
import Foundation

let headers = [
  "private-app-legacy": "{{apiKey}}",
  "content-type": "application/json"
]
let parameters = ["inputs": [
    [
      "contactProperties": [],
      "email": "",
      "interactionDateTime": 0,
      "properties": []
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/email-upsert?externalAccountId=")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
*/*
RESPONSE BODY text

{
  "category": "VALIDATION_ERROR",
  "correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
  "links": {
    "knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
  },
  "message": "Invalid input (details will vary based on the error)"
}
POST post--marketing-v3-marketing-events-events-{externalEventId}-{subscriberState}-upsert_doUpsertById
{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert
HEADERS

private-app-legacy
{{apiKey}}
QUERY PARAMS

externalAccountId
externalEventId
subscriberState
BODY json

{
  "inputs": [
    {
      "interactionDateTime": 0,
      "properties": {},
      "vid": 0
    }
  ]
}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId=");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/post "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert" {:headers {:private-app-legacy "{{apiKey}}"}
                                                                                                                          :query-params {:externalAccountId ""}
                                                                                                                          :content-type :json
                                                                                                                          :form-params {:inputs [{:interactionDateTime 0
                                                                                                                                                  :properties {}
                                                                                                                                                  :vid 0}]}})
require "http/client"

url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId="
headers = HTTP::Headers{
  "private-app-legacy" => "{{apiKey}}"
  "content-type" => "application/json"
}
reqBody = "{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}"

response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Post,
    RequestUri = new Uri("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId="),
    Headers =
    {
        { "private-app-legacy", "{{apiKey}}" },
    },
    Content = new StringContent("{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}")
    {
        Headers =
        {
            ContentType = new MediaTypeHeaderValue("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId=");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId="

	payload := strings.NewReader("{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("private-app-legacy", "{{apiKey}}")
	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
POST /baseUrl/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId= HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 104

{
  "inputs": [
    {
      "interactionDateTime": 0,
      "properties": {},
      "vid": 0
    }
  ]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId=")
  .setHeader("private-app-legacy", "{{apiKey}}")
  .setHeader("content-type", "application/json")
  .setBody("{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId="))
    .header("private-app-legacy", "{{apiKey}}")
    .header("content-type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}"))
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}");
Request request = new Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId=")
  .post(body)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId=")
  .header("private-app-legacy", "{{apiKey}}")
  .header("content-type", "application/json")
  .body("{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}")
  .asString();
const data = JSON.stringify({
  inputs: [
    {
      interactionDateTime: 0,
      properties: {},
      vid: 0
    }
  ]
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('POST', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId=');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert',
  params: {externalAccountId: ''},
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  data: {inputs: [{interactionDateTime: 0, properties: {}, vid: 0}]}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId=';
const options = {
  method: 'POST',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: '{"inputs":[{"interactionDateTime":0,"properties":{},"vid":0}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId=',
  method: 'POST',
  headers: {
    'private-app-legacy': '{{apiKey}}',
    'content-type': 'application/json'
  },
  processData: false,
  data: '{\n  "inputs": [\n    {\n      "interactionDateTime": 0,\n      "properties": {},\n      "vid": 0\n    }\n  ]\n}'
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}")
val request = Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId=")
  .post(body)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'POST',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId=',
  headers: {
    'private-app-legacy': '{{apiKey}}',
    'content-type': 'application/json'
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({inputs: [{interactionDateTime: 0, properties: {}, vid: 0}]}));
req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert',
  qs: {externalAccountId: ''},
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: {inputs: [{interactionDateTime: 0, properties: {}, vid: 0}]},
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('POST', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert');

req.query({
  externalAccountId: ''
});

req.headers({
  'private-app-legacy': '{{apiKey}}',
  'content-type': 'application/json'
});

req.type('json');
req.send({
  inputs: [
    {
      interactionDateTime: 0,
      properties: {},
      vid: 0
    }
  ]
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert',
  params: {externalAccountId: ''},
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  data: {inputs: [{interactionDateTime: 0, properties: {}, vid: 0}]}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId=';
const options = {
  method: 'POST',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: '{"inputs":[{"interactionDateTime":0,"properties":{},"vid":0}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"inputs": @[ @{ @"interactionDateTime": @0, @"properties": @{  }, @"vid": @0 } ] };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId="]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId=" in
let headers = Header.add_list (Header.init ()) [
  ("private-app-legacy", "{{apiKey}}");
  ("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId=",
  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' => [
        [
                'interactionDateTime' => 0,
                'properties' => [
                                
                ],
                'vid' => 0
        ]
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "content-type: application/json",
    "private-app-legacy: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('POST', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId=', [
  'body' => '{
  "inputs": [
    {
      "interactionDateTime": 0,
      "properties": {},
      "vid": 0
    }
  ]
}',
  'headers' => [
    'content-type' => 'application/json',
    'private-app-legacy' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert');
$request->setMethod(HTTP_METH_POST);

$request->setQueryData([
  'externalAccountId' => ''
]);

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  'inputs' => [
    [
        'interactionDateTime' => 0,
        'properties' => [
                
        ],
        'vid' => 0
    ]
  ]
]));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  'inputs' => [
    [
        'interactionDateTime' => 0,
        'properties' => [
                
        ],
        'vid' => 0
    ]
  ]
]));
$request->setRequestUrl('{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setQuery(new http\QueryString([
  'externalAccountId' => ''
]));

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "inputs": [
    {
      "interactionDateTime": 0,
      "properties": {},
      "vid": 0
    }
  ]
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "inputs": [
    {
      "interactionDateTime": 0,
      "properties": {},
      "vid": 0
    }
  ]
}'
import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}"

headers = {
    'private-app-legacy': "{{apiKey}}",
    'content-type': "application/json"
}

conn.request("POST", "/baseUrl/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId=", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert"

querystring = {"externalAccountId":""}

payload = { "inputs": [
        {
            "interactionDateTime": 0,
            "properties": {},
            "vid": 0
        }
    ] }
headers = {
    "private-app-legacy": "{{apiKey}}",
    "content-type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, params=querystring)

print(response.json())
library(httr)

url <- "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert"

queryString <- list(externalAccountId = "")

payload <- "{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}"

encode <- "json"

response <- VERB("POST", url, body = payload, query = queryString, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId=")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
  headers: {'Content-Type' => 'application/json'}
)

response = conn.post('/baseUrl/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert') do |req|
  req.headers['private-app-legacy'] = '{{apiKey}}'
  req.params['externalAccountId'] = ''
  req.body = "{\n  \"inputs\": [\n    {\n      \"interactionDateTime\": 0,\n      \"properties\": {},\n      \"vid\": 0\n    }\n  ]\n}"
end

puts response.status
puts response.body
use serde_json::json;
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert";

    let querystring = [
        ("externalAccountId", ""),
    ];

    let payload = json!({"inputs": (
            json!({
                "interactionDateTime": 0,
                "properties": json!({}),
                "vid": 0
            })
        )});

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
    headers.insert("content-type", "application/json".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.post(url)
        .query(&querystring)
        .headers(headers)
        .json(&payload)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request POST \
  --url '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId=' \
  --header 'content-type: application/json' \
  --header 'private-app-legacy: {{apiKey}}' \
  --data '{
  "inputs": [
    {
      "interactionDateTime": 0,
      "properties": {},
      "vid": 0
    }
  ]
}'
echo '{
  "inputs": [
    {
      "interactionDateTime": 0,
      "properties": {},
      "vid": 0
    }
  ]
}' |  \
  http POST '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId=' \
  content-type:application/json \
  private-app-legacy:'{{apiKey}}'
wget --quiet \
  --method POST \
  --header 'private-app-legacy: {{apiKey}}' \
  --header 'content-type: application/json' \
  --body-data '{\n  "inputs": [\n    {\n      "interactionDateTime": 0,\n      "properties": {},\n      "vid": 0\n    }\n  ]\n}' \
  --output-document \
  - '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId='
import Foundation

let headers = [
  "private-app-legacy": "{{apiKey}}",
  "content-type": "application/json"
]
let parameters = ["inputs": [
    [
      "interactionDateTime": 0,
      "properties": [],
      "vid": 0
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId/:subscriberState/upsert?externalAccountId=")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
*/*
RESPONSE BODY text

{
  "category": "VALIDATION_ERROR",
  "correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
  "links": {
    "knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
  },
  "message": "Invalid input (details will vary based on the error)"
}
POST post--marketing-v3-marketing-events-events_create
{{baseUrl}}/marketing/v3/marketing-events/events
HEADERS

private-app-legacy
{{apiKey}}
BODY json

{
  "customProperties": [
    {
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    }
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "externalAccountId": "",
  "externalEventId": "",
  "startDateTime": ""
}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/marketing/v3/marketing-events/events");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/post "{{baseUrl}}/marketing/v3/marketing-events/events" {:headers {:private-app-legacy "{{apiKey}}"}
                                                                                 :content-type :json
                                                                                 :form-params {:customProperties [{:name ""
                                                                                                                   :persistenceTimestamp 0
                                                                                                                   :requestId ""
                                                                                                                   :selectedByUser false
                                                                                                                   :selectedByUserTimestamp 0
                                                                                                                   :source ""
                                                                                                                   :sourceId ""
                                                                                                                   :sourceLabel ""
                                                                                                                   :sourceMetadata ""
                                                                                                                   :sourceVid []
                                                                                                                   :timestamp 0
                                                                                                                   :updatedByUserId 0
                                                                                                                   :useTimestampAsPersistenceTimestamp false
                                                                                                                   :value ""}]
                                                                                               :endDateTime ""
                                                                                               :eventCancelled false
                                                                                               :eventDescription ""
                                                                                               :eventName ""
                                                                                               :eventOrganizer ""
                                                                                               :eventType ""
                                                                                               :eventUrl ""
                                                                                               :externalAccountId ""
                                                                                               :externalEventId ""
                                                                                               :startDateTime ""}})
require "http/client"

url = "{{baseUrl}}/marketing/v3/marketing-events/events"
headers = HTTP::Headers{
  "private-app-legacy" => "{{apiKey}}"
  "content-type" => "application/json"
}
reqBody = "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}"

response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Post,
    RequestUri = new Uri("{{baseUrl}}/marketing/v3/marketing-events/events"),
    Headers =
    {
        { "private-app-legacy", "{{apiKey}}" },
    },
    Content = new StringContent("{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}")
    {
        Headers =
        {
            ContentType = new MediaTypeHeaderValue("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/marketing/v3/marketing-events/events");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/marketing/v3/marketing-events/events"

	payload := strings.NewReader("{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("private-app-legacy", "{{apiKey}}")
	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
POST /baseUrl/marketing/v3/marketing-events/events HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 650

{
  "customProperties": [
    {
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    }
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "externalAccountId": "",
  "externalEventId": "",
  "startDateTime": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/marketing/v3/marketing-events/events")
  .setHeader("private-app-legacy", "{{apiKey}}")
  .setHeader("content-type", "application/json")
  .setBody("{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/marketing/v3/marketing-events/events"))
    .header("private-app-legacy", "{{apiKey}}")
    .header("content-type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}"))
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}");
Request request = new Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events")
  .post(body)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/marketing/v3/marketing-events/events")
  .header("private-app-legacy", "{{apiKey}}")
  .header("content-type", "application/json")
  .body("{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}")
  .asString();
const data = JSON.stringify({
  customProperties: [
    {
      name: '',
      persistenceTimestamp: 0,
      requestId: '',
      selectedByUser: false,
      selectedByUserTimestamp: 0,
      source: '',
      sourceId: '',
      sourceLabel: '',
      sourceMetadata: '',
      sourceVid: [],
      timestamp: 0,
      updatedByUserId: 0,
      useTimestampAsPersistenceTimestamp: false,
      value: ''
    }
  ],
  endDateTime: '',
  eventCancelled: false,
  eventDescription: '',
  eventName: '',
  eventOrganizer: '',
  eventType: '',
  eventUrl: '',
  externalAccountId: '',
  externalEventId: '',
  startDateTime: ''
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('POST', '{{baseUrl}}/marketing/v3/marketing-events/events');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  data: {
    customProperties: [
      {
        name: '',
        persistenceTimestamp: 0,
        requestId: '',
        selectedByUser: false,
        selectedByUserTimestamp: 0,
        source: '',
        sourceId: '',
        sourceLabel: '',
        sourceMetadata: '',
        sourceVid: [],
        timestamp: 0,
        updatedByUserId: 0,
        useTimestampAsPersistenceTimestamp: false,
        value: ''
      }
    ],
    endDateTime: '',
    eventCancelled: false,
    eventDescription: '',
    eventName: '',
    eventOrganizer: '',
    eventType: '',
    eventUrl: '',
    externalAccountId: '',
    externalEventId: '',
    startDateTime: ''
  }
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/marketing/v3/marketing-events/events';
const options = {
  method: 'POST',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: '{"customProperties":[{"name":"","persistenceTimestamp":0,"requestId":"","selectedByUser":false,"selectedByUserTimestamp":0,"source":"","sourceId":"","sourceLabel":"","sourceMetadata":"","sourceVid":[],"timestamp":0,"updatedByUserId":0,"useTimestampAsPersistenceTimestamp":false,"value":""}],"endDateTime":"","eventCancelled":false,"eventDescription":"","eventName":"","eventOrganizer":"","eventType":"","eventUrl":"","externalAccountId":"","externalEventId":"","startDateTime":""}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/marketing/v3/marketing-events/events',
  method: 'POST',
  headers: {
    'private-app-legacy': '{{apiKey}}',
    'content-type': 'application/json'
  },
  processData: false,
  data: '{\n  "customProperties": [\n    {\n      "name": "",\n      "persistenceTimestamp": 0,\n      "requestId": "",\n      "selectedByUser": false,\n      "selectedByUserTimestamp": 0,\n      "source": "",\n      "sourceId": "",\n      "sourceLabel": "",\n      "sourceMetadata": "",\n      "sourceVid": [],\n      "timestamp": 0,\n      "updatedByUserId": 0,\n      "useTimestampAsPersistenceTimestamp": false,\n      "value": ""\n    }\n  ],\n  "endDateTime": "",\n  "eventCancelled": false,\n  "eventDescription": "",\n  "eventName": "",\n  "eventOrganizer": "",\n  "eventType": "",\n  "eventUrl": "",\n  "externalAccountId": "",\n  "externalEventId": "",\n  "startDateTime": ""\n}'
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}")
val request = Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events")
  .post(body)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'POST',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/marketing/v3/marketing-events/events',
  headers: {
    'private-app-legacy': '{{apiKey}}',
    'content-type': 'application/json'
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({
  customProperties: [
    {
      name: '',
      persistenceTimestamp: 0,
      requestId: '',
      selectedByUser: false,
      selectedByUserTimestamp: 0,
      source: '',
      sourceId: '',
      sourceLabel: '',
      sourceMetadata: '',
      sourceVid: [],
      timestamp: 0,
      updatedByUserId: 0,
      useTimestampAsPersistenceTimestamp: false,
      value: ''
    }
  ],
  endDateTime: '',
  eventCancelled: false,
  eventDescription: '',
  eventName: '',
  eventOrganizer: '',
  eventType: '',
  eventUrl: '',
  externalAccountId: '',
  externalEventId: '',
  startDateTime: ''
}));
req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: {
    customProperties: [
      {
        name: '',
        persistenceTimestamp: 0,
        requestId: '',
        selectedByUser: false,
        selectedByUserTimestamp: 0,
        source: '',
        sourceId: '',
        sourceLabel: '',
        sourceMetadata: '',
        sourceVid: [],
        timestamp: 0,
        updatedByUserId: 0,
        useTimestampAsPersistenceTimestamp: false,
        value: ''
      }
    ],
    endDateTime: '',
    eventCancelled: false,
    eventDescription: '',
    eventName: '',
    eventOrganizer: '',
    eventType: '',
    eventUrl: '',
    externalAccountId: '',
    externalEventId: '',
    startDateTime: ''
  },
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('POST', '{{baseUrl}}/marketing/v3/marketing-events/events');

req.headers({
  'private-app-legacy': '{{apiKey}}',
  'content-type': 'application/json'
});

req.type('json');
req.send({
  customProperties: [
    {
      name: '',
      persistenceTimestamp: 0,
      requestId: '',
      selectedByUser: false,
      selectedByUserTimestamp: 0,
      source: '',
      sourceId: '',
      sourceLabel: '',
      sourceMetadata: '',
      sourceVid: [],
      timestamp: 0,
      updatedByUserId: 0,
      useTimestampAsPersistenceTimestamp: false,
      value: ''
    }
  ],
  endDateTime: '',
  eventCancelled: false,
  eventDescription: '',
  eventName: '',
  eventOrganizer: '',
  eventType: '',
  eventUrl: '',
  externalAccountId: '',
  externalEventId: '',
  startDateTime: ''
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  data: {
    customProperties: [
      {
        name: '',
        persistenceTimestamp: 0,
        requestId: '',
        selectedByUser: false,
        selectedByUserTimestamp: 0,
        source: '',
        sourceId: '',
        sourceLabel: '',
        sourceMetadata: '',
        sourceVid: [],
        timestamp: 0,
        updatedByUserId: 0,
        useTimestampAsPersistenceTimestamp: false,
        value: ''
      }
    ],
    endDateTime: '',
    eventCancelled: false,
    eventDescription: '',
    eventName: '',
    eventOrganizer: '',
    eventType: '',
    eventUrl: '',
    externalAccountId: '',
    externalEventId: '',
    startDateTime: ''
  }
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/marketing/v3/marketing-events/events';
const options = {
  method: 'POST',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: '{"customProperties":[{"name":"","persistenceTimestamp":0,"requestId":"","selectedByUser":false,"selectedByUserTimestamp":0,"source":"","sourceId":"","sourceLabel":"","sourceMetadata":"","sourceVid":[],"timestamp":0,"updatedByUserId":0,"useTimestampAsPersistenceTimestamp":false,"value":""}],"endDateTime":"","eventCancelled":false,"eventDescription":"","eventName":"","eventOrganizer":"","eventType":"","eventUrl":"","externalAccountId":"","externalEventId":"","startDateTime":""}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"customProperties": @[ @{ @"name": @"", @"persistenceTimestamp": @0, @"requestId": @"", @"selectedByUser": @NO, @"selectedByUserTimestamp": @0, @"source": @"", @"sourceId": @"", @"sourceLabel": @"", @"sourceMetadata": @"", @"sourceVid": @[  ], @"timestamp": @0, @"updatedByUserId": @0, @"useTimestampAsPersistenceTimestamp": @NO, @"value": @"" } ],
                              @"endDateTime": @"",
                              @"eventCancelled": @NO,
                              @"eventDescription": @"",
                              @"eventName": @"",
                              @"eventOrganizer": @"",
                              @"eventType": @"",
                              @"eventUrl": @"",
                              @"externalAccountId": @"",
                              @"externalEventId": @"",
                              @"startDateTime": @"" };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/marketing/v3/marketing-events/events"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/marketing/v3/marketing-events/events" in
let headers = Header.add_list (Header.init ()) [
  ("private-app-legacy", "{{apiKey}}");
  ("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/marketing/v3/marketing-events/events",
  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([
    'customProperties' => [
        [
                'name' => '',
                'persistenceTimestamp' => 0,
                'requestId' => '',
                'selectedByUser' => null,
                'selectedByUserTimestamp' => 0,
                'source' => '',
                'sourceId' => '',
                'sourceLabel' => '',
                'sourceMetadata' => '',
                'sourceVid' => [
                                
                ],
                'timestamp' => 0,
                'updatedByUserId' => 0,
                'useTimestampAsPersistenceTimestamp' => null,
                'value' => ''
        ]
    ],
    'endDateTime' => '',
    'eventCancelled' => null,
    'eventDescription' => '',
    'eventName' => '',
    'eventOrganizer' => '',
    'eventType' => '',
    'eventUrl' => '',
    'externalAccountId' => '',
    'externalEventId' => '',
    'startDateTime' => ''
  ]),
  CURLOPT_HTTPHEADER => [
    "content-type: application/json",
    "private-app-legacy: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('POST', '{{baseUrl}}/marketing/v3/marketing-events/events', [
  'body' => '{
  "customProperties": [
    {
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    }
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "externalAccountId": "",
  "externalEventId": "",
  "startDateTime": ""
}',
  'headers' => [
    'content-type' => 'application/json',
    'private-app-legacy' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/marketing/v3/marketing-events/events');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  'customProperties' => [
    [
        'name' => '',
        'persistenceTimestamp' => 0,
        'requestId' => '',
        'selectedByUser' => null,
        'selectedByUserTimestamp' => 0,
        'source' => '',
        'sourceId' => '',
        'sourceLabel' => '',
        'sourceMetadata' => '',
        'sourceVid' => [
                
        ],
        'timestamp' => 0,
        'updatedByUserId' => 0,
        'useTimestampAsPersistenceTimestamp' => null,
        'value' => ''
    ]
  ],
  'endDateTime' => '',
  'eventCancelled' => null,
  'eventDescription' => '',
  'eventName' => '',
  'eventOrganizer' => '',
  'eventType' => '',
  'eventUrl' => '',
  'externalAccountId' => '',
  'externalEventId' => '',
  'startDateTime' => ''
]));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  'customProperties' => [
    [
        'name' => '',
        'persistenceTimestamp' => 0,
        'requestId' => '',
        'selectedByUser' => null,
        'selectedByUserTimestamp' => 0,
        'source' => '',
        'sourceId' => '',
        'sourceLabel' => '',
        'sourceMetadata' => '',
        'sourceVid' => [
                
        ],
        'timestamp' => 0,
        'updatedByUserId' => 0,
        'useTimestampAsPersistenceTimestamp' => null,
        'value' => ''
    ]
  ],
  'endDateTime' => '',
  'eventCancelled' => null,
  'eventDescription' => '',
  'eventName' => '',
  'eventOrganizer' => '',
  'eventType' => '',
  'eventUrl' => '',
  'externalAccountId' => '',
  'externalEventId' => '',
  'startDateTime' => ''
]));
$request->setRequestUrl('{{baseUrl}}/marketing/v3/marketing-events/events');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/marketing/v3/marketing-events/events' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "customProperties": [
    {
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    }
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "externalAccountId": "",
  "externalEventId": "",
  "startDateTime": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/marketing/v3/marketing-events/events' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "customProperties": [
    {
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    }
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "externalAccountId": "",
  "externalEventId": "",
  "startDateTime": ""
}'
import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}"

headers = {
    'private-app-legacy': "{{apiKey}}",
    'content-type': "application/json"
}

conn.request("POST", "/baseUrl/marketing/v3/marketing-events/events", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/marketing/v3/marketing-events/events"

payload = {
    "customProperties": [
        {
            "name": "",
            "persistenceTimestamp": 0,
            "requestId": "",
            "selectedByUser": False,
            "selectedByUserTimestamp": 0,
            "source": "",
            "sourceId": "",
            "sourceLabel": "",
            "sourceMetadata": "",
            "sourceVid": [],
            "timestamp": 0,
            "updatedByUserId": 0,
            "useTimestampAsPersistenceTimestamp": False,
            "value": ""
        }
    ],
    "endDateTime": "",
    "eventCancelled": False,
    "eventDescription": "",
    "eventName": "",
    "eventOrganizer": "",
    "eventType": "",
    "eventUrl": "",
    "externalAccountId": "",
    "externalEventId": "",
    "startDateTime": ""
}
headers = {
    "private-app-legacy": "{{apiKey}}",
    "content-type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/marketing/v3/marketing-events/events"

payload <- "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}"

encode <- "json"

response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/marketing/v3/marketing-events/events")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}"

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
  headers: {'Content-Type' => 'application/json'}
)

response = conn.post('/baseUrl/marketing/v3/marketing-events/events') do |req|
  req.headers['private-app-legacy'] = '{{apiKey}}'
  req.body = "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}"
end

puts response.status
puts response.body
use serde_json::json;
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/marketing/v3/marketing-events/events";

    let payload = json!({
        "customProperties": (
            json!({
                "name": "",
                "persistenceTimestamp": 0,
                "requestId": "",
                "selectedByUser": false,
                "selectedByUserTimestamp": 0,
                "source": "",
                "sourceId": "",
                "sourceLabel": "",
                "sourceMetadata": "",
                "sourceVid": (),
                "timestamp": 0,
                "updatedByUserId": 0,
                "useTimestampAsPersistenceTimestamp": false,
                "value": ""
            })
        ),
        "endDateTime": "",
        "eventCancelled": false,
        "eventDescription": "",
        "eventName": "",
        "eventOrganizer": "",
        "eventType": "",
        "eventUrl": "",
        "externalAccountId": "",
        "externalEventId": "",
        "startDateTime": ""
    });

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
    headers.insert("content-type", "application/json".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.post(url)
        .headers(headers)
        .json(&payload)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request POST \
  --url {{baseUrl}}/marketing/v3/marketing-events/events \
  --header 'content-type: application/json' \
  --header 'private-app-legacy: {{apiKey}}' \
  --data '{
  "customProperties": [
    {
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    }
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "externalAccountId": "",
  "externalEventId": "",
  "startDateTime": ""
}'
echo '{
  "customProperties": [
    {
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    }
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "externalAccountId": "",
  "externalEventId": "",
  "startDateTime": ""
}' |  \
  http POST {{baseUrl}}/marketing/v3/marketing-events/events \
  content-type:application/json \
  private-app-legacy:'{{apiKey}}'
wget --quiet \
  --method POST \
  --header 'private-app-legacy: {{apiKey}}' \
  --header 'content-type: application/json' \
  --body-data '{\n  "customProperties": [\n    {\n      "name": "",\n      "persistenceTimestamp": 0,\n      "requestId": "",\n      "selectedByUser": false,\n      "selectedByUserTimestamp": 0,\n      "source": "",\n      "sourceId": "",\n      "sourceLabel": "",\n      "sourceMetadata": "",\n      "sourceVid": [],\n      "timestamp": 0,\n      "updatedByUserId": 0,\n      "useTimestampAsPersistenceTimestamp": false,\n      "value": ""\n    }\n  ],\n  "endDateTime": "",\n  "eventCancelled": false,\n  "eventDescription": "",\n  "eventName": "",\n  "eventOrganizer": "",\n  "eventType": "",\n  "eventUrl": "",\n  "externalAccountId": "",\n  "externalEventId": "",\n  "startDateTime": ""\n}' \
  --output-document \
  - {{baseUrl}}/marketing/v3/marketing-events/events
import Foundation

let headers = [
  "private-app-legacy": "{{apiKey}}",
  "content-type": "application/json"
]
let parameters = [
  "customProperties": [
    [
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    ]
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "externalAccountId": "",
  "externalEventId": "",
  "startDateTime": ""
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/marketing/v3/marketing-events/events")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
*/*
RESPONSE BODY text

{
  "category": "VALIDATION_ERROR",
  "correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
  "links": {
    "knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
  },
  "message": "Invalid input (details will vary based on the error)"
}
PUT put--marketing-v3-marketing-events-events-{externalEventId}_replace
{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId
HEADERS

private-app-legacy
{{apiKey}}
QUERY PARAMS

externalEventId
BODY json

{
  "customProperties": [
    {
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    }
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "externalAccountId": "",
  "externalEventId": "",
  "startDateTime": ""
}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/put "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId" {:headers {:private-app-legacy "{{apiKey}}"}
                                                                                                 :content-type :json
                                                                                                 :form-params {:customProperties [{:name ""
                                                                                                                                   :persistenceTimestamp 0
                                                                                                                                   :requestId ""
                                                                                                                                   :selectedByUser false
                                                                                                                                   :selectedByUserTimestamp 0
                                                                                                                                   :source ""
                                                                                                                                   :sourceId ""
                                                                                                                                   :sourceLabel ""
                                                                                                                                   :sourceMetadata ""
                                                                                                                                   :sourceVid []
                                                                                                                                   :timestamp 0
                                                                                                                                   :updatedByUserId 0
                                                                                                                                   :useTimestampAsPersistenceTimestamp false
                                                                                                                                   :value ""}]
                                                                                                               :endDateTime ""
                                                                                                               :eventCancelled false
                                                                                                               :eventDescription ""
                                                                                                               :eventName ""
                                                                                                               :eventOrganizer ""
                                                                                                               :eventType ""
                                                                                                               :eventUrl ""
                                                                                                               :externalAccountId ""
                                                                                                               :externalEventId ""
                                                                                                               :startDateTime ""}})
require "http/client"

url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId"
headers = HTTP::Headers{
  "private-app-legacy" => "{{apiKey}}"
  "content-type" => "application/json"
}
reqBody = "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}"

response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Put,
    RequestUri = new Uri("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId"),
    Headers =
    {
        { "private-app-legacy", "{{apiKey}}" },
    },
    Content = new StringContent("{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}")
    {
        Headers =
        {
            ContentType = new MediaTypeHeaderValue("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId");
var request = new RestRequest("", Method.Put);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId"

	payload := strings.NewReader("{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("private-app-legacy", "{{apiKey}}")
	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
PUT /baseUrl/marketing/v3/marketing-events/events/:externalEventId HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 650

{
  "customProperties": [
    {
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    }
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "externalAccountId": "",
  "externalEventId": "",
  "startDateTime": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId")
  .setHeader("private-app-legacy", "{{apiKey}}")
  .setHeader("content-type", "application/json")
  .setBody("{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId"))
    .header("private-app-legacy", "{{apiKey}}")
    .header("content-type", "application/json")
    .method("PUT", HttpRequest.BodyPublishers.ofString("{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}"))
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}");
Request request = new Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId")
  .put(body)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId")
  .header("private-app-legacy", "{{apiKey}}")
  .header("content-type", "application/json")
  .body("{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}")
  .asString();
const data = JSON.stringify({
  customProperties: [
    {
      name: '',
      persistenceTimestamp: 0,
      requestId: '',
      selectedByUser: false,
      selectedByUserTimestamp: 0,
      source: '',
      sourceId: '',
      sourceLabel: '',
      sourceMetadata: '',
      sourceVid: [],
      timestamp: 0,
      updatedByUserId: 0,
      useTimestampAsPersistenceTimestamp: false,
      value: ''
    }
  ],
  endDateTime: '',
  eventCancelled: false,
  eventDescription: '',
  eventName: '',
  eventOrganizer: '',
  eventType: '',
  eventUrl: '',
  externalAccountId: '',
  externalEventId: '',
  startDateTime: ''
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('PUT', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'PUT',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  data: {
    customProperties: [
      {
        name: '',
        persistenceTimestamp: 0,
        requestId: '',
        selectedByUser: false,
        selectedByUserTimestamp: 0,
        source: '',
        sourceId: '',
        sourceLabel: '',
        sourceMetadata: '',
        sourceVid: [],
        timestamp: 0,
        updatedByUserId: 0,
        useTimestampAsPersistenceTimestamp: false,
        value: ''
      }
    ],
    endDateTime: '',
    eventCancelled: false,
    eventDescription: '',
    eventName: '',
    eventOrganizer: '',
    eventType: '',
    eventUrl: '',
    externalAccountId: '',
    externalEventId: '',
    startDateTime: ''
  }
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId';
const options = {
  method: 'PUT',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: '{"customProperties":[{"name":"","persistenceTimestamp":0,"requestId":"","selectedByUser":false,"selectedByUserTimestamp":0,"source":"","sourceId":"","sourceLabel":"","sourceMetadata":"","sourceVid":[],"timestamp":0,"updatedByUserId":0,"useTimestampAsPersistenceTimestamp":false,"value":""}],"endDateTime":"","eventCancelled":false,"eventDescription":"","eventName":"","eventOrganizer":"","eventType":"","eventUrl":"","externalAccountId":"","externalEventId":"","startDateTime":""}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId',
  method: 'PUT',
  headers: {
    'private-app-legacy': '{{apiKey}}',
    'content-type': 'application/json'
  },
  processData: false,
  data: '{\n  "customProperties": [\n    {\n      "name": "",\n      "persistenceTimestamp": 0,\n      "requestId": "",\n      "selectedByUser": false,\n      "selectedByUserTimestamp": 0,\n      "source": "",\n      "sourceId": "",\n      "sourceLabel": "",\n      "sourceMetadata": "",\n      "sourceVid": [],\n      "timestamp": 0,\n      "updatedByUserId": 0,\n      "useTimestampAsPersistenceTimestamp": false,\n      "value": ""\n    }\n  ],\n  "endDateTime": "",\n  "eventCancelled": false,\n  "eventDescription": "",\n  "eventName": "",\n  "eventOrganizer": "",\n  "eventType": "",\n  "eventUrl": "",\n  "externalAccountId": "",\n  "externalEventId": "",\n  "startDateTime": ""\n}'
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}")
val request = Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId")
  .put(body)
  .addHeader("private-app-legacy", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'PUT',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/marketing/v3/marketing-events/events/:externalEventId',
  headers: {
    'private-app-legacy': '{{apiKey}}',
    'content-type': 'application/json'
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({
  customProperties: [
    {
      name: '',
      persistenceTimestamp: 0,
      requestId: '',
      selectedByUser: false,
      selectedByUserTimestamp: 0,
      source: '',
      sourceId: '',
      sourceLabel: '',
      sourceMetadata: '',
      sourceVid: [],
      timestamp: 0,
      updatedByUserId: 0,
      useTimestampAsPersistenceTimestamp: false,
      value: ''
    }
  ],
  endDateTime: '',
  eventCancelled: false,
  eventDescription: '',
  eventName: '',
  eventOrganizer: '',
  eventType: '',
  eventUrl: '',
  externalAccountId: '',
  externalEventId: '',
  startDateTime: ''
}));
req.end();
const request = require('request');

const options = {
  method: 'PUT',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: {
    customProperties: [
      {
        name: '',
        persistenceTimestamp: 0,
        requestId: '',
        selectedByUser: false,
        selectedByUserTimestamp: 0,
        source: '',
        sourceId: '',
        sourceLabel: '',
        sourceMetadata: '',
        sourceVid: [],
        timestamp: 0,
        updatedByUserId: 0,
        useTimestampAsPersistenceTimestamp: false,
        value: ''
      }
    ],
    endDateTime: '',
    eventCancelled: false,
    eventDescription: '',
    eventName: '',
    eventOrganizer: '',
    eventType: '',
    eventUrl: '',
    externalAccountId: '',
    externalEventId: '',
    startDateTime: ''
  },
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('PUT', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId');

req.headers({
  'private-app-legacy': '{{apiKey}}',
  'content-type': 'application/json'
});

req.type('json');
req.send({
  customProperties: [
    {
      name: '',
      persistenceTimestamp: 0,
      requestId: '',
      selectedByUser: false,
      selectedByUserTimestamp: 0,
      source: '',
      sourceId: '',
      sourceLabel: '',
      sourceMetadata: '',
      sourceVid: [],
      timestamp: 0,
      updatedByUserId: 0,
      useTimestampAsPersistenceTimestamp: false,
      value: ''
    }
  ],
  endDateTime: '',
  eventCancelled: false,
  eventDescription: '',
  eventName: '',
  eventOrganizer: '',
  eventType: '',
  eventUrl: '',
  externalAccountId: '',
  externalEventId: '',
  startDateTime: ''
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'PUT',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  data: {
    customProperties: [
      {
        name: '',
        persistenceTimestamp: 0,
        requestId: '',
        selectedByUser: false,
        selectedByUserTimestamp: 0,
        source: '',
        sourceId: '',
        sourceLabel: '',
        sourceMetadata: '',
        sourceVid: [],
        timestamp: 0,
        updatedByUserId: 0,
        useTimestampAsPersistenceTimestamp: false,
        value: ''
      }
    ],
    endDateTime: '',
    eventCancelled: false,
    eventDescription: '',
    eventName: '',
    eventOrganizer: '',
    eventType: '',
    eventUrl: '',
    externalAccountId: '',
    externalEventId: '',
    startDateTime: ''
  }
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId';
const options = {
  method: 'PUT',
  headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
  body: '{"customProperties":[{"name":"","persistenceTimestamp":0,"requestId":"","selectedByUser":false,"selectedByUserTimestamp":0,"source":"","sourceId":"","sourceLabel":"","sourceMetadata":"","sourceVid":[],"timestamp":0,"updatedByUserId":0,"useTimestampAsPersistenceTimestamp":false,"value":""}],"endDateTime":"","eventCancelled":false,"eventDescription":"","eventName":"","eventOrganizer":"","eventType":"","eventUrl":"","externalAccountId":"","externalEventId":"","startDateTime":""}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"customProperties": @[ @{ @"name": @"", @"persistenceTimestamp": @0, @"requestId": @"", @"selectedByUser": @NO, @"selectedByUserTimestamp": @0, @"source": @"", @"sourceId": @"", @"sourceLabel": @"", @"sourceMetadata": @"", @"sourceVid": @[  ], @"timestamp": @0, @"updatedByUserId": @0, @"useTimestampAsPersistenceTimestamp": @NO, @"value": @"" } ],
                              @"endDateTime": @"",
                              @"eventCancelled": @NO,
                              @"eventDescription": @"",
                              @"eventName": @"",
                              @"eventOrganizer": @"",
                              @"eventType": @"",
                              @"eventUrl": @"",
                              @"externalAccountId": @"",
                              @"externalEventId": @"",
                              @"startDateTime": @"" };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId" in
let headers = Header.add_list (Header.init ()) [
  ("private-app-legacy", "{{apiKey}}");
  ("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}" in

Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => json_encode([
    'customProperties' => [
        [
                'name' => '',
                'persistenceTimestamp' => 0,
                'requestId' => '',
                'selectedByUser' => null,
                'selectedByUserTimestamp' => 0,
                'source' => '',
                'sourceId' => '',
                'sourceLabel' => '',
                'sourceMetadata' => '',
                'sourceVid' => [
                                
                ],
                'timestamp' => 0,
                'updatedByUserId' => 0,
                'useTimestampAsPersistenceTimestamp' => null,
                'value' => ''
        ]
    ],
    'endDateTime' => '',
    'eventCancelled' => null,
    'eventDescription' => '',
    'eventName' => '',
    'eventOrganizer' => '',
    'eventType' => '',
    'eventUrl' => '',
    'externalAccountId' => '',
    'externalEventId' => '',
    'startDateTime' => ''
  ]),
  CURLOPT_HTTPHEADER => [
    "content-type: application/json",
    "private-app-legacy: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('PUT', '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId', [
  'body' => '{
  "customProperties": [
    {
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    }
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "externalAccountId": "",
  "externalEventId": "",
  "startDateTime": ""
}',
  'headers' => [
    'content-type' => 'application/json',
    'private-app-legacy' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId');
$request->setMethod(HTTP_METH_PUT);

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  'customProperties' => [
    [
        'name' => '',
        'persistenceTimestamp' => 0,
        'requestId' => '',
        'selectedByUser' => null,
        'selectedByUserTimestamp' => 0,
        'source' => '',
        'sourceId' => '',
        'sourceLabel' => '',
        'sourceMetadata' => '',
        'sourceVid' => [
                
        ],
        'timestamp' => 0,
        'updatedByUserId' => 0,
        'useTimestampAsPersistenceTimestamp' => null,
        'value' => ''
    ]
  ],
  'endDateTime' => '',
  'eventCancelled' => null,
  'eventDescription' => '',
  'eventName' => '',
  'eventOrganizer' => '',
  'eventType' => '',
  'eventUrl' => '',
  'externalAccountId' => '',
  'externalEventId' => '',
  'startDateTime' => ''
]));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  'customProperties' => [
    [
        'name' => '',
        'persistenceTimestamp' => 0,
        'requestId' => '',
        'selectedByUser' => null,
        'selectedByUserTimestamp' => 0,
        'source' => '',
        'sourceId' => '',
        'sourceLabel' => '',
        'sourceMetadata' => '',
        'sourceVid' => [
                
        ],
        'timestamp' => 0,
        'updatedByUserId' => 0,
        'useTimestampAsPersistenceTimestamp' => null,
        'value' => ''
    ]
  ],
  'endDateTime' => '',
  'eventCancelled' => null,
  'eventDescription' => '',
  'eventName' => '',
  'eventOrganizer' => '',
  'eventType' => '',
  'eventUrl' => '',
  'externalAccountId' => '',
  'externalEventId' => '',
  'startDateTime' => ''
]));
$request->setRequestUrl('{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId');
$request->setRequestMethod('PUT');
$request->setBody($body);

$request->setHeaders([
  'private-app-legacy' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
  "customProperties": [
    {
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    }
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "externalAccountId": "",
  "externalEventId": "",
  "startDateTime": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
  "customProperties": [
    {
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    }
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "externalAccountId": "",
  "externalEventId": "",
  "startDateTime": ""
}'
import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}"

headers = {
    'private-app-legacy': "{{apiKey}}",
    'content-type': "application/json"
}

conn.request("PUT", "/baseUrl/marketing/v3/marketing-events/events/:externalEventId", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId"

payload = {
    "customProperties": [
        {
            "name": "",
            "persistenceTimestamp": 0,
            "requestId": "",
            "selectedByUser": False,
            "selectedByUserTimestamp": 0,
            "source": "",
            "sourceId": "",
            "sourceLabel": "",
            "sourceMetadata": "",
            "sourceVid": [],
            "timestamp": 0,
            "updatedByUserId": 0,
            "useTimestampAsPersistenceTimestamp": False,
            "value": ""
        }
    ],
    "endDateTime": "",
    "eventCancelled": False,
    "eventDescription": "",
    "eventName": "",
    "eventOrganizer": "",
    "eventType": "",
    "eventUrl": "",
    "externalAccountId": "",
    "externalEventId": "",
    "startDateTime": ""
}
headers = {
    "private-app-legacy": "{{apiKey}}",
    "content-type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId"

payload <- "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}"

encode <- "json"

response <- VERB("PUT", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}"

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
  headers: {'Content-Type' => 'application/json'}
)

response = conn.put('/baseUrl/marketing/v3/marketing-events/events/:externalEventId') do |req|
  req.headers['private-app-legacy'] = '{{apiKey}}'
  req.body = "{\n  \"customProperties\": [\n    {\n      \"name\": \"\",\n      \"persistenceTimestamp\": 0,\n      \"requestId\": \"\",\n      \"selectedByUser\": false,\n      \"selectedByUserTimestamp\": 0,\n      \"source\": \"\",\n      \"sourceId\": \"\",\n      \"sourceLabel\": \"\",\n      \"sourceMetadata\": \"\",\n      \"sourceVid\": [],\n      \"timestamp\": 0,\n      \"updatedByUserId\": 0,\n      \"useTimestampAsPersistenceTimestamp\": false,\n      \"value\": \"\"\n    }\n  ],\n  \"endDateTime\": \"\",\n  \"eventCancelled\": false,\n  \"eventDescription\": \"\",\n  \"eventName\": \"\",\n  \"eventOrganizer\": \"\",\n  \"eventType\": \"\",\n  \"eventUrl\": \"\",\n  \"externalAccountId\": \"\",\n  \"externalEventId\": \"\",\n  \"startDateTime\": \"\"\n}"
end

puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId";

    let payload = json!({
        "customProperties": (
            json!({
                "name": "",
                "persistenceTimestamp": 0,
                "requestId": "",
                "selectedByUser": false,
                "selectedByUserTimestamp": 0,
                "source": "",
                "sourceId": "",
                "sourceLabel": "",
                "sourceMetadata": "",
                "sourceVid": (),
                "timestamp": 0,
                "updatedByUserId": 0,
                "useTimestampAsPersistenceTimestamp": false,
                "value": ""
            })
        ),
        "endDateTime": "",
        "eventCancelled": false,
        "eventDescription": "",
        "eventName": "",
        "eventOrganizer": "",
        "eventType": "",
        "eventUrl": "",
        "externalAccountId": "",
        "externalEventId": "",
        "startDateTime": ""
    });

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
    headers.insert("content-type", "application/json".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
        .headers(headers)
        .json(&payload)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request PUT \
  --url {{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId \
  --header 'content-type: application/json' \
  --header 'private-app-legacy: {{apiKey}}' \
  --data '{
  "customProperties": [
    {
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    }
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "externalAccountId": "",
  "externalEventId": "",
  "startDateTime": ""
}'
echo '{
  "customProperties": [
    {
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    }
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "externalAccountId": "",
  "externalEventId": "",
  "startDateTime": ""
}' |  \
  http PUT {{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId \
  content-type:application/json \
  private-app-legacy:'{{apiKey}}'
wget --quiet \
  --method PUT \
  --header 'private-app-legacy: {{apiKey}}' \
  --header 'content-type: application/json' \
  --body-data '{\n  "customProperties": [\n    {\n      "name": "",\n      "persistenceTimestamp": 0,\n      "requestId": "",\n      "selectedByUser": false,\n      "selectedByUserTimestamp": 0,\n      "source": "",\n      "sourceId": "",\n      "sourceLabel": "",\n      "sourceMetadata": "",\n      "sourceVid": [],\n      "timestamp": 0,\n      "updatedByUserId": 0,\n      "useTimestampAsPersistenceTimestamp": false,\n      "value": ""\n    }\n  ],\n  "endDateTime": "",\n  "eventCancelled": false,\n  "eventDescription": "",\n  "eventName": "",\n  "eventOrganizer": "",\n  "eventType": "",\n  "eventUrl": "",\n  "externalAccountId": "",\n  "externalEventId": "",\n  "startDateTime": ""\n}' \
  --output-document \
  - {{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId
import Foundation

let headers = [
  "private-app-legacy": "{{apiKey}}",
  "content-type": "application/json"
]
let parameters = [
  "customProperties": [
    [
      "name": "",
      "persistenceTimestamp": 0,
      "requestId": "",
      "selectedByUser": false,
      "selectedByUserTimestamp": 0,
      "source": "",
      "sourceId": "",
      "sourceLabel": "",
      "sourceMetadata": "",
      "sourceVid": [],
      "timestamp": 0,
      "updatedByUserId": 0,
      "useTimestampAsPersistenceTimestamp": false,
      "value": ""
    ]
  ],
  "endDateTime": "",
  "eventCancelled": false,
  "eventDescription": "",
  "eventName": "",
  "eventOrganizer": "",
  "eventType": "",
  "eventUrl": "",
  "externalAccountId": "",
  "externalEventId": "",
  "startDateTime": ""
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/marketing/v3/marketing-events/events/:externalEventId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
*/*
RESPONSE BODY text

{
  "category": "VALIDATION_ERROR",
  "correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
  "links": {
    "knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
  },
  "message": "Invalid input (details will vary based on the error)"
}
GET Search for marketing events
{{baseUrl}}/marketing/v3/marketing-events/events/search
QUERY PARAMS

q
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/marketing/v3/marketing-events/events/search?q=");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/marketing/v3/marketing-events/events/search" {:query-params {:q ""}})
require "http/client"

url = "{{baseUrl}}/marketing/v3/marketing-events/events/search?q="

response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/marketing/v3/marketing-events/events/search?q="),
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/marketing/v3/marketing-events/events/search?q=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/marketing/v3/marketing-events/events/search?q="

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/marketing/v3/marketing-events/events/search?q= HTTP/1.1
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/marketing/v3/marketing-events/events/search?q=")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/marketing/v3/marketing-events/events/search?q="))
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events/search?q=")
  .get()
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/marketing/v3/marketing-events/events/search?q=")
  .asString();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('GET', '{{baseUrl}}/marketing/v3/marketing-events/events/search?q=');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/search',
  params: {q: ''}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/marketing/v3/marketing-events/events/search?q=';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/search?q=',
  method: 'GET',
  headers: {}
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/events/search?q=")
  .get()
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/marketing/v3/marketing-events/events/search?q=',
  headers: {}
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/search',
  qs: {q: ''}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/marketing/v3/marketing-events/events/search');

req.query({
  q: ''
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/marketing/v3/marketing-events/events/search',
  params: {q: ''}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/marketing/v3/marketing-events/events/search?q=';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/marketing/v3/marketing-events/events/search?q="]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/marketing/v3/marketing-events/events/search?q=" in

Client.call `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/marketing/v3/marketing-events/events/search?q=",
  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;
}
request('GET', '{{baseUrl}}/marketing/v3/marketing-events/events/search?q=');

echo $response->getBody();
setUrl('{{baseUrl}}/marketing/v3/marketing-events/events/search');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData([
  'q' => ''
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/marketing/v3/marketing-events/events/search');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
  'q' => ''
]));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/marketing/v3/marketing-events/events/search?q=' -Method GET 
$response = Invoke-RestMethod -Uri '{{baseUrl}}/marketing/v3/marketing-events/events/search?q=' -Method GET 
import http.client

conn = http.client.HTTPSConnection("example.com")

conn.request("GET", "/baseUrl/marketing/v3/marketing-events/events/search?q=")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/marketing/v3/marketing-events/events/search"

querystring = {"q":""}

response = requests.get(url, params=querystring)

print(response.json())
library(httr)

url <- "{{baseUrl}}/marketing/v3/marketing-events/events/search"

queryString <- list(q = "")

response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/marketing/v3/marketing-events/events/search?q=")

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
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/marketing/v3/marketing-events/events/search') do |req|
  req.params['q'] = ''
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/marketing/v3/marketing-events/events/search";

    let querystring = [
        ("q", ""),
    ];

    let client = reqwest::Client::new();
    let response = client.get(url)
        .query(&querystring)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url '{{baseUrl}}/marketing/v3/marketing-events/events/search?q='
http GET '{{baseUrl}}/marketing/v3/marketing-events/events/search?q='
wget --quiet \
  --method GET \
  --output-document \
  - '{{baseUrl}}/marketing/v3/marketing-events/events/search?q='
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/marketing/v3/marketing-events/events/search?q=")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
*/*
RESPONSE BODY text

{
  "category": "VALIDATION_ERROR",
  "correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
  "links": {
    "knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
  },
  "message": "Invalid input (details will vary based on the error)"
}
GET get--marketing-v3-marketing-events-{appId}-settings_getAll
{{baseUrl}}/marketing/v3/marketing-events/:appId/settings
QUERY PARAMS

hapikey
{{apiKey}}
appId
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/marketing/v3/marketing-events/:appId/settings" {:query-params {:hapikey "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D"

response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D"),
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D HTTP/1.1
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D"))
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D")
  .get()
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D")
  .asString();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('GET', '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings',
  params: {hapikey: '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D',
  method: 'GET',
  headers: {}
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D")
  .get()
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D',
  headers: {}
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings',
  qs: {hapikey: '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings');

req.query({
  hapikey: '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings',
  params: {hapikey: '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D" in

Client.call `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D",
  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;
}
request('GET', '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D');

echo $response->getBody();
setUrl('{{baseUrl}}/marketing/v3/marketing-events/:appId/settings');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData([
  'hapikey' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/marketing/v3/marketing-events/:appId/settings');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
  'hapikey' => '{{apiKey}}'
]));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D' -Method GET 
$response = Invoke-RestMethod -Uri '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D' -Method GET 
import http.client

conn = http.client.HTTPSConnection("example.com")

conn.request("GET", "/baseUrl/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/marketing/v3/marketing-events/:appId/settings"

querystring = {"hapikey":"{{apiKey}}"}

response = requests.get(url, params=querystring)

print(response.json())
library(httr)

url <- "{{baseUrl}}/marketing/v3/marketing-events/:appId/settings"

queryString <- list(hapikey = "{{apiKey}}")

response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D")

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
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/marketing/v3/marketing-events/:appId/settings') do |req|
  req.params['hapikey'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/marketing/v3/marketing-events/:appId/settings";

    let querystring = [
        ("hapikey", "{{apiKey}}"),
    ];

    let client = reqwest::Client::new();
    let response = client.get(url)
        .query(&querystring)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D'
http GET '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D'
wget --quiet \
  --method GET \
  --output-document \
  - '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D'
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
*/*
RESPONSE BODY text

{
  "category": "VALIDATION_ERROR",
  "correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
  "links": {
    "knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
  },
  "message": "Invalid input (details will vary based on the error)"
}
POST post--marketing-v3-marketing-events-{appId}-settings_create
{{baseUrl}}/marketing/v3/marketing-events/:appId/settings
QUERY PARAMS

hapikey
{{apiKey}}
appId
BODY json

{
  "eventDetailsUrl": ""
}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n  \"eventDetailsUrl\": \"\"\n}");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/post "{{baseUrl}}/marketing/v3/marketing-events/:appId/settings" {:query-params {:hapikey "{{apiKey}}"}
                                                                                          :content-type :json
                                                                                          :form-params {:eventDetailsUrl ""}})
require "http/client"

url = "{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D"
headers = HTTP::Headers{
  "content-type" => "application/json"
}
reqBody = "{\n  \"eventDetailsUrl\": \"\"\n}"

response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Post,
    RequestUri = new Uri("{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D"),
    Content = new StringContent("{\n  \"eventDetailsUrl\": \"\"\n}")
    {
        Headers =
        {
            ContentType = new MediaTypeHeaderValue("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n  \"eventDetailsUrl\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D"

	payload := strings.NewReader("{\n  \"eventDetailsUrl\": \"\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
POST /baseUrl/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 27

{
  "eventDetailsUrl": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D")
  .setHeader("content-type", "application/json")
  .setBody("{\n  \"eventDetailsUrl\": \"\"\n}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D"))
    .header("content-type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"eventDetailsUrl\": \"\"\n}"))
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"eventDetailsUrl\": \"\"\n}");
Request request = new Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D")
  .post(body)
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D")
  .header("content-type", "application/json")
  .body("{\n  \"eventDetailsUrl\": \"\"\n}")
  .asString();
const data = JSON.stringify({
  eventDetailsUrl: ''
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('POST', '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D');
xhr.setRequestHeader('content-type', 'application/json');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings',
  params: {hapikey: '{{apiKey}}'},
  headers: {'content-type': 'application/json'},
  data: {eventDetailsUrl: ''}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D';
const options = {
  method: 'POST',
  headers: {'content-type': 'application/json'},
  body: '{"eventDetailsUrl":""}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D',
  method: 'POST',
  headers: {
    'content-type': 'application/json'
  },
  processData: false,
  data: '{\n  "eventDetailsUrl": ""\n}'
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n  \"eventDetailsUrl\": \"\"\n}")
val request = Request.Builder()
  .url("{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D")
  .post(body)
  .addHeader("content-type", "application/json")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'POST',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D',
  headers: {
    'content-type': 'application/json'
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({eventDetailsUrl: ''}));
req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings',
  qs: {hapikey: '{{apiKey}}'},
  headers: {'content-type': 'application/json'},
  body: {eventDetailsUrl: ''},
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('POST', '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings');

req.query({
  hapikey: '{{apiKey}}'
});

req.headers({
  'content-type': 'application/json'
});

req.type('json');
req.send({
  eventDetailsUrl: ''
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'POST',
  url: '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings',
  params: {hapikey: '{{apiKey}}'},
  headers: {'content-type': 'application/json'},
  data: {eventDetailsUrl: ''}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D';
const options = {
  method: 'POST',
  headers: {'content-type': 'application/json'},
  body: '{"eventDetailsUrl":""}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"eventDetailsUrl": @"" };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n  \"eventDetailsUrl\": \"\"\n}" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D",
  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([
    'eventDetailsUrl' => ''
  ]),
  CURLOPT_HTTPHEADER => [
    "content-type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('POST', '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D', [
  'body' => '{
  "eventDetailsUrl": ""
}',
  'headers' => [
    'content-type' => 'application/json',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/marketing/v3/marketing-events/:appId/settings');
$request->setMethod(HTTP_METH_POST);

$request->setQueryData([
  'hapikey' => '{{apiKey}}'
]);

$request->setHeaders([
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  'eventDetailsUrl' => ''
]));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  'eventDetailsUrl' => ''
]));
$request->setRequestUrl('{{baseUrl}}/marketing/v3/marketing-events/:appId/settings');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setQuery(new http\QueryString([
  'hapikey' => '{{apiKey}}'
]));

$request->setHeaders([
  'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "eventDetailsUrl": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "eventDetailsUrl": ""
}'
import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\n  \"eventDetailsUrl\": \"\"\n}"

headers = { 'content-type': "application/json" }

conn.request("POST", "/baseUrl/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/marketing/v3/marketing-events/:appId/settings"

querystring = {"hapikey":"{{apiKey}}"}

payload = { "eventDetailsUrl": "" }
headers = {"content-type": "application/json"}

response = requests.post(url, json=payload, headers=headers, params=querystring)

print(response.json())
library(httr)

url <- "{{baseUrl}}/marketing/v3/marketing-events/:appId/settings"

queryString <- list(hapikey = "{{apiKey}}")

payload <- "{\n  \"eventDetailsUrl\": \"\"\n}"

encode <- "json"

response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n  \"eventDetailsUrl\": \"\"\n}"

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
  headers: {'Content-Type' => 'application/json'}
)

response = conn.post('/baseUrl/marketing/v3/marketing-events/:appId/settings') do |req|
  req.params['hapikey'] = '{{apiKey}}'
  req.body = "{\n  \"eventDetailsUrl\": \"\"\n}"
end

puts response.status
puts response.body
use serde_json::json;
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/marketing/v3/marketing-events/:appId/settings";

    let querystring = [
        ("hapikey", "{{apiKey}}"),
    ];

    let payload = json!({"eventDetailsUrl": ""});

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("content-type", "application/json".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.post(url)
        .query(&querystring)
        .headers(headers)
        .json(&payload)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request POST \
  --url '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D' \
  --header 'content-type: application/json' \
  --data '{
  "eventDetailsUrl": ""
}'
echo '{
  "eventDetailsUrl": ""
}' |  \
  http POST '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D' \
  content-type:application/json
wget --quiet \
  --method POST \
  --header 'content-type: application/json' \
  --body-data '{\n  "eventDetailsUrl": ""\n}' \
  --output-document \
  - '{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D'
import Foundation

let headers = ["content-type": "application/json"]
let parameters = ["eventDetailsUrl": ""] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/marketing/v3/marketing-events/:appId/settings?hapikey=%7B%7BapiKey%7D%7D")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
*/*
RESPONSE BODY text

{
  "category": "VALIDATION_ERROR",
  "correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
  "links": {
    "knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
  },
  "message": "Invalid input (details will vary based on the error)"
}