Custom Workflow Actions
POST
Complete a batch of callbacks
{{baseUrl}}/automation/v4/actions/callbacks/complete
BODY json
{
"inputs": [
{
"callbackId": "",
"outputFields": {}
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/automation/v4/actions/callbacks/complete");
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 \"inputs\": [\n {\n \"callbackId\": \"\",\n \"outputFields\": {}\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/automation/v4/actions/callbacks/complete" {:content-type :json
:form-params {:inputs [{:callbackId ""
:outputFields {}}]}})
require "http/client"
url = "{{baseUrl}}/automation/v4/actions/callbacks/complete"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"inputs\": [\n {\n \"callbackId\": \"\",\n \"outputFields\": {}\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}}/automation/v4/actions/callbacks/complete"),
Content = new StringContent("{\n \"inputs\": [\n {\n \"callbackId\": \"\",\n \"outputFields\": {}\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}}/automation/v4/actions/callbacks/complete");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"inputs\": [\n {\n \"callbackId\": \"\",\n \"outputFields\": {}\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/automation/v4/actions/callbacks/complete"
payload := strings.NewReader("{\n \"inputs\": [\n {\n \"callbackId\": \"\",\n \"outputFields\": {}\n }\n ]\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/automation/v4/actions/callbacks/complete HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 82
{
"inputs": [
{
"callbackId": "",
"outputFields": {}
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/automation/v4/actions/callbacks/complete")
.setHeader("content-type", "application/json")
.setBody("{\n \"inputs\": [\n {\n \"callbackId\": \"\",\n \"outputFields\": {}\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/automation/v4/actions/callbacks/complete"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"inputs\": [\n {\n \"callbackId\": \"\",\n \"outputFields\": {}\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 \"callbackId\": \"\",\n \"outputFields\": {}\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/automation/v4/actions/callbacks/complete")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/automation/v4/actions/callbacks/complete")
.header("content-type", "application/json")
.body("{\n \"inputs\": [\n {\n \"callbackId\": \"\",\n \"outputFields\": {}\n }\n ]\n}")
.asString();
const data = JSON.stringify({
inputs: [
{
callbackId: '',
outputFields: {}
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/automation/v4/actions/callbacks/complete');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/automation/v4/actions/callbacks/complete',
headers: {'content-type': 'application/json'},
data: {inputs: [{callbackId: '', outputFields: {}}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/automation/v4/actions/callbacks/complete';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"inputs":[{"callbackId":"","outputFields":{}}]}'
};
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}}/automation/v4/actions/callbacks/complete',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "inputs": [\n {\n "callbackId": "",\n "outputFields": {}\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 \"callbackId\": \"\",\n \"outputFields\": {}\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/automation/v4/actions/callbacks/complete")
.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/automation/v4/actions/callbacks/complete',
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({inputs: [{callbackId: '', outputFields: {}}]}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/automation/v4/actions/callbacks/complete',
headers: {'content-type': 'application/json'},
body: {inputs: [{callbackId: '', outputFields: {}}]},
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}}/automation/v4/actions/callbacks/complete');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
inputs: [
{
callbackId: '',
outputFields: {}
}
]
});
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}}/automation/v4/actions/callbacks/complete',
headers: {'content-type': 'application/json'},
data: {inputs: [{callbackId: '', outputFields: {}}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/automation/v4/actions/callbacks/complete';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"inputs":[{"callbackId":"","outputFields":{}}]}'
};
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 = @{ @"inputs": @[ @{ @"callbackId": @"", @"outputFields": @{ } } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/automation/v4/actions/callbacks/complete"]
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}}/automation/v4/actions/callbacks/complete" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"inputs\": [\n {\n \"callbackId\": \"\",\n \"outputFields\": {}\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/automation/v4/actions/callbacks/complete",
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' => [
[
'callbackId' => '',
'outputFields' => [
]
]
]
]),
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}}/automation/v4/actions/callbacks/complete', [
'body' => '{
"inputs": [
{
"callbackId": "",
"outputFields": {}
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/automation/v4/actions/callbacks/complete');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'inputs' => [
[
'callbackId' => '',
'outputFields' => [
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'inputs' => [
[
'callbackId' => '',
'outputFields' => [
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/automation/v4/actions/callbacks/complete');
$request->setRequestMethod('POST');
$request->setBody($body);
$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}}/automation/v4/actions/callbacks/complete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": [
{
"callbackId": "",
"outputFields": {}
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/automation/v4/actions/callbacks/complete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": [
{
"callbackId": "",
"outputFields": {}
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"inputs\": [\n {\n \"callbackId\": \"\",\n \"outputFields\": {}\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/automation/v4/actions/callbacks/complete", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/automation/v4/actions/callbacks/complete"
payload = { "inputs": [
{
"callbackId": "",
"outputFields": {}
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/automation/v4/actions/callbacks/complete"
payload <- "{\n \"inputs\": [\n {\n \"callbackId\": \"\",\n \"outputFields\": {}\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/automation/v4/actions/callbacks/complete")
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 \"inputs\": [\n {\n \"callbackId\": \"\",\n \"outputFields\": {}\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/automation/v4/actions/callbacks/complete') do |req|
req.body = "{\n \"inputs\": [\n {\n \"callbackId\": \"\",\n \"outputFields\": {}\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}}/automation/v4/actions/callbacks/complete";
let payload = json!({"inputs": (
json!({
"callbackId": "",
"outputFields": json!({})
})
)});
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)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/automation/v4/actions/callbacks/complete \
--header 'content-type: application/json' \
--data '{
"inputs": [
{
"callbackId": "",
"outputFields": {}
}
]
}'
echo '{
"inputs": [
{
"callbackId": "",
"outputFields": {}
}
]
}' | \
http POST {{baseUrl}}/automation/v4/actions/callbacks/complete \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "inputs": [\n {\n "callbackId": "",\n "outputFields": {}\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/automation/v4/actions/callbacks/complete
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["inputs": [
[
"callbackId": "",
"outputFields": []
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/automation/v4/actions/callbacks/complete")! 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
Complete a callback
{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete
QUERY PARAMS
callbackId
BODY json
{
"outputFields": {}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete");
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 \"outputFields\": {}\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete" {:content-type :json
:form-params {:outputFields {}}})
require "http/client"
url = "{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"outputFields\": {}\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}}/automation/v4/actions/callbacks/:callbackId/complete"),
Content = new StringContent("{\n \"outputFields\": {}\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}}/automation/v4/actions/callbacks/:callbackId/complete");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"outputFields\": {}\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete"
payload := strings.NewReader("{\n \"outputFields\": {}\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/automation/v4/actions/callbacks/:callbackId/complete HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 24
{
"outputFields": {}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete")
.setHeader("content-type", "application/json")
.setBody("{\n \"outputFields\": {}\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"outputFields\": {}\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 \"outputFields\": {}\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete")
.header("content-type", "application/json")
.body("{\n \"outputFields\": {}\n}")
.asString();
const data = JSON.stringify({
outputFields: {}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete',
headers: {'content-type': 'application/json'},
data: {outputFields: {}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"outputFields":{}}'
};
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}}/automation/v4/actions/callbacks/:callbackId/complete',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "outputFields": {}\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"outputFields\": {}\n}")
val request = Request.Builder()
.url("{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete")
.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/automation/v4/actions/callbacks/:callbackId/complete',
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({outputFields: {}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete',
headers: {'content-type': 'application/json'},
body: {outputFields: {}},
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}}/automation/v4/actions/callbacks/:callbackId/complete');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
outputFields: {}
});
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}}/automation/v4/actions/callbacks/:callbackId/complete',
headers: {'content-type': 'application/json'},
data: {outputFields: {}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"outputFields":{}}'
};
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 = @{ @"outputFields": @{ } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete"]
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}}/automation/v4/actions/callbacks/:callbackId/complete" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"outputFields\": {}\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete",
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([
'outputFields' => [
]
]),
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}}/automation/v4/actions/callbacks/:callbackId/complete', [
'body' => '{
"outputFields": {}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'outputFields' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'outputFields' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete');
$request->setRequestMethod('POST');
$request->setBody($body);
$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}}/automation/v4/actions/callbacks/:callbackId/complete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"outputFields": {}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"outputFields": {}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"outputFields\": {}\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/automation/v4/actions/callbacks/:callbackId/complete", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete"
payload = { "outputFields": {} }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete"
payload <- "{\n \"outputFields\": {}\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete")
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 \"outputFields\": {}\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/automation/v4/actions/callbacks/:callbackId/complete') do |req|
req.body = "{\n \"outputFields\": {}\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete";
let payload = json!({"outputFields": json!({})});
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)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete \
--header 'content-type: application/json' \
--data '{
"outputFields": {}
}'
echo '{
"outputFields": {}
}' | \
http POST {{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "outputFields": {}\n}' \
--output-document \
- {{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["outputFields": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/automation/v4/actions/callbacks/:callbackId/complete")! 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
Archive a custom action
{{baseUrl}}/automation/v4/actions/:appId/:definitionId
QUERY PARAMS
hapikey
{{apiKey}}
definitionId
appId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/automation/v4/actions/:appId/:definitionId" {:query-params {:hapikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/automation/v4/actions/:appId/:definitionId?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}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D"))
.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}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/automation/v4/actions/:appId/:definitionId?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('DELETE', '{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/automation/v4/actions/:appId/:definitionId',
params: {hapikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D';
const options = {method: 'DELETE'};
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}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/automation/v4/actions/:appId/:definitionId?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: 'DELETE',
url: '{{baseUrl}}/automation/v4/actions/:appId/:definitionId',
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('DELETE', '{{baseUrl}}/automation/v4/actions/:appId/:definitionId');
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: 'DELETE',
url: '{{baseUrl}}/automation/v4/actions/:appId/:definitionId',
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}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D';
const options = {method: 'DELETE'};
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}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/automation/v4/actions/:appId/:definitionId?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 => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D');
echo $response->getBody();
setUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'hapikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'hapikey' => '{{apiKey}}'
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId"
querystring = {"hapikey":"{{apiKey}}"}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/automation/v4/actions/:appId/:definitionId"
queryString <- list(hapikey = "{{apiKey}}")
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/automation/v4/actions/:appId/:definitionId') do |req|
req.params['hapikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId";
let querystring = [
("hapikey", "{{apiKey}}"),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D'
http DELETE '{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D'
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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
Create new custom action
{{baseUrl}}/automation/v4/actions/:appId
QUERY PARAMS
hapikey
{{apiKey}}
appId
BODY json
{
"actionUrl": "",
"archivedAt": 0,
"functions": [
{
"functionSource": "",
"functionType": "",
"id": ""
}
],
"inputFieldDependencies": [],
"inputFields": [
{
"isRequired": false,
"supportedValueTypes": [],
"typeDefinition": {
"fieldType": "",
"name": "",
"options": [
{
"description": "",
"displayOrder": 0,
"doubleData": "",
"hidden": false,
"label": "",
"readOnly": false,
"value": ""
}
],
"optionsUrl": "",
"referencedObjectType": "",
"type": ""
}
}
],
"labels": {},
"objectRequestOptions": {
"properties": []
},
"objectTypes": [],
"published": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/automation/v4/actions/:appId?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 \"actionUrl\": \"\",\n \"archivedAt\": 0,\n \"functions\": [\n {\n \"functionSource\": \"\",\n \"functionType\": \"\",\n \"id\": \"\"\n }\n ],\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/automation/v4/actions/:appId" {:query-params {:hapikey "{{apiKey}}"}
:content-type :json
:form-params {:actionUrl ""
:archivedAt 0
:functions [{:functionSource ""
:functionType ""
:id ""}]
:inputFieldDependencies []
:inputFields [{:isRequired false
:supportedValueTypes []
:typeDefinition {:fieldType ""
:name ""
:options [{:description ""
:displayOrder 0
:doubleData ""
:hidden false
:label ""
:readOnly false
:value ""}]
:optionsUrl ""
:referencedObjectType ""
:type ""}}]
:labels {}
:objectRequestOptions {:properties []}
:objectTypes []
:published false}})
require "http/client"
url = "{{baseUrl}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"actionUrl\": \"\",\n \"archivedAt\": 0,\n \"functions\": [\n {\n \"functionSource\": \"\",\n \"functionType\": \"\",\n \"id\": \"\"\n }\n ],\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\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}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D"),
Content = new StringContent("{\n \"actionUrl\": \"\",\n \"archivedAt\": 0,\n \"functions\": [\n {\n \"functionSource\": \"\",\n \"functionType\": \"\",\n \"id\": \"\"\n }\n ],\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\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}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"actionUrl\": \"\",\n \"archivedAt\": 0,\n \"functions\": [\n {\n \"functionSource\": \"\",\n \"functionType\": \"\",\n \"id\": \"\"\n }\n ],\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D"
payload := strings.NewReader("{\n \"actionUrl\": \"\",\n \"archivedAt\": 0,\n \"functions\": [\n {\n \"functionSource\": \"\",\n \"functionType\": \"\",\n \"id\": \"\"\n }\n ],\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\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/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 801
{
"actionUrl": "",
"archivedAt": 0,
"functions": [
{
"functionSource": "",
"functionType": "",
"id": ""
}
],
"inputFieldDependencies": [],
"inputFields": [
{
"isRequired": false,
"supportedValueTypes": [],
"typeDefinition": {
"fieldType": "",
"name": "",
"options": [
{
"description": "",
"displayOrder": 0,
"doubleData": "",
"hidden": false,
"label": "",
"readOnly": false,
"value": ""
}
],
"optionsUrl": "",
"referencedObjectType": "",
"type": ""
}
}
],
"labels": {},
"objectRequestOptions": {
"properties": []
},
"objectTypes": [],
"published": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D")
.setHeader("content-type", "application/json")
.setBody("{\n \"actionUrl\": \"\",\n \"archivedAt\": 0,\n \"functions\": [\n {\n \"functionSource\": \"\",\n \"functionType\": \"\",\n \"id\": \"\"\n }\n ],\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"actionUrl\": \"\",\n \"archivedAt\": 0,\n \"functions\": [\n {\n \"functionSource\": \"\",\n \"functionType\": \"\",\n \"id\": \"\"\n }\n ],\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\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 \"actionUrl\": \"\",\n \"archivedAt\": 0,\n \"functions\": [\n {\n \"functionSource\": \"\",\n \"functionType\": \"\",\n \"id\": \"\"\n }\n ],\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D")
.header("content-type", "application/json")
.body("{\n \"actionUrl\": \"\",\n \"archivedAt\": 0,\n \"functions\": [\n {\n \"functionSource\": \"\",\n \"functionType\": \"\",\n \"id\": \"\"\n }\n ],\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\n}")
.asString();
const data = JSON.stringify({
actionUrl: '',
archivedAt: 0,
functions: [
{
functionSource: '',
functionType: '',
id: ''
}
],
inputFieldDependencies: [],
inputFields: [
{
isRequired: false,
supportedValueTypes: [],
typeDefinition: {
fieldType: '',
name: '',
options: [
{
description: '',
displayOrder: 0,
doubleData: '',
hidden: false,
label: '',
readOnly: false,
value: ''
}
],
optionsUrl: '',
referencedObjectType: '',
type: ''
}
}
],
labels: {},
objectRequestOptions: {
properties: []
},
objectTypes: [],
published: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/automation/v4/actions/:appId',
params: {hapikey: '{{apiKey}}'},
headers: {'content-type': 'application/json'},
data: {
actionUrl: '',
archivedAt: 0,
functions: [{functionSource: '', functionType: '', id: ''}],
inputFieldDependencies: [],
inputFields: [
{
isRequired: false,
supportedValueTypes: [],
typeDefinition: {
fieldType: '',
name: '',
options: [
{
description: '',
displayOrder: 0,
doubleData: '',
hidden: false,
label: '',
readOnly: false,
value: ''
}
],
optionsUrl: '',
referencedObjectType: '',
type: ''
}
}
],
labels: {},
objectRequestOptions: {properties: []},
objectTypes: [],
published: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"actionUrl":"","archivedAt":0,"functions":[{"functionSource":"","functionType":"","id":""}],"inputFieldDependencies":[],"inputFields":[{"isRequired":false,"supportedValueTypes":[],"typeDefinition":{"fieldType":"","name":"","options":[{"description":"","displayOrder":0,"doubleData":"","hidden":false,"label":"","readOnly":false,"value":""}],"optionsUrl":"","referencedObjectType":"","type":""}}],"labels":{},"objectRequestOptions":{"properties":[]},"objectTypes":[],"published":false}'
};
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}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "actionUrl": "",\n "archivedAt": 0,\n "functions": [\n {\n "functionSource": "",\n "functionType": "",\n "id": ""\n }\n ],\n "inputFieldDependencies": [],\n "inputFields": [\n {\n "isRequired": false,\n "supportedValueTypes": [],\n "typeDefinition": {\n "fieldType": "",\n "name": "",\n "options": [\n {\n "description": "",\n "displayOrder": 0,\n "doubleData": "",\n "hidden": false,\n "label": "",\n "readOnly": false,\n "value": ""\n }\n ],\n "optionsUrl": "",\n "referencedObjectType": "",\n "type": ""\n }\n }\n ],\n "labels": {},\n "objectRequestOptions": {\n "properties": []\n },\n "objectTypes": [],\n "published": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"actionUrl\": \"\",\n \"archivedAt\": 0,\n \"functions\": [\n {\n \"functionSource\": \"\",\n \"functionType\": \"\",\n \"id\": \"\"\n }\n ],\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/automation/v4/actions/:appId?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/automation/v4/actions/:appId?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({
actionUrl: '',
archivedAt: 0,
functions: [{functionSource: '', functionType: '', id: ''}],
inputFieldDependencies: [],
inputFields: [
{
isRequired: false,
supportedValueTypes: [],
typeDefinition: {
fieldType: '',
name: '',
options: [
{
description: '',
displayOrder: 0,
doubleData: '',
hidden: false,
label: '',
readOnly: false,
value: ''
}
],
optionsUrl: '',
referencedObjectType: '',
type: ''
}
}
],
labels: {},
objectRequestOptions: {properties: []},
objectTypes: [],
published: false
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/automation/v4/actions/:appId',
qs: {hapikey: '{{apiKey}}'},
headers: {'content-type': 'application/json'},
body: {
actionUrl: '',
archivedAt: 0,
functions: [{functionSource: '', functionType: '', id: ''}],
inputFieldDependencies: [],
inputFields: [
{
isRequired: false,
supportedValueTypes: [],
typeDefinition: {
fieldType: '',
name: '',
options: [
{
description: '',
displayOrder: 0,
doubleData: '',
hidden: false,
label: '',
readOnly: false,
value: ''
}
],
optionsUrl: '',
referencedObjectType: '',
type: ''
}
}
],
labels: {},
objectRequestOptions: {properties: []},
objectTypes: [],
published: false
},
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}}/automation/v4/actions/:appId');
req.query({
hapikey: '{{apiKey}}'
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
actionUrl: '',
archivedAt: 0,
functions: [
{
functionSource: '',
functionType: '',
id: ''
}
],
inputFieldDependencies: [],
inputFields: [
{
isRequired: false,
supportedValueTypes: [],
typeDefinition: {
fieldType: '',
name: '',
options: [
{
description: '',
displayOrder: 0,
doubleData: '',
hidden: false,
label: '',
readOnly: false,
value: ''
}
],
optionsUrl: '',
referencedObjectType: '',
type: ''
}
}
],
labels: {},
objectRequestOptions: {
properties: []
},
objectTypes: [],
published: false
});
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}}/automation/v4/actions/:appId',
params: {hapikey: '{{apiKey}}'},
headers: {'content-type': 'application/json'},
data: {
actionUrl: '',
archivedAt: 0,
functions: [{functionSource: '', functionType: '', id: ''}],
inputFieldDependencies: [],
inputFields: [
{
isRequired: false,
supportedValueTypes: [],
typeDefinition: {
fieldType: '',
name: '',
options: [
{
description: '',
displayOrder: 0,
doubleData: '',
hidden: false,
label: '',
readOnly: false,
value: ''
}
],
optionsUrl: '',
referencedObjectType: '',
type: ''
}
}
],
labels: {},
objectRequestOptions: {properties: []},
objectTypes: [],
published: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"actionUrl":"","archivedAt":0,"functions":[{"functionSource":"","functionType":"","id":""}],"inputFieldDependencies":[],"inputFields":[{"isRequired":false,"supportedValueTypes":[],"typeDefinition":{"fieldType":"","name":"","options":[{"description":"","displayOrder":0,"doubleData":"","hidden":false,"label":"","readOnly":false,"value":""}],"optionsUrl":"","referencedObjectType":"","type":""}}],"labels":{},"objectRequestOptions":{"properties":[]},"objectTypes":[],"published":false}'
};
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 = @{ @"actionUrl": @"",
@"archivedAt": @0,
@"functions": @[ @{ @"functionSource": @"", @"functionType": @"", @"id": @"" } ],
@"inputFieldDependencies": @[ ],
@"inputFields": @[ @{ @"isRequired": @NO, @"supportedValueTypes": @[ ], @"typeDefinition": @{ @"fieldType": @"", @"name": @"", @"options": @[ @{ @"description": @"", @"displayOrder": @0, @"doubleData": @"", @"hidden": @NO, @"label": @"", @"readOnly": @NO, @"value": @"" } ], @"optionsUrl": @"", @"referencedObjectType": @"", @"type": @"" } } ],
@"labels": @{ },
@"objectRequestOptions": @{ @"properties": @[ ] },
@"objectTypes": @[ ],
@"published": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/automation/v4/actions/:appId?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}}/automation/v4/actions/:appId?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 \"actionUrl\": \"\",\n \"archivedAt\": 0,\n \"functions\": [\n {\n \"functionSource\": \"\",\n \"functionType\": \"\",\n \"id\": \"\"\n }\n ],\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/automation/v4/actions/:appId?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([
'actionUrl' => '',
'archivedAt' => 0,
'functions' => [
[
'functionSource' => '',
'functionType' => '',
'id' => ''
]
],
'inputFieldDependencies' => [
],
'inputFields' => [
[
'isRequired' => null,
'supportedValueTypes' => [
],
'typeDefinition' => [
'fieldType' => '',
'name' => '',
'options' => [
[
'description' => '',
'displayOrder' => 0,
'doubleData' => '',
'hidden' => null,
'label' => '',
'readOnly' => null,
'value' => ''
]
],
'optionsUrl' => '',
'referencedObjectType' => '',
'type' => ''
]
]
],
'labels' => [
],
'objectRequestOptions' => [
'properties' => [
]
],
'objectTypes' => [
],
'published' => null
]),
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}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D', [
'body' => '{
"actionUrl": "",
"archivedAt": 0,
"functions": [
{
"functionSource": "",
"functionType": "",
"id": ""
}
],
"inputFieldDependencies": [],
"inputFields": [
{
"isRequired": false,
"supportedValueTypes": [],
"typeDefinition": {
"fieldType": "",
"name": "",
"options": [
{
"description": "",
"displayOrder": 0,
"doubleData": "",
"hidden": false,
"label": "",
"readOnly": false,
"value": ""
}
],
"optionsUrl": "",
"referencedObjectType": "",
"type": ""
}
}
],
"labels": {},
"objectRequestOptions": {
"properties": []
},
"objectTypes": [],
"published": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/automation/v4/actions/:appId');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'hapikey' => '{{apiKey}}'
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'actionUrl' => '',
'archivedAt' => 0,
'functions' => [
[
'functionSource' => '',
'functionType' => '',
'id' => ''
]
],
'inputFieldDependencies' => [
],
'inputFields' => [
[
'isRequired' => null,
'supportedValueTypes' => [
],
'typeDefinition' => [
'fieldType' => '',
'name' => '',
'options' => [
[
'description' => '',
'displayOrder' => 0,
'doubleData' => '',
'hidden' => null,
'label' => '',
'readOnly' => null,
'value' => ''
]
],
'optionsUrl' => '',
'referencedObjectType' => '',
'type' => ''
]
]
],
'labels' => [
],
'objectRequestOptions' => [
'properties' => [
]
],
'objectTypes' => [
],
'published' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'actionUrl' => '',
'archivedAt' => 0,
'functions' => [
[
'functionSource' => '',
'functionType' => '',
'id' => ''
]
],
'inputFieldDependencies' => [
],
'inputFields' => [
[
'isRequired' => null,
'supportedValueTypes' => [
],
'typeDefinition' => [
'fieldType' => '',
'name' => '',
'options' => [
[
'description' => '',
'displayOrder' => 0,
'doubleData' => '',
'hidden' => null,
'label' => '',
'readOnly' => null,
'value' => ''
]
],
'optionsUrl' => '',
'referencedObjectType' => '',
'type' => ''
]
]
],
'labels' => [
],
'objectRequestOptions' => [
'properties' => [
]
],
'objectTypes' => [
],
'published' => null
]));
$request->setRequestUrl('{{baseUrl}}/automation/v4/actions/:appId');
$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}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"actionUrl": "",
"archivedAt": 0,
"functions": [
{
"functionSource": "",
"functionType": "",
"id": ""
}
],
"inputFieldDependencies": [],
"inputFields": [
{
"isRequired": false,
"supportedValueTypes": [],
"typeDefinition": {
"fieldType": "",
"name": "",
"options": [
{
"description": "",
"displayOrder": 0,
"doubleData": "",
"hidden": false,
"label": "",
"readOnly": false,
"value": ""
}
],
"optionsUrl": "",
"referencedObjectType": "",
"type": ""
}
}
],
"labels": {},
"objectRequestOptions": {
"properties": []
},
"objectTypes": [],
"published": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"actionUrl": "",
"archivedAt": 0,
"functions": [
{
"functionSource": "",
"functionType": "",
"id": ""
}
],
"inputFieldDependencies": [],
"inputFields": [
{
"isRequired": false,
"supportedValueTypes": [],
"typeDefinition": {
"fieldType": "",
"name": "",
"options": [
{
"description": "",
"displayOrder": 0,
"doubleData": "",
"hidden": false,
"label": "",
"readOnly": false,
"value": ""
}
],
"optionsUrl": "",
"referencedObjectType": "",
"type": ""
}
}
],
"labels": {},
"objectRequestOptions": {
"properties": []
},
"objectTypes": [],
"published": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"actionUrl\": \"\",\n \"archivedAt\": 0,\n \"functions\": [\n {\n \"functionSource\": \"\",\n \"functionType\": \"\",\n \"id\": \"\"\n }\n ],\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/automation/v4/actions/:appId"
querystring = {"hapikey":"{{apiKey}}"}
payload = {
"actionUrl": "",
"archivedAt": 0,
"functions": [
{
"functionSource": "",
"functionType": "",
"id": ""
}
],
"inputFieldDependencies": [],
"inputFields": [
{
"isRequired": False,
"supportedValueTypes": [],
"typeDefinition": {
"fieldType": "",
"name": "",
"options": [
{
"description": "",
"displayOrder": 0,
"doubleData": "",
"hidden": False,
"label": "",
"readOnly": False,
"value": ""
}
],
"optionsUrl": "",
"referencedObjectType": "",
"type": ""
}
}
],
"labels": {},
"objectRequestOptions": { "properties": [] },
"objectTypes": [],
"published": False
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/automation/v4/actions/:appId"
queryString <- list(hapikey = "{{apiKey}}")
payload <- "{\n \"actionUrl\": \"\",\n \"archivedAt\": 0,\n \"functions\": [\n {\n \"functionSource\": \"\",\n \"functionType\": \"\",\n \"id\": \"\"\n }\n ],\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\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}}/automation/v4/actions/:appId?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 \"actionUrl\": \"\",\n \"archivedAt\": 0,\n \"functions\": [\n {\n \"functionSource\": \"\",\n \"functionType\": \"\",\n \"id\": \"\"\n }\n ],\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\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/automation/v4/actions/:appId') do |req|
req.params['hapikey'] = '{{apiKey}}'
req.body = "{\n \"actionUrl\": \"\",\n \"archivedAt\": 0,\n \"functions\": [\n {\n \"functionSource\": \"\",\n \"functionType\": \"\",\n \"id\": \"\"\n }\n ],\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/automation/v4/actions/:appId";
let querystring = [
("hapikey", "{{apiKey}}"),
];
let payload = json!({
"actionUrl": "",
"archivedAt": 0,
"functions": (
json!({
"functionSource": "",
"functionType": "",
"id": ""
})
),
"inputFieldDependencies": (),
"inputFields": (
json!({
"isRequired": false,
"supportedValueTypes": (),
"typeDefinition": json!({
"fieldType": "",
"name": "",
"options": (
json!({
"description": "",
"displayOrder": 0,
"doubleData": "",
"hidden": false,
"label": "",
"readOnly": false,
"value": ""
})
),
"optionsUrl": "",
"referencedObjectType": "",
"type": ""
})
})
),
"labels": json!({}),
"objectRequestOptions": json!({"properties": ()}),
"objectTypes": (),
"published": false
});
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}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D' \
--header 'content-type: application/json' \
--data '{
"actionUrl": "",
"archivedAt": 0,
"functions": [
{
"functionSource": "",
"functionType": "",
"id": ""
}
],
"inputFieldDependencies": [],
"inputFields": [
{
"isRequired": false,
"supportedValueTypes": [],
"typeDefinition": {
"fieldType": "",
"name": "",
"options": [
{
"description": "",
"displayOrder": 0,
"doubleData": "",
"hidden": false,
"label": "",
"readOnly": false,
"value": ""
}
],
"optionsUrl": "",
"referencedObjectType": "",
"type": ""
}
}
],
"labels": {},
"objectRequestOptions": {
"properties": []
},
"objectTypes": [],
"published": false
}'
echo '{
"actionUrl": "",
"archivedAt": 0,
"functions": [
{
"functionSource": "",
"functionType": "",
"id": ""
}
],
"inputFieldDependencies": [],
"inputFields": [
{
"isRequired": false,
"supportedValueTypes": [],
"typeDefinition": {
"fieldType": "",
"name": "",
"options": [
{
"description": "",
"displayOrder": 0,
"doubleData": "",
"hidden": false,
"label": "",
"readOnly": false,
"value": ""
}
],
"optionsUrl": "",
"referencedObjectType": "",
"type": ""
}
}
],
"labels": {},
"objectRequestOptions": {
"properties": []
},
"objectTypes": [],
"published": false
}' | \
http POST '{{baseUrl}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "actionUrl": "",\n "archivedAt": 0,\n "functions": [\n {\n "functionSource": "",\n "functionType": "",\n "id": ""\n }\n ],\n "inputFieldDependencies": [],\n "inputFields": [\n {\n "isRequired": false,\n "supportedValueTypes": [],\n "typeDefinition": {\n "fieldType": "",\n "name": "",\n "options": [\n {\n "description": "",\n "displayOrder": 0,\n "doubleData": "",\n "hidden": false,\n "label": "",\n "readOnly": false,\n "value": ""\n }\n ],\n "optionsUrl": "",\n "referencedObjectType": "",\n "type": ""\n }\n }\n ],\n "labels": {},\n "objectRequestOptions": {\n "properties": []\n },\n "objectTypes": [],\n "published": false\n}' \
--output-document \
- '{{baseUrl}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D'
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"actionUrl": "",
"archivedAt": 0,
"functions": [
[
"functionSource": "",
"functionType": "",
"id": ""
]
],
"inputFieldDependencies": [],
"inputFields": [
[
"isRequired": false,
"supportedValueTypes": [],
"typeDefinition": [
"fieldType": "",
"name": "",
"options": [
[
"description": "",
"displayOrder": 0,
"doubleData": "",
"hidden": false,
"label": "",
"readOnly": false,
"value": ""
]
],
"optionsUrl": "",
"referencedObjectType": "",
"type": ""
]
]
],
"labels": [],
"objectRequestOptions": ["properties": []],
"objectTypes": [],
"published": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/automation/v4/actions/:appId?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
application/json
RESPONSE BODY json
{
"actionUrl": "https://example.com/custom-workflow-action",
"functions": [
{
"functionType": "PRE_ACTION_EXECUTION"
},
{
"functionType": "PRE_FETCH_OPTIONS",
"id": "widgetSize"
}
],
"id": "1",
"inputFieldDependencies": [
{
"controllingFieldName": "widgetSize",
"dependencyType": "SINGLE_FIELD",
"dependentFieldNames": [
"widgetName",
"widgetColor"
]
}
],
"inputFields": [
{
"required": true,
"supportedValueTypes": [
"OBJECT_PROPERTY"
],
"typeDefinition": {
"fieldType": "text",
"name": "widgetName",
"type": "string"
}
},
{
"required": false,
"supportedValueTypes": [
"STATIC_VALUE"
],
"typeDefinition": {
"fieldType": "enumeration",
"name": "widgetColor",
"options": [
{
"label": "Blue",
"value": "blue"
},
{
"label": "Red",
"value": "red"
}
],
"type": "string"
}
},
{
"required": false,
"supportedValueTypes": [
"STATIC_VALUE"
],
"typeDefinition": {
"fieldType": "enumeration",
"name": "widgetSize",
"optionsUrl": "https://example.com/widget-sizes",
"type": "string"
}
}
],
"labels": {
"en": {
"actionCardContent": "Create new widget {{ widgetName }}",
"actionDescription": "This action will create a new widget in our system. So cool!",
"actionName": "Create new widget",
"inputFieldDescriptions": {
"widgetColor": "This is the color that will be used to paint the widget.",
"widgetName": "Enter the full widget name. I support links too."
},
"inputFieldLabels": {
"widgetColor": "Widget Color",
"widgetName": "Widget Name",
"widgetSize": "Widget Size"
}
}
},
"objectRequestOptions": {
"properties": [
"firstname",
"lastname",
"preferred_widget"
]
},
"objectTypes": [
"CONTACT",
"COMPANY"
],
"published": true,
"revisionId": "1"
}
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 a custom action
{{baseUrl}}/automation/v4/actions/:appId/:definitionId
QUERY PARAMS
hapikey
{{apiKey}}
definitionId
appId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/automation/v4/actions/:appId/:definitionId" {:query-params {:hapikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId?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}}/automation/v4/actions/:appId/:definitionId?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}}/automation/v4/actions/:appId/:definitionId?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}}/automation/v4/actions/:appId/:definitionId?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/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/automation/v4/actions/:appId/:definitionId?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}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/automation/v4/actions/:appId/:definitionId?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}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/automation/v4/actions/:appId/:definitionId',
params: {hapikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/automation/v4/actions/:appId/:definitionId?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}}/automation/v4/actions/:appId/:definitionId?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}}/automation/v4/actions/:appId/:definitionId?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/automation/v4/actions/:appId/:definitionId?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}}/automation/v4/actions/:appId/:definitionId',
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}}/automation/v4/actions/:appId/:definitionId');
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}}/automation/v4/actions/:appId/:definitionId',
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}}/automation/v4/actions/:appId/:definitionId?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}}/automation/v4/actions/:appId/:definitionId?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}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/automation/v4/actions/:appId/:definitionId?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}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D');
echo $response->getBody();
setUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'hapikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId');
$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}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId"
querystring = {"hapikey":"{{apiKey}}"}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/automation/v4/actions/:appId/:definitionId"
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}}/automation/v4/actions/:appId/:definitionId?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/automation/v4/actions/:appId/:definitionId') do |req|
req.params['hapikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId";
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}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D'
http GET '{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D'
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/automation/v4/actions/:appId/:definitionId?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
application/json
RESPONSE BODY json
{
"actionUrl": "https://example.com/custom-workflow-action",
"functions": [
{
"functionType": "PRE_ACTION_EXECUTION"
},
{
"functionType": "PRE_FETCH_OPTIONS",
"id": "widgetSize"
}
],
"id": "1",
"inputFieldDependencies": [
{
"controllingFieldName": "widgetSize",
"dependencyType": "SINGLE_FIELD",
"dependentFieldNames": [
"widgetName",
"widgetColor"
]
}
],
"inputFields": [
{
"required": true,
"supportedValueTypes": [
"OBJECT_PROPERTY"
],
"typeDefinition": {
"fieldType": "text",
"name": "widgetName",
"type": "string"
}
},
{
"required": false,
"supportedValueTypes": [
"STATIC_VALUE"
],
"typeDefinition": {
"fieldType": "enumeration",
"name": "widgetColor",
"options": [
{
"label": "Blue",
"value": "blue"
},
{
"label": "Red",
"value": "red"
}
],
"type": "string"
}
},
{
"required": false,
"supportedValueTypes": [
"STATIC_VALUE"
],
"typeDefinition": {
"fieldType": "enumeration",
"name": "widgetSize",
"optionsUrl": "https://example.com/widget-sizes",
"type": "string"
}
}
],
"labels": {
"en": {
"actionCardContent": "Create new widget {{ widgetName }}",
"actionDescription": "This action will create a new widget in our system. So cool!",
"actionName": "Create new widget",
"inputFieldDescriptions": {
"widgetColor": "This is the color that will be used to paint the widget.",
"widgetName": "Enter the full widget name. I support links too."
},
"inputFieldLabels": {
"widgetColor": "Widget Color",
"widgetName": "Widget Name",
"widgetSize": "Widget Size"
}
}
},
"objectRequestOptions": {
"properties": [
"firstname",
"lastname",
"preferred_widget"
]
},
"objectTypes": [
"CONTACT",
"COMPANY"
],
"published": true,
"revisionId": "1"
}
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 all custom actions
{{baseUrl}}/automation/v4/actions/:appId
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}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/automation/v4/actions/:appId" {:query-params {:hapikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/automation/v4/actions/:appId?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}}/automation/v4/actions/:appId?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}}/automation/v4/actions/:appId?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}}/automation/v4/actions/:appId?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/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/automation/v4/actions/:appId?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}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/automation/v4/actions/:appId?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}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/automation/v4/actions/:appId',
params: {hapikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/automation/v4/actions/:appId?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}}/automation/v4/actions/:appId?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}}/automation/v4/actions/:appId?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/automation/v4/actions/:appId?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}}/automation/v4/actions/:appId',
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}}/automation/v4/actions/:appId');
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}}/automation/v4/actions/:appId',
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}}/automation/v4/actions/:appId?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}}/automation/v4/actions/:appId?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}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/automation/v4/actions/:appId?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}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D');
echo $response->getBody();
setUrl('{{baseUrl}}/automation/v4/actions/:appId');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'hapikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/automation/v4/actions/:appId');
$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}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/automation/v4/actions/:appId"
querystring = {"hapikey":"{{apiKey}}"}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/automation/v4/actions/:appId"
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}}/automation/v4/actions/:appId?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/automation/v4/actions/:appId') do |req|
req.params['hapikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/automation/v4/actions/:appId";
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}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D'
http GET '{{baseUrl}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D'
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/automation/v4/actions/:appId?hapikey=%7B%7BapiKey%7D%7D'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/automation/v4/actions/:appId?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
application/json
RESPONSE BODY json
{
"paging": {
"next": {
"after": "b3B0aW9uXzEy"
}
},
"results": [
{
"actionUrl": "https://example.com/custom-workflow-action",
"functions": [
{
"functionType": "PRE_ACTION_EXECUTION"
},
{
"functionType": "PRE_FETCH_OPTIONS",
"id": "widgetSize"
}
],
"id": "1",
"inputFieldDependencies": [
{
"controllingFieldName": "widgetSize",
"dependencyType": "SINGLE_FIELD",
"dependentFieldNames": [
"widgetName",
"widgetColor"
]
}
],
"inputFields": [
{
"required": true,
"supportedValueTypes": [
"OBJECT_PROPERTY"
],
"typeDefinition": {
"fieldType": "text",
"name": "widgetName",
"type": "string"
}
},
{
"required": false,
"supportedValueTypes": [
"STATIC_VALUE"
],
"typeDefinition": {
"fieldType": "enumeration",
"name": "widgetColor",
"options": [
{
"label": "Blue",
"value": "blue"
},
{
"label": "Red",
"value": "red"
}
],
"type": "string"
}
},
{
"required": false,
"supportedValueTypes": [
"STATIC_VALUE"
],
"typeDefinition": {
"fieldType": "enumeration",
"name": "widgetSize",
"optionsUrl": "https://example.com/widget-sizes",
"type": "string"
}
}
],
"labels": {
"en": {
"actionCardContent": "Create new widget {{ widgetName }}",
"actionDescription": "This action will create a new widget in our system. So cool!",
"actionName": "Create new widget",
"inputFieldDescriptions": {
"widgetColor": "This is the color that will be used to paint the widget.",
"widgetName": "Enter the full widget name. I support links too."
},
"inputFieldLabels": {
"widgetColor": "Widget Color",
"widgetName": "Widget Name",
"widgetSize": "Widget Size"
}
}
},
"objectRequestOptions": {
"properties": [
"firstname",
"lastname",
"preferred_widget"
]
},
"objectTypes": [
"CONTACT",
"COMPANY"
],
"published": true,
"revisionId": "1"
},
{
"actionUrl": "https://example.com/custom-workflow-action-2",
"id": "2",
"published": false,
"revisionId": "1"
}
]
}
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
Update a custom action
{{baseUrl}}/automation/v4/actions/:appId/:definitionId
QUERY PARAMS
hapikey
{{apiKey}}
definitionId
appId
BODY json
{
"actionUrl": "",
"inputFieldDependencies": [],
"inputFields": [
{
"isRequired": false,
"supportedValueTypes": [],
"typeDefinition": {
"fieldType": "",
"name": "",
"options": [
{
"description": "",
"displayOrder": 0,
"doubleData": "",
"hidden": false,
"label": "",
"readOnly": false,
"value": ""
}
],
"optionsUrl": "",
"referencedObjectType": "",
"type": ""
}
}
],
"labels": {},
"objectRequestOptions": {
"properties": []
},
"objectTypes": [],
"published": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/automation/v4/actions/:appId/:definitionId?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 \"actionUrl\": \"\",\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/automation/v4/actions/:appId/:definitionId" {:query-params {:hapikey "{{apiKey}}"}
:content-type :json
:form-params {:actionUrl ""
:inputFieldDependencies []
:inputFields [{:isRequired false
:supportedValueTypes []
:typeDefinition {:fieldType ""
:name ""
:options [{:description ""
:displayOrder 0
:doubleData ""
:hidden false
:label ""
:readOnly false
:value ""}]
:optionsUrl ""
:referencedObjectType ""
:type ""}}]
:labels {}
:objectRequestOptions {:properties []}
:objectTypes []
:published false}})
require "http/client"
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"actionUrl\": \"\",\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\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}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D"),
Content = new StringContent("{\n \"actionUrl\": \"\",\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\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}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"actionUrl\": \"\",\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D"
payload := strings.NewReader("{\n \"actionUrl\": \"\",\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\n}")
req, _ := http.NewRequest("PATCH", 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))
}
PATCH /baseUrl/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 679
{
"actionUrl": "",
"inputFieldDependencies": [],
"inputFields": [
{
"isRequired": false,
"supportedValueTypes": [],
"typeDefinition": {
"fieldType": "",
"name": "",
"options": [
{
"description": "",
"displayOrder": 0,
"doubleData": "",
"hidden": false,
"label": "",
"readOnly": false,
"value": ""
}
],
"optionsUrl": "",
"referencedObjectType": "",
"type": ""
}
}
],
"labels": {},
"objectRequestOptions": {
"properties": []
},
"objectTypes": [],
"published": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D")
.setHeader("content-type", "application/json")
.setBody("{\n \"actionUrl\": \"\",\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"actionUrl\": \"\",\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\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 \"actionUrl\": \"\",\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D")
.header("content-type", "application/json")
.body("{\n \"actionUrl\": \"\",\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\n}")
.asString();
const data = JSON.stringify({
actionUrl: '',
inputFieldDependencies: [],
inputFields: [
{
isRequired: false,
supportedValueTypes: [],
typeDefinition: {
fieldType: '',
name: '',
options: [
{
description: '',
displayOrder: 0,
doubleData: '',
hidden: false,
label: '',
readOnly: false,
value: ''
}
],
optionsUrl: '',
referencedObjectType: '',
type: ''
}
}
],
labels: {},
objectRequestOptions: {
properties: []
},
objectTypes: [],
published: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/automation/v4/actions/:appId/:definitionId',
params: {hapikey: '{{apiKey}}'},
headers: {'content-type': 'application/json'},
data: {
actionUrl: '',
inputFieldDependencies: [],
inputFields: [
{
isRequired: false,
supportedValueTypes: [],
typeDefinition: {
fieldType: '',
name: '',
options: [
{
description: '',
displayOrder: 0,
doubleData: '',
hidden: false,
label: '',
readOnly: false,
value: ''
}
],
optionsUrl: '',
referencedObjectType: '',
type: ''
}
}
],
labels: {},
objectRequestOptions: {properties: []},
objectTypes: [],
published: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"actionUrl":"","inputFieldDependencies":[],"inputFields":[{"isRequired":false,"supportedValueTypes":[],"typeDefinition":{"fieldType":"","name":"","options":[{"description":"","displayOrder":0,"doubleData":"","hidden":false,"label":"","readOnly":false,"value":""}],"optionsUrl":"","referencedObjectType":"","type":""}}],"labels":{},"objectRequestOptions":{"properties":[]},"objectTypes":[],"published":false}'
};
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}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "actionUrl": "",\n "inputFieldDependencies": [],\n "inputFields": [\n {\n "isRequired": false,\n "supportedValueTypes": [],\n "typeDefinition": {\n "fieldType": "",\n "name": "",\n "options": [\n {\n "description": "",\n "displayOrder": 0,\n "doubleData": "",\n "hidden": false,\n "label": "",\n "readOnly": false,\n "value": ""\n }\n ],\n "optionsUrl": "",\n "referencedObjectType": "",\n "type": ""\n }\n }\n ],\n "labels": {},\n "objectRequestOptions": {\n "properties": []\n },\n "objectTypes": [],\n "published": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"actionUrl\": \"\",\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D")
.patch(body)
.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/automation/v4/actions/:appId/:definitionId?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({
actionUrl: '',
inputFieldDependencies: [],
inputFields: [
{
isRequired: false,
supportedValueTypes: [],
typeDefinition: {
fieldType: '',
name: '',
options: [
{
description: '',
displayOrder: 0,
doubleData: '',
hidden: false,
label: '',
readOnly: false,
value: ''
}
],
optionsUrl: '',
referencedObjectType: '',
type: ''
}
}
],
labels: {},
objectRequestOptions: {properties: []},
objectTypes: [],
published: false
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/automation/v4/actions/:appId/:definitionId',
qs: {hapikey: '{{apiKey}}'},
headers: {'content-type': 'application/json'},
body: {
actionUrl: '',
inputFieldDependencies: [],
inputFields: [
{
isRequired: false,
supportedValueTypes: [],
typeDefinition: {
fieldType: '',
name: '',
options: [
{
description: '',
displayOrder: 0,
doubleData: '',
hidden: false,
label: '',
readOnly: false,
value: ''
}
],
optionsUrl: '',
referencedObjectType: '',
type: ''
}
}
],
labels: {},
objectRequestOptions: {properties: []},
objectTypes: [],
published: false
},
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}}/automation/v4/actions/:appId/:definitionId');
req.query({
hapikey: '{{apiKey}}'
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
actionUrl: '',
inputFieldDependencies: [],
inputFields: [
{
isRequired: false,
supportedValueTypes: [],
typeDefinition: {
fieldType: '',
name: '',
options: [
{
description: '',
displayOrder: 0,
doubleData: '',
hidden: false,
label: '',
readOnly: false,
value: ''
}
],
optionsUrl: '',
referencedObjectType: '',
type: ''
}
}
],
labels: {},
objectRequestOptions: {
properties: []
},
objectTypes: [],
published: false
});
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}}/automation/v4/actions/:appId/:definitionId',
params: {hapikey: '{{apiKey}}'},
headers: {'content-type': 'application/json'},
data: {
actionUrl: '',
inputFieldDependencies: [],
inputFields: [
{
isRequired: false,
supportedValueTypes: [],
typeDefinition: {
fieldType: '',
name: '',
options: [
{
description: '',
displayOrder: 0,
doubleData: '',
hidden: false,
label: '',
readOnly: false,
value: ''
}
],
optionsUrl: '',
referencedObjectType: '',
type: ''
}
}
],
labels: {},
objectRequestOptions: {properties: []},
objectTypes: [],
published: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"actionUrl":"","inputFieldDependencies":[],"inputFields":[{"isRequired":false,"supportedValueTypes":[],"typeDefinition":{"fieldType":"","name":"","options":[{"description":"","displayOrder":0,"doubleData":"","hidden":false,"label":"","readOnly":false,"value":""}],"optionsUrl":"","referencedObjectType":"","type":""}}],"labels":{},"objectRequestOptions":{"properties":[]},"objectTypes":[],"published":false}'
};
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 = @{ @"actionUrl": @"",
@"inputFieldDependencies": @[ ],
@"inputFields": @[ @{ @"isRequired": @NO, @"supportedValueTypes": @[ ], @"typeDefinition": @{ @"fieldType": @"", @"name": @"", @"options": @[ @{ @"description": @"", @"displayOrder": @0, @"doubleData": @"", @"hidden": @NO, @"label": @"", @"readOnly": @NO, @"value": @"" } ], @"optionsUrl": @"", @"referencedObjectType": @"", @"type": @"" } } ],
@"labels": @{ },
@"objectRequestOptions": @{ @"properties": @[ ] },
@"objectTypes": @[ ],
@"published": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D"]
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}}/automation/v4/actions/:appId/:definitionId?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 \"actionUrl\": \"\",\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/automation/v4/actions/:appId/:definitionId?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 => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'actionUrl' => '',
'inputFieldDependencies' => [
],
'inputFields' => [
[
'isRequired' => null,
'supportedValueTypes' => [
],
'typeDefinition' => [
'fieldType' => '',
'name' => '',
'options' => [
[
'description' => '',
'displayOrder' => 0,
'doubleData' => '',
'hidden' => null,
'label' => '',
'readOnly' => null,
'value' => ''
]
],
'optionsUrl' => '',
'referencedObjectType' => '',
'type' => ''
]
]
],
'labels' => [
],
'objectRequestOptions' => [
'properties' => [
]
],
'objectTypes' => [
],
'published' => null
]),
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('PATCH', '{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D', [
'body' => '{
"actionUrl": "",
"inputFieldDependencies": [],
"inputFields": [
{
"isRequired": false,
"supportedValueTypes": [],
"typeDefinition": {
"fieldType": "",
"name": "",
"options": [
{
"description": "",
"displayOrder": 0,
"doubleData": "",
"hidden": false,
"label": "",
"readOnly": false,
"value": ""
}
],
"optionsUrl": "",
"referencedObjectType": "",
"type": ""
}
}
],
"labels": {},
"objectRequestOptions": {
"properties": []
},
"objectTypes": [],
"published": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setQueryData([
'hapikey' => '{{apiKey}}'
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'actionUrl' => '',
'inputFieldDependencies' => [
],
'inputFields' => [
[
'isRequired' => null,
'supportedValueTypes' => [
],
'typeDefinition' => [
'fieldType' => '',
'name' => '',
'options' => [
[
'description' => '',
'displayOrder' => 0,
'doubleData' => '',
'hidden' => null,
'label' => '',
'readOnly' => null,
'value' => ''
]
],
'optionsUrl' => '',
'referencedObjectType' => '',
'type' => ''
]
]
],
'labels' => [
],
'objectRequestOptions' => [
'properties' => [
]
],
'objectTypes' => [
],
'published' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'actionUrl' => '',
'inputFieldDependencies' => [
],
'inputFields' => [
[
'isRequired' => null,
'supportedValueTypes' => [
],
'typeDefinition' => [
'fieldType' => '',
'name' => '',
'options' => [
[
'description' => '',
'displayOrder' => 0,
'doubleData' => '',
'hidden' => null,
'label' => '',
'readOnly' => null,
'value' => ''
]
],
'optionsUrl' => '',
'referencedObjectType' => '',
'type' => ''
]
]
],
'labels' => [
],
'objectRequestOptions' => [
'properties' => [
]
],
'objectTypes' => [
],
'published' => null
]));
$request->setRequestUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId');
$request->setRequestMethod('PATCH');
$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}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"actionUrl": "",
"inputFieldDependencies": [],
"inputFields": [
{
"isRequired": false,
"supportedValueTypes": [],
"typeDefinition": {
"fieldType": "",
"name": "",
"options": [
{
"description": "",
"displayOrder": 0,
"doubleData": "",
"hidden": false,
"label": "",
"readOnly": false,
"value": ""
}
],
"optionsUrl": "",
"referencedObjectType": "",
"type": ""
}
}
],
"labels": {},
"objectRequestOptions": {
"properties": []
},
"objectTypes": [],
"published": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"actionUrl": "",
"inputFieldDependencies": [],
"inputFields": [
{
"isRequired": false,
"supportedValueTypes": [],
"typeDefinition": {
"fieldType": "",
"name": "",
"options": [
{
"description": "",
"displayOrder": 0,
"doubleData": "",
"hidden": false,
"label": "",
"readOnly": false,
"value": ""
}
],
"optionsUrl": "",
"referencedObjectType": "",
"type": ""
}
}
],
"labels": {},
"objectRequestOptions": {
"properties": []
},
"objectTypes": [],
"published": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"actionUrl\": \"\",\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId"
querystring = {"hapikey":"{{apiKey}}"}
payload = {
"actionUrl": "",
"inputFieldDependencies": [],
"inputFields": [
{
"isRequired": False,
"supportedValueTypes": [],
"typeDefinition": {
"fieldType": "",
"name": "",
"options": [
{
"description": "",
"displayOrder": 0,
"doubleData": "",
"hidden": False,
"label": "",
"readOnly": False,
"value": ""
}
],
"optionsUrl": "",
"referencedObjectType": "",
"type": ""
}
}
],
"labels": {},
"objectRequestOptions": { "properties": [] },
"objectTypes": [],
"published": False
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/automation/v4/actions/:appId/:definitionId"
queryString <- list(hapikey = "{{apiKey}}")
payload <- "{\n \"actionUrl\": \"\",\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"actionUrl\": \"\",\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\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/automation/v4/actions/:appId/:definitionId') do |req|
req.params['hapikey'] = '{{apiKey}}'
req.body = "{\n \"actionUrl\": \"\",\n \"inputFieldDependencies\": [],\n \"inputFields\": [\n {\n \"isRequired\": false,\n \"supportedValueTypes\": [],\n \"typeDefinition\": {\n \"fieldType\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"description\": \"\",\n \"displayOrder\": 0,\n \"doubleData\": \"\",\n \"hidden\": false,\n \"label\": \"\",\n \"readOnly\": false,\n \"value\": \"\"\n }\n ],\n \"optionsUrl\": \"\",\n \"referencedObjectType\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"labels\": {},\n \"objectRequestOptions\": {\n \"properties\": []\n },\n \"objectTypes\": [],\n \"published\": false\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}}/automation/v4/actions/:appId/:definitionId";
let querystring = [
("hapikey", "{{apiKey}}"),
];
let payload = json!({
"actionUrl": "",
"inputFieldDependencies": (),
"inputFields": (
json!({
"isRequired": false,
"supportedValueTypes": (),
"typeDefinition": json!({
"fieldType": "",
"name": "",
"options": (
json!({
"description": "",
"displayOrder": 0,
"doubleData": "",
"hidden": false,
"label": "",
"readOnly": false,
"value": ""
})
),
"optionsUrl": "",
"referencedObjectType": "",
"type": ""
})
})
),
"labels": json!({}),
"objectRequestOptions": json!({"properties": ()}),
"objectTypes": (),
"published": false
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D' \
--header 'content-type: application/json' \
--data '{
"actionUrl": "",
"inputFieldDependencies": [],
"inputFields": [
{
"isRequired": false,
"supportedValueTypes": [],
"typeDefinition": {
"fieldType": "",
"name": "",
"options": [
{
"description": "",
"displayOrder": 0,
"doubleData": "",
"hidden": false,
"label": "",
"readOnly": false,
"value": ""
}
],
"optionsUrl": "",
"referencedObjectType": "",
"type": ""
}
}
],
"labels": {},
"objectRequestOptions": {
"properties": []
},
"objectTypes": [],
"published": false
}'
echo '{
"actionUrl": "",
"inputFieldDependencies": [],
"inputFields": [
{
"isRequired": false,
"supportedValueTypes": [],
"typeDefinition": {
"fieldType": "",
"name": "",
"options": [
{
"description": "",
"displayOrder": 0,
"doubleData": "",
"hidden": false,
"label": "",
"readOnly": false,
"value": ""
}
],
"optionsUrl": "",
"referencedObjectType": "",
"type": ""
}
}
],
"labels": {},
"objectRequestOptions": {
"properties": []
},
"objectTypes": [],
"published": false
}' | \
http PATCH '{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D' \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "actionUrl": "",\n "inputFieldDependencies": [],\n "inputFields": [\n {\n "isRequired": false,\n "supportedValueTypes": [],\n "typeDefinition": {\n "fieldType": "",\n "name": "",\n "options": [\n {\n "description": "",\n "displayOrder": 0,\n "doubleData": "",\n "hidden": false,\n "label": "",\n "readOnly": false,\n "value": ""\n }\n ],\n "optionsUrl": "",\n "referencedObjectType": "",\n "type": ""\n }\n }\n ],\n "labels": {},\n "objectRequestOptions": {\n "properties": []\n },\n "objectTypes": [],\n "published": false\n}' \
--output-document \
- '{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D'
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"actionUrl": "",
"inputFieldDependencies": [],
"inputFields": [
[
"isRequired": false,
"supportedValueTypes": [],
"typeDefinition": [
"fieldType": "",
"name": "",
"options": [
[
"description": "",
"displayOrder": 0,
"doubleData": "",
"hidden": false,
"label": "",
"readOnly": false,
"value": ""
]
],
"optionsUrl": "",
"referencedObjectType": "",
"type": ""
]
]
],
"labels": [],
"objectRequestOptions": ["properties": []],
"objectTypes": [],
"published": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/automation/v4/actions/:appId/:definitionId?hapikey=%7B%7BapiKey%7D%7D")! 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
application/json
RESPONSE BODY json
{
"actionUrl": "https://example.com/custom-workflow-action",
"functions": [
{
"functionType": "PRE_ACTION_EXECUTION"
},
{
"functionType": "PRE_FETCH_OPTIONS",
"id": "widgetSize"
}
],
"id": "1",
"inputFieldDependencies": [
{
"controllingFieldName": "widgetSize",
"dependencyType": "SINGLE_FIELD",
"dependentFieldNames": [
"widgetName",
"widgetColor"
]
}
],
"inputFields": [
{
"required": true,
"supportedValueTypes": [
"OBJECT_PROPERTY"
],
"typeDefinition": {
"fieldType": "text",
"name": "widgetName",
"type": "string"
}
},
{
"required": false,
"supportedValueTypes": [
"STATIC_VALUE"
],
"typeDefinition": {
"fieldType": "enumeration",
"name": "widgetColor",
"options": [
{
"label": "Blue",
"value": "blue"
},
{
"label": "Red",
"value": "red"
},
{
"label": "Green",
"value": "green"
}
],
"type": "string"
}
},
{
"required": false,
"supportedValueTypes": [
"STATIC_VALUE"
],
"typeDefinition": {
"fieldType": "enumeration",
"name": "widgetSize",
"optionsUrl": "https://example.com/widget-sizes",
"type": "string"
}
}
],
"labels": {
"en": {
"actionCardContent": "Create new widget {{ widgetName }}",
"actionDescription": "This action will create a new widget in our system. So cool!",
"actionName": "Create new widget",
"inputFieldDescriptions": {
"widgetColor": "This is the color that will be used to paint the widget.",
"widgetName": "Enter the full widget name. I support links too."
},
"inputFieldLabels": {
"widgetColor": "Widget Color",
"widgetName": "Widget Name",
"widgetSize": "Widget Size"
}
}
},
"objectRequestOptions": {
"properties": [
"firstname",
"lastname",
"preferred_widget"
]
},
"objectTypes": [
"CONTACT",
"COMPANY"
],
"published": true,
"revisionId": "1"
}
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
Create or replace a custom action function (PUT)
{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId
QUERY PARAMS
hapikey
{{apiKey}}
definitionId
functionType
functionId
appId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId" {:query-params {:hapikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D"
response = HTTP::Client.put url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D");
var request = new RestRequest("", Method.Put);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D"
req, _ := http.NewRequest("PUT", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D"))
.method("PUT", 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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D")
.put(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?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('PUT', '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId',
params: {hapikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D';
const options = {method: 'PUT'};
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D',
method: 'PUT',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D")
.put(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?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: 'PUT',
url: '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId',
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('PUT', '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId');
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: 'PUT',
url: '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId',
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D';
const options = {method: 'PUT'};
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D" in
Client.call `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?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 => "PUT",
CURLOPT_POSTFIELDS => "",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D');
echo $response->getBody();
setUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'hapikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId');
$request->setRequestMethod('PUT');
$request->setQuery(new http\QueryString([
'hapikey' => '{{apiKey}}'
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D' -Method PUT
$response = Invoke-RestMethod -Uri '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D' -Method PUT
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = ""
conn.request("PUT", "/baseUrl/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D", payload)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId"
querystring = {"hapikey":"{{apiKey}}"}
payload = ""
response = requests.put(url, data=payload, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId"
queryString <- list(hapikey = "{{apiKey}}")
payload <- ""
response <- VERB("PUT", url, body = payload, query = queryString, content_type(""))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.put('/baseUrl/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId') do |req|
req.params['hapikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId";
let querystring = [
("hapikey", "{{apiKey}}"),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D'
http PUT '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D'
wget --quiet \
--method PUT \
--output-document \
- '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
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
application/json
RESPONSE BODY json
{
"functionType": "PRE_FETCH_OPTIONS",
"id": "widgetSize"
}
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
Create or replace a custom action function
{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType
QUERY PARAMS
hapikey
{{apiKey}}
definitionId
functionType
appId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType" {:query-params {:hapikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D"
response = HTTP::Client.put url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D");
var request = new RestRequest("", Method.Put);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D"
req, _ := http.NewRequest("PUT", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D"))
.method("PUT", 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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D")
.put(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?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('PUT', '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType',
params: {hapikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D';
const options = {method: 'PUT'};
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D',
method: 'PUT',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D")
.put(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/automation/v4/actions/:appId/:definitionId/functions/:functionType?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: 'PUT',
url: '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType',
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('PUT', '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType');
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: 'PUT',
url: '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType',
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D';
const options = {method: 'PUT'};
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D" in
Client.call `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?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 => "PUT",
CURLOPT_POSTFIELDS => "",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D');
echo $response->getBody();
setUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'hapikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType');
$request->setRequestMethod('PUT');
$request->setQuery(new http\QueryString([
'hapikey' => '{{apiKey}}'
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D' -Method PUT
$response = Invoke-RestMethod -Uri '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D' -Method PUT
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = ""
conn.request("PUT", "/baseUrl/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D", payload)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType"
querystring = {"hapikey":"{{apiKey}}"}
payload = ""
response = requests.put(url, data=payload, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType"
queryString <- list(hapikey = "{{apiKey}}")
payload <- ""
response <- VERB("PUT", url, body = payload, query = queryString, content_type(""))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.put('/baseUrl/automation/v4/actions/:appId/:definitionId/functions/:functionType') do |req|
req.params['hapikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType";
let querystring = [
("hapikey", "{{apiKey}}"),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D'
http PUT '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D'
wget --quiet \
--method PUT \
--output-document \
- '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
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
application/json
RESPONSE BODY json
{
"functionType": "PRE_ACTION_EXECUTION"
}
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 a custom action function (DELETE)
{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId
QUERY PARAMS
hapikey
{{apiKey}}
definitionId
functionType
functionId
appId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId" {:query-params {:hapikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D"))
.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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?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('DELETE', '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId',
params: {hapikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D';
const options = {method: 'DELETE'};
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?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: 'DELETE',
url: '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId',
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('DELETE', '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId');
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: 'DELETE',
url: '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId',
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D';
const options = {method: 'DELETE'};
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?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 => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D');
echo $response->getBody();
setUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'hapikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'hapikey' => '{{apiKey}}'
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId"
querystring = {"hapikey":"{{apiKey}}"}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId"
queryString <- list(hapikey = "{{apiKey}}")
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId') do |req|
req.params['hapikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId";
let querystring = [
("hapikey", "{{apiKey}}"),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D'
http DELETE '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D'
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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 a custom action function
{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType
QUERY PARAMS
hapikey
{{apiKey}}
definitionId
functionType
appId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType" {:query-params {:hapikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D"))
.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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?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('DELETE', '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType',
params: {hapikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D';
const options = {method: 'DELETE'};
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/automation/v4/actions/:appId/:definitionId/functions/:functionType?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: 'DELETE',
url: '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType',
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('DELETE', '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType');
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: 'DELETE',
url: '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType',
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D';
const options = {method: 'DELETE'};
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?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 => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D');
echo $response->getBody();
setUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'hapikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'hapikey' => '{{apiKey}}'
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType"
querystring = {"hapikey":"{{apiKey}}"}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType"
queryString <- list(hapikey = "{{apiKey}}")
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/automation/v4/actions/:appId/:definitionId/functions/:functionType') do |req|
req.params['hapikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType";
let querystring = [
("hapikey", "{{apiKey}}"),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D'
http DELETE '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D'
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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 a custom action function (GET)
{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId
QUERY PARAMS
hapikey
{{apiKey}}
definitionId
functionType
functionId
appId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId" {:query-params {:hapikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?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/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId',
params: {hapikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?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/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId',
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId');
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId',
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D');
echo $response->getBody();
setUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'hapikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId');
$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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId"
querystring = {"hapikey":"{{apiKey}}"}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId"
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?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/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId') do |req|
req.params['hapikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId";
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D'
http GET '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D'
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?hapikey=%7B%7BapiKey%7D%7D'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType/:functionId?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
application/json
RESPONSE BODY json
{
"functionSource": "exports.main = (event, callback) => { return callback(transformRequest(event)); };\nfunction transformRequest(request) { return { webhookUrl: request.webhookUrl, body: JSON.stringify(request.body), httpMethod: \"POST\" } }",
"functionType": "PRE_FETCH_OPTIONS",
"id": "widgetSize"
}
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 a custom action function
{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType
QUERY PARAMS
hapikey
{{apiKey}}
definitionId
functionType
appId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType" {:query-params {:hapikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?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/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType',
params: {hapikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?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/automation/v4/actions/:appId/:definitionId/functions/:functionType?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType',
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType');
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType',
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D');
echo $response->getBody();
setUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'hapikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType');
$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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType"
querystring = {"hapikey":"{{apiKey}}"}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType"
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?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/automation/v4/actions/:appId/:definitionId/functions/:functionType') do |req|
req.params['hapikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType";
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}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D'
http GET '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D'
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?hapikey=%7B%7BapiKey%7D%7D'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions/:functionType?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
application/json
RESPONSE BODY json
{
"functionSource": "exports.main = (event, callback) => { return callback(transformRequest(event)); };\nfunction transformRequest(request) { return { webhookUrl: request.webhookUrl, body: JSON.stringify(request.body), httpMethod: \"POST\" } }",
"functionType": "PRE_ACTION_EXECUTION"
}
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 all custom action functions
{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions
QUERY PARAMS
hapikey
{{apiKey}}
definitionId
appId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions?hapikey=%7B%7BapiKey%7D%7D");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions" {:query-params {:hapikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions?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}}/automation/v4/actions/:appId/:definitionId/functions?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}}/automation/v4/actions/:appId/:definitionId/functions?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}}/automation/v4/actions/:appId/:definitionId/functions?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/automation/v4/actions/:appId/:definitionId/functions?hapikey=%7B%7BapiKey%7D%7D HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions?hapikey=%7B%7BapiKey%7D%7D")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions?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}}/automation/v4/actions/:appId/:definitionId/functions?hapikey=%7B%7BapiKey%7D%7D")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions?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}}/automation/v4/actions/:appId/:definitionId/functions?hapikey=%7B%7BapiKey%7D%7D');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions',
params: {hapikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions?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}}/automation/v4/actions/:appId/:definitionId/functions?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}}/automation/v4/actions/:appId/:definitionId/functions?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/automation/v4/actions/:appId/:definitionId/functions?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}}/automation/v4/actions/:appId/:definitionId/functions',
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}}/automation/v4/actions/:appId/:definitionId/functions');
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}}/automation/v4/actions/:appId/:definitionId/functions',
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}}/automation/v4/actions/:appId/:definitionId/functions?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}}/automation/v4/actions/:appId/:definitionId/functions?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}}/automation/v4/actions/:appId/:definitionId/functions?hapikey=%7B%7BapiKey%7D%7D" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions?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}}/automation/v4/actions/:appId/:definitionId/functions?hapikey=%7B%7BapiKey%7D%7D');
echo $response->getBody();
setUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'hapikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions');
$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}}/automation/v4/actions/:appId/:definitionId/functions?hapikey=%7B%7BapiKey%7D%7D' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions?hapikey=%7B%7BapiKey%7D%7D' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/automation/v4/actions/:appId/:definitionId/functions?hapikey=%7B%7BapiKey%7D%7D")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions"
querystring = {"hapikey":"{{apiKey}}"}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions"
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}}/automation/v4/actions/:appId/:definitionId/functions?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/automation/v4/actions/:appId/:definitionId/functions') do |req|
req.params['hapikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions";
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}}/automation/v4/actions/:appId/:definitionId/functions?hapikey=%7B%7BapiKey%7D%7D'
http GET '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions?hapikey=%7B%7BapiKey%7D%7D'
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions?hapikey=%7B%7BapiKey%7D%7D'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/functions?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
application/json
RESPONSE BODY json
{
"paging": {
"next": {
"after": "b3B0aW9uXzEy"
}
},
"results": [
{
"functionType": "PRE_ACTION_EXECUTION"
},
{
"functionType": "PRE_FETCH_OPTIONS",
"id": "widgetSize"
}
]
}
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 a revision for a custom action
{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId
QUERY PARAMS
hapikey
{{apiKey}}
definitionId
revisionId
appId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?hapikey=%7B%7BapiKey%7D%7D");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId" {:query-params {:hapikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?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}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?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}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?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}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?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/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?hapikey=%7B%7BapiKey%7D%7D HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?hapikey=%7B%7BapiKey%7D%7D")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?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}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?hapikey=%7B%7BapiKey%7D%7D")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?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}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?hapikey=%7B%7BapiKey%7D%7D');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId',
params: {hapikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?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}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?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}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?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/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?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}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId',
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}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId');
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}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId',
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}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?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}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?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}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?hapikey=%7B%7BapiKey%7D%7D" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?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}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?hapikey=%7B%7BapiKey%7D%7D');
echo $response->getBody();
setUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'hapikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId');
$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}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?hapikey=%7B%7BapiKey%7D%7D' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?hapikey=%7B%7BapiKey%7D%7D' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?hapikey=%7B%7BapiKey%7D%7D")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId"
querystring = {"hapikey":"{{apiKey}}"}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId"
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}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?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/automation/v4/actions/:appId/:definitionId/revisions/:revisionId') do |req|
req.params['hapikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId";
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}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?hapikey=%7B%7BapiKey%7D%7D'
http GET '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?hapikey=%7B%7BapiKey%7D%7D'
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?hapikey=%7B%7BapiKey%7D%7D'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions/:revisionId?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
application/json
RESPONSE BODY json
{
"definition": {
"actionUrl": "https://example.com/custom-workflow-action",
"functions": [
{
"functionType": "PRE_ACTION_EXECUTION"
},
{
"functionType": "PRE_FETCH_OPTIONS",
"id": "widgetSize"
}
],
"id": "1",
"inputFieldDependencies": [
{
"controllingFieldName": "widgetSize",
"dependencyType": "SINGLE_FIELD",
"dependentFieldNames": [
"widgetName",
"widgetColor"
]
}
],
"inputFields": [
{
"required": true,
"supportedValueTypes": [
"OBJECT_PROPERTY"
],
"typeDefinition": {
"fieldType": "text",
"name": "widgetName",
"type": "string"
}
},
{
"required": false,
"supportedValueTypes": [
"STATIC_VALUE"
],
"typeDefinition": {
"fieldType": "enumeration",
"name": "widgetColor",
"options": [
{
"label": "Blue",
"value": "blue"
},
{
"label": "Red",
"value": "red"
}
],
"type": "string"
}
},
{
"required": false,
"supportedValueTypes": [
"STATIC_VALUE"
],
"typeDefinition": {
"fieldType": "enumeration",
"name": "widgetSize",
"optionsUrl": "https://example.com/widget-sizes",
"type": "string"
}
}
],
"labels": {
"en": {
"actionCardContent": "Create new widget {{ widgetName }}",
"actionDescription": "This action will create a new widget in our system. So cool!",
"actionName": "Create new widget",
"inputFieldDescriptions": {
"widgetColor": "This is the color that will be used to paint the widget.",
"widgetName": "Enter the full widget name. I support links too."
},
"inputFieldLabels": {
"widgetColor": "Widget Color",
"widgetName": "Widget Name",
"widgetSize": "Widget Size"
}
}
},
"objectRequestOptions": {
"properties": [
"firstname",
"lastname",
"preferred_widget"
]
},
"objectTypes": [
"CONTACT",
"COMPANY"
],
"published": true,
"revisionId": "1"
},
"id": "1",
"insertedAt": "2020-04-30T00:00:00",
"revisionId": "1"
}
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 all revisions for a custom action
{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions
QUERY PARAMS
hapikey
{{apiKey}}
definitionId
appId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions?hapikey=%7B%7BapiKey%7D%7D");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions" {:query-params {:hapikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions?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}}/automation/v4/actions/:appId/:definitionId/revisions?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}}/automation/v4/actions/:appId/:definitionId/revisions?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}}/automation/v4/actions/:appId/:definitionId/revisions?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/automation/v4/actions/:appId/:definitionId/revisions?hapikey=%7B%7BapiKey%7D%7D HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions?hapikey=%7B%7BapiKey%7D%7D")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions?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}}/automation/v4/actions/:appId/:definitionId/revisions?hapikey=%7B%7BapiKey%7D%7D")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions?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}}/automation/v4/actions/:appId/:definitionId/revisions?hapikey=%7B%7BapiKey%7D%7D');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions',
params: {hapikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions?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}}/automation/v4/actions/:appId/:definitionId/revisions?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}}/automation/v4/actions/:appId/:definitionId/revisions?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/automation/v4/actions/:appId/:definitionId/revisions?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}}/automation/v4/actions/:appId/:definitionId/revisions',
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}}/automation/v4/actions/:appId/:definitionId/revisions');
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}}/automation/v4/actions/:appId/:definitionId/revisions',
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}}/automation/v4/actions/:appId/:definitionId/revisions?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}}/automation/v4/actions/:appId/:definitionId/revisions?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}}/automation/v4/actions/:appId/:definitionId/revisions?hapikey=%7B%7BapiKey%7D%7D" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions?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}}/automation/v4/actions/:appId/:definitionId/revisions?hapikey=%7B%7BapiKey%7D%7D');
echo $response->getBody();
setUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'hapikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions');
$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}}/automation/v4/actions/:appId/:definitionId/revisions?hapikey=%7B%7BapiKey%7D%7D' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions?hapikey=%7B%7BapiKey%7D%7D' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/automation/v4/actions/:appId/:definitionId/revisions?hapikey=%7B%7BapiKey%7D%7D")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions"
querystring = {"hapikey":"{{apiKey}}"}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions"
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}}/automation/v4/actions/:appId/:definitionId/revisions?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/automation/v4/actions/:appId/:definitionId/revisions') do |req|
req.params['hapikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions";
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}}/automation/v4/actions/:appId/:definitionId/revisions?hapikey=%7B%7BapiKey%7D%7D'
http GET '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions?hapikey=%7B%7BapiKey%7D%7D'
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions?hapikey=%7B%7BapiKey%7D%7D'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/automation/v4/actions/:appId/:definitionId/revisions?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
application/json
RESPONSE BODY json
{
"paging": {
"next": {
"after": "b3B0aW9uXzEy"
}
},
"results": [
{
"definition": {
"actionUrl": "https://example.com/custom-workflow-action",
"functions": [
{
"functionType": "PRE_ACTION_EXECUTION"
},
{
"functionType": "PRE_FETCH_OPTIONS",
"id": "widgetSize"
}
],
"id": "1",
"inputFieldDependencies": [
{
"controllingFieldName": "widgetSize",
"dependencyType": "SINGLE_FIELD",
"dependentFieldNames": [
"widgetName",
"widgetColor"
]
}
],
"inputFields": [
{
"required": true,
"supportedValueTypes": [
"OBJECT_PROPERTY"
],
"typeDefinition": {
"fieldType": "text",
"name": "widgetName",
"type": "string"
}
},
{
"required": false,
"supportedValueTypes": [
"STATIC_VALUE"
],
"typeDefinition": {
"fieldType": "enumeration",
"name": "widgetColor",
"options": [
{
"label": "Blue",
"value": "blue"
},
{
"label": "Red",
"value": "red"
}
],
"type": "string"
}
},
{
"required": false,
"supportedValueTypes": [
"STATIC_VALUE"
],
"typeDefinition": {
"fieldType": "enumeration",
"name": "widgetSize",
"optionsUrl": "https://example.com/widget-sizes",
"type": "string"
}
}
],
"labels": {
"en": {
"actionCardContent": "Create new widget {{ widgetName }}",
"actionDescription": "This action will create a new widget in our system. So cool!",
"actionName": "Create new widget",
"inputFieldDescriptions": {
"widgetColor": "This is the color that will be used to paint the widget.",
"widgetName": "Enter the full widget name. I support links too."
},
"inputFieldLabels": {
"widgetColor": "Widget Color",
"widgetName": "Widget Name",
"widgetSize": "Widget Size"
}
}
},
"objectRequestOptions": {
"properties": [
"firstname",
"lastname",
"preferred_widget"
]
},
"objectTypes": [
"CONTACT",
"COMPANY"
],
"published": true,
"revisionId": "1"
},
"id": "1",
"insertedAt": "2020-04-30T00:00:00",
"revisionId": "1"
},
{
"definition": {
"actionUrl": "https://example.com/custom-workflow-action-2",
"id": "2",
"published": false,
"revisionId": "1"
},
"id": "2",
"insertedAt": "2020-04-30T00:00:00",
"revisionId": "1"
}
]
}
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)"
}