Deals
PUT
Associate a deal with another object
{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType
QUERY PARAMS
dealId
toObjectType
toObjectId
associationType
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType")
require "http/client"
url = "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType"
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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType");
var request = new RestRequest("", Method.Put);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType"
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/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType"))
.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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType")
.put(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType")
.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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType';
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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType',
method: 'PUT',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType")
.put(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType',
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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType');
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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType';
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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType"]
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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType" in
Client.call `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType');
echo $response->getBody();
setUrl('{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType');
$request->setMethod(HTTP_METH_PUT);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType');
$request->setRequestMethod('PUT');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType' -Method PUT
$response = Invoke-RestMethod -Uri '{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType' -Method PUT
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("PUT", "/baseUrl/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType"
response = requests.put(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType"
response <- VERB("PUT", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType")
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/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType
http PUT {{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType
wget --quiet \
--method PUT \
--output-document \
- {{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType")! 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
{
"associations": {
"contacts": {
"results": [
{
"id": "354229",
"type": "contact_to_company"
}
]
}
},
"createdAt": "2019-10-30T03:30:17.883Z",
"archived": false,
"id": "574148",
"properties": {},
"updatedAt": "2019-12-07T16:50:06.678Z"
}
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
GET
List associations of a deal by type
{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType
QUERY PARAMS
dealId
toObjectType
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType")
require "http/client"
url = "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType"
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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType"
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/crm/v3/objects/deals/:dealId/associations/:toObjectType HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType"))
.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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType")
.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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType';
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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/crm/v3/objects/deals/:dealId/associations/:toObjectType',
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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType');
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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType';
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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType"]
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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType",
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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType');
echo $response->getBody();
setUrl('{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/crm/v3/objects/deals/:dealId/associations/:toObjectType")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType")
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/crm/v3/objects/deals/:dealId/associations/:toObjectType') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType
http GET {{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType")! 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": {
"link": "?after=NTI1Cg%3D%3D",
"after": "NTI1Cg%3D%3D"
}
}
}
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
DELETE
Remove an association between two deals
{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType
QUERY PARAMS
dealId
toObjectType
toObjectId
associationType
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType")
require "http/client"
url = "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType"
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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType"
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/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType"))
.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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType")
.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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType';
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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType',
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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType');
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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType';
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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType"]
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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType",
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}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType');
echo $response->getBody();
setUrl('{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType")
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/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType
http DELETE {{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/crm/v3/objects/deals/:dealId/associations/:toObjectType/:toObjectId/:associationType")! 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
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
DELETE
Archive
{{baseUrl}}/crm/v3/objects/deals/:dealId
QUERY PARAMS
dealId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/crm/v3/objects/deals/:dealId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/crm/v3/objects/deals/:dealId")
require "http/client"
url = "{{baseUrl}}/crm/v3/objects/deals/:dealId"
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}}/crm/v3/objects/deals/:dealId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/crm/v3/objects/deals/:dealId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/crm/v3/objects/deals/:dealId"
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/crm/v3/objects/deals/:dealId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/crm/v3/objects/deals/:dealId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/crm/v3/objects/deals/:dealId"))
.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}}/crm/v3/objects/deals/:dealId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/crm/v3/objects/deals/:dealId")
.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}}/crm/v3/objects/deals/:dealId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/crm/v3/objects/deals/:dealId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/crm/v3/objects/deals/:dealId';
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}}/crm/v3/objects/deals/:dealId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/crm/v3/objects/deals/:dealId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/crm/v3/objects/deals/:dealId',
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}}/crm/v3/objects/deals/:dealId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/crm/v3/objects/deals/:dealId');
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}}/crm/v3/objects/deals/:dealId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/crm/v3/objects/deals/:dealId';
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}}/crm/v3/objects/deals/:dealId"]
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}}/crm/v3/objects/deals/:dealId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/crm/v3/objects/deals/:dealId",
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}}/crm/v3/objects/deals/:dealId');
echo $response->getBody();
setUrl('{{baseUrl}}/crm/v3/objects/deals/:dealId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/crm/v3/objects/deals/:dealId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/crm/v3/objects/deals/:dealId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/crm/v3/objects/deals/:dealId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/crm/v3/objects/deals/:dealId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/crm/v3/objects/deals/:dealId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/crm/v3/objects/deals/:dealId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/crm/v3/objects/deals/:dealId")
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/crm/v3/objects/deals/:dealId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/crm/v3/objects/deals/:dealId";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/crm/v3/objects/deals/:dealId
http DELETE {{baseUrl}}/crm/v3/objects/deals/:dealId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/crm/v3/objects/deals/:dealId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/crm/v3/objects/deals/:dealId")! 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
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Create
{{baseUrl}}/crm/v3/objects/deals
BODY json
{
"properties": {}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/crm/v3/objects/deals");
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 \"properties\": {}\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/crm/v3/objects/deals" {:content-type :json
:form-params {:properties {}}})
require "http/client"
url = "{{baseUrl}}/crm/v3/objects/deals"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"properties\": {}\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}}/crm/v3/objects/deals"),
Content = new StringContent("{\n \"properties\": {}\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}}/crm/v3/objects/deals");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"properties\": {}\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/crm/v3/objects/deals"
payload := strings.NewReader("{\n \"properties\": {}\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/crm/v3/objects/deals HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 22
{
"properties": {}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/crm/v3/objects/deals")
.setHeader("content-type", "application/json")
.setBody("{\n \"properties\": {}\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/crm/v3/objects/deals"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"properties\": {}\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 \"properties\": {}\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/crm/v3/objects/deals")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/crm/v3/objects/deals")
.header("content-type", "application/json")
.body("{\n \"properties\": {}\n}")
.asString();
const data = JSON.stringify({
properties: {}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/crm/v3/objects/deals');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/crm/v3/objects/deals',
headers: {'content-type': 'application/json'},
data: {properties: {}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/crm/v3/objects/deals';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"properties":{}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/crm/v3/objects/deals',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "properties": {}\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"properties\": {}\n}")
val request = Request.Builder()
.url("{{baseUrl}}/crm/v3/objects/deals")
.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/crm/v3/objects/deals',
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({properties: {}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/crm/v3/objects/deals',
headers: {'content-type': 'application/json'},
body: {properties: {}},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/crm/v3/objects/deals');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
properties: {}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/crm/v3/objects/deals',
headers: {'content-type': 'application/json'},
data: {properties: {}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/crm/v3/objects/deals';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"properties":{}}'
};
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 = @{ @"properties": @{ } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/crm/v3/objects/deals"]
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}}/crm/v3/objects/deals" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"properties\": {}\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/crm/v3/objects/deals",
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([
'properties' => [
]
]),
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}}/crm/v3/objects/deals', [
'body' => '{
"properties": {}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/crm/v3/objects/deals');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'properties' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'properties' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/crm/v3/objects/deals');
$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}}/crm/v3/objects/deals' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"properties": {}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/crm/v3/objects/deals' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"properties": {}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"properties\": {}\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/crm/v3/objects/deals", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/crm/v3/objects/deals"
payload = { "properties": {} }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/crm/v3/objects/deals"
payload <- "{\n \"properties\": {}\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}}/crm/v3/objects/deals")
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 \"properties\": {}\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/crm/v3/objects/deals') do |req|
req.body = "{\n \"properties\": {}\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/crm/v3/objects/deals";
let payload = json!({"properties": 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}}/crm/v3/objects/deals \
--header 'content-type: application/json' \
--data '{
"properties": {}
}'
echo '{
"properties": {}
}' | \
http POST {{baseUrl}}/crm/v3/objects/deals \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "properties": {}\n}' \
--output-document \
- {{baseUrl}}/crm/v3/objects/deals
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["properties": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/crm/v3/objects/deals")! 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
{
"createdAt": "2019-10-30T03:30:17.883Z",
"archived": false,
"id": "512",
"properties": {
"amount": "1500.00",
"closedate": "2019-12-07T16:50:06.678Z",
"createdate": "2019-10-30T03:30:17.883Z",
"dealname": "Custom data integrations",
"dealstage": "presentation scheduled",
"hs_lastmodifieddate": "2019-12-07T16:50:06.678Z",
"hubspot_owner_id": "910901",
"pipeline": "default"
},
"updatedAt": "2019-12-07T16:50:06.678Z"
}
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
GET
List
{{baseUrl}}/crm/v3/objects/deals
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/crm/v3/objects/deals");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/crm/v3/objects/deals")
require "http/client"
url = "{{baseUrl}}/crm/v3/objects/deals"
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}}/crm/v3/objects/deals"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/crm/v3/objects/deals");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/crm/v3/objects/deals"
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/crm/v3/objects/deals HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/crm/v3/objects/deals")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/crm/v3/objects/deals"))
.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}}/crm/v3/objects/deals")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/crm/v3/objects/deals")
.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}}/crm/v3/objects/deals');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/crm/v3/objects/deals'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/crm/v3/objects/deals';
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}}/crm/v3/objects/deals',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/crm/v3/objects/deals")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/crm/v3/objects/deals',
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}}/crm/v3/objects/deals'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/crm/v3/objects/deals');
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}}/crm/v3/objects/deals'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/crm/v3/objects/deals';
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}}/crm/v3/objects/deals"]
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}}/crm/v3/objects/deals" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/crm/v3/objects/deals",
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}}/crm/v3/objects/deals');
echo $response->getBody();
setUrl('{{baseUrl}}/crm/v3/objects/deals');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/crm/v3/objects/deals');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/crm/v3/objects/deals' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/crm/v3/objects/deals' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/crm/v3/objects/deals")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/crm/v3/objects/deals"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/crm/v3/objects/deals"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/crm/v3/objects/deals")
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/crm/v3/objects/deals') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/crm/v3/objects/deals";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/crm/v3/objects/deals
http GET {{baseUrl}}/crm/v3/objects/deals
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/crm/v3/objects/deals
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/crm/v3/objects/deals")! 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
{
"results": [
{
"properties": {
"amount": "1500.00",
"closedate": "2019-12-07T16:50:06.678Z",
"createdate": "2019-10-30T03:30:17.883Z",
"dealname": "Custom data integrations",
"dealstage": "presentation scheduled",
"hs_lastmodifieddate": "2019-12-07T16:50:06.678Z",
"hubspot_owner_id": "910901",
"pipeline": "default"
}
}
],
"paging": {
"next": {
"link": "?after=NTI1Cg%3D%3D",
"after": "NTI1Cg%3D%3D"
}
}
}
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
GET
Read
{{baseUrl}}/crm/v3/objects/deals/:dealId
QUERY PARAMS
dealId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/crm/v3/objects/deals/:dealId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/crm/v3/objects/deals/:dealId")
require "http/client"
url = "{{baseUrl}}/crm/v3/objects/deals/:dealId"
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}}/crm/v3/objects/deals/:dealId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/crm/v3/objects/deals/:dealId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/crm/v3/objects/deals/:dealId"
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/crm/v3/objects/deals/:dealId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/crm/v3/objects/deals/:dealId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/crm/v3/objects/deals/:dealId"))
.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}}/crm/v3/objects/deals/:dealId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/crm/v3/objects/deals/:dealId")
.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}}/crm/v3/objects/deals/:dealId');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/crm/v3/objects/deals/:dealId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/crm/v3/objects/deals/:dealId';
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}}/crm/v3/objects/deals/:dealId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/crm/v3/objects/deals/:dealId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/crm/v3/objects/deals/:dealId',
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}}/crm/v3/objects/deals/:dealId'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/crm/v3/objects/deals/:dealId');
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}}/crm/v3/objects/deals/:dealId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/crm/v3/objects/deals/:dealId';
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}}/crm/v3/objects/deals/:dealId"]
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}}/crm/v3/objects/deals/:dealId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/crm/v3/objects/deals/:dealId",
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}}/crm/v3/objects/deals/:dealId');
echo $response->getBody();
setUrl('{{baseUrl}}/crm/v3/objects/deals/:dealId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/crm/v3/objects/deals/:dealId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/crm/v3/objects/deals/:dealId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/crm/v3/objects/deals/:dealId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/crm/v3/objects/deals/:dealId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/crm/v3/objects/deals/:dealId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/crm/v3/objects/deals/:dealId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/crm/v3/objects/deals/:dealId")
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/crm/v3/objects/deals/:dealId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/crm/v3/objects/deals/:dealId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/crm/v3/objects/deals/:dealId
http GET {{baseUrl}}/crm/v3/objects/deals/:dealId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/crm/v3/objects/deals/:dealId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/crm/v3/objects/deals/:dealId")! 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
{
"properties": {
"amount": "1500.00",
"closedate": "2019-12-07T16:50:06.678Z",
"createdate": "2019-10-30T03:30:17.883Z",
"dealname": "Custom data integrations",
"dealstage": "presentation scheduled",
"hs_lastmodifieddate": "2019-12-07T16:50:06.678Z",
"hubspot_owner_id": "910901",
"pipeline": "default"
}
}
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
PATCH
Update
{{baseUrl}}/crm/v3/objects/deals/:dealId
QUERY PARAMS
dealId
BODY json
{
"properties": {}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/crm/v3/objects/deals/:dealId");
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 \"properties\": {}\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/crm/v3/objects/deals/:dealId" {:content-type :json
:form-params {:properties {}}})
require "http/client"
url = "{{baseUrl}}/crm/v3/objects/deals/:dealId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"properties\": {}\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}}/crm/v3/objects/deals/:dealId"),
Content = new StringContent("{\n \"properties\": {}\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}}/crm/v3/objects/deals/:dealId");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"properties\": {}\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/crm/v3/objects/deals/:dealId"
payload := strings.NewReader("{\n \"properties\": {}\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/crm/v3/objects/deals/:dealId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 22
{
"properties": {}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/crm/v3/objects/deals/:dealId")
.setHeader("content-type", "application/json")
.setBody("{\n \"properties\": {}\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/crm/v3/objects/deals/:dealId"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"properties\": {}\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 \"properties\": {}\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/crm/v3/objects/deals/:dealId")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/crm/v3/objects/deals/:dealId")
.header("content-type", "application/json")
.body("{\n \"properties\": {}\n}")
.asString();
const data = JSON.stringify({
properties: {}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/crm/v3/objects/deals/:dealId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/crm/v3/objects/deals/:dealId',
headers: {'content-type': 'application/json'},
data: {properties: {}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/crm/v3/objects/deals/:dealId';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"properties":{}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/crm/v3/objects/deals/:dealId',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "properties": {}\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"properties\": {}\n}")
val request = Request.Builder()
.url("{{baseUrl}}/crm/v3/objects/deals/:dealId")
.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/crm/v3/objects/deals/:dealId',
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({properties: {}}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/crm/v3/objects/deals/:dealId',
headers: {'content-type': 'application/json'},
body: {properties: {}},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/crm/v3/objects/deals/:dealId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
properties: {}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/crm/v3/objects/deals/:dealId',
headers: {'content-type': 'application/json'},
data: {properties: {}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/crm/v3/objects/deals/:dealId';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"properties":{}}'
};
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 = @{ @"properties": @{ } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/crm/v3/objects/deals/:dealId"]
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}}/crm/v3/objects/deals/:dealId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"properties\": {}\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/crm/v3/objects/deals/:dealId",
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([
'properties' => [
]
]),
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}}/crm/v3/objects/deals/:dealId', [
'body' => '{
"properties": {}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/crm/v3/objects/deals/:dealId');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'properties' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'properties' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/crm/v3/objects/deals/:dealId');
$request->setRequestMethod('PATCH');
$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}}/crm/v3/objects/deals/:dealId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"properties": {}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/crm/v3/objects/deals/:dealId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"properties": {}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"properties\": {}\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/crm/v3/objects/deals/:dealId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/crm/v3/objects/deals/:dealId"
payload = { "properties": {} }
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/crm/v3/objects/deals/:dealId"
payload <- "{\n \"properties\": {}\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/crm/v3/objects/deals/:dealId")
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 \"properties\": {}\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/crm/v3/objects/deals/:dealId') do |req|
req.body = "{\n \"properties\": {}\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}}/crm/v3/objects/deals/:dealId";
let payload = json!({"properties": json!({})});
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)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/crm/v3/objects/deals/:dealId \
--header 'content-type: application/json' \
--data '{
"properties": {}
}'
echo '{
"properties": {}
}' | \
http PATCH {{baseUrl}}/crm/v3/objects/deals/:dealId \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "properties": {}\n}' \
--output-document \
- {{baseUrl}}/crm/v3/objects/deals/:dealId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["properties": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/crm/v3/objects/deals/:dealId")! 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
{
"createdAt": "2019-10-30T03:30:17.883Z",
"archived": false,
"id": "512",
"properties": {
"amount": "1500.00",
"closedate": "2019-12-07T16:50:06.678Z",
"createdate": "2019-10-30T03:30:17.883Z",
"dealname": "Custom data integrations",
"dealstage": "presentation scheduled",
"hs_lastmodifieddate": "2019-12-07T16:50:06.678Z",
"hubspot_owner_id": "910901",
"pipeline": "default"
},
"updatedAt": "2019-12-07T16:50:06.678Z"
}
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Archive a batch of deals by ID
{{baseUrl}}/crm/v3/objects/deals/batch/archive
BODY json
{
"inputs": [
{
"id": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/crm/v3/objects/deals/batch/archive");
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 \"id\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/crm/v3/objects/deals/batch/archive" {:content-type :json
:form-params {:inputs [{:id ""}]}})
require "http/client"
url = "{{baseUrl}}/crm/v3/objects/deals/batch/archive"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"inputs\": [\n {\n \"id\": \"\"\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}}/crm/v3/objects/deals/batch/archive"),
Content = new StringContent("{\n \"inputs\": [\n {\n \"id\": \"\"\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}}/crm/v3/objects/deals/batch/archive");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"inputs\": [\n {\n \"id\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/crm/v3/objects/deals/batch/archive"
payload := strings.NewReader("{\n \"inputs\": [\n {\n \"id\": \"\"\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/crm/v3/objects/deals/batch/archive HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 48
{
"inputs": [
{
"id": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/crm/v3/objects/deals/batch/archive")
.setHeader("content-type", "application/json")
.setBody("{\n \"inputs\": [\n {\n \"id\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/crm/v3/objects/deals/batch/archive"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"inputs\": [\n {\n \"id\": \"\"\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 \"id\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/crm/v3/objects/deals/batch/archive")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/crm/v3/objects/deals/batch/archive")
.header("content-type", "application/json")
.body("{\n \"inputs\": [\n {\n \"id\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
inputs: [
{
id: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/crm/v3/objects/deals/batch/archive');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/crm/v3/objects/deals/batch/archive',
headers: {'content-type': 'application/json'},
data: {inputs: [{id: ''}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/crm/v3/objects/deals/batch/archive';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"inputs":[{"id":""}]}'
};
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}}/crm/v3/objects/deals/batch/archive',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "inputs": [\n {\n "id": ""\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 \"id\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/crm/v3/objects/deals/batch/archive")
.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/crm/v3/objects/deals/batch/archive',
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: [{id: ''}]}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/crm/v3/objects/deals/batch/archive',
headers: {'content-type': 'application/json'},
body: {inputs: [{id: ''}]},
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}}/crm/v3/objects/deals/batch/archive');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
inputs: [
{
id: ''
}
]
});
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}}/crm/v3/objects/deals/batch/archive',
headers: {'content-type': 'application/json'},
data: {inputs: [{id: ''}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/crm/v3/objects/deals/batch/archive';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"inputs":[{"id":""}]}'
};
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": @[ @{ @"id": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/crm/v3/objects/deals/batch/archive"]
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}}/crm/v3/objects/deals/batch/archive" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"inputs\": [\n {\n \"id\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/crm/v3/objects/deals/batch/archive",
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' => [
[
'id' => ''
]
]
]),
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}}/crm/v3/objects/deals/batch/archive', [
'body' => '{
"inputs": [
{
"id": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/crm/v3/objects/deals/batch/archive');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'inputs' => [
[
'id' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'inputs' => [
[
'id' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/crm/v3/objects/deals/batch/archive');
$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}}/crm/v3/objects/deals/batch/archive' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": [
{
"id": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/crm/v3/objects/deals/batch/archive' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": [
{
"id": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"inputs\": [\n {\n \"id\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/crm/v3/objects/deals/batch/archive", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/crm/v3/objects/deals/batch/archive"
payload = { "inputs": [{ "id": "" }] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/crm/v3/objects/deals/batch/archive"
payload <- "{\n \"inputs\": [\n {\n \"id\": \"\"\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}}/crm/v3/objects/deals/batch/archive")
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 \"id\": \"\"\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/crm/v3/objects/deals/batch/archive') do |req|
req.body = "{\n \"inputs\": [\n {\n \"id\": \"\"\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}}/crm/v3/objects/deals/batch/archive";
let payload = json!({"inputs": (json!({"id": ""}))});
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}}/crm/v3/objects/deals/batch/archive \
--header 'content-type: application/json' \
--data '{
"inputs": [
{
"id": ""
}
]
}'
echo '{
"inputs": [
{
"id": ""
}
]
}' | \
http POST {{baseUrl}}/crm/v3/objects/deals/batch/archive \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "inputs": [\n {\n "id": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/crm/v3/objects/deals/batch/archive
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["inputs": [["id": ""]]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/crm/v3/objects/deals/batch/archive")! 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
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Create a batch of deals
{{baseUrl}}/crm/v3/objects/deals/batch/create
BODY json
{
"inputs": [
{
"properties": {}
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/crm/v3/objects/deals/batch/create");
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 \"properties\": {}\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/crm/v3/objects/deals/batch/create" {:content-type :json
:form-params {:inputs [{:properties {}}]}})
require "http/client"
url = "{{baseUrl}}/crm/v3/objects/deals/batch/create"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"inputs\": [\n {\n \"properties\": {}\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/crm/v3/objects/deals/batch/create"),
Content = new StringContent("{\n \"inputs\": [\n {\n \"properties\": {}\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/crm/v3/objects/deals/batch/create");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"inputs\": [\n {\n \"properties\": {}\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/crm/v3/objects/deals/batch/create"
payload := strings.NewReader("{\n \"inputs\": [\n {\n \"properties\": {}\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/crm/v3/objects/deals/batch/create HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 56
{
"inputs": [
{
"properties": {}
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/crm/v3/objects/deals/batch/create")
.setHeader("content-type", "application/json")
.setBody("{\n \"inputs\": [\n {\n \"properties\": {}\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/crm/v3/objects/deals/batch/create"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"inputs\": [\n {\n \"properties\": {}\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"inputs\": [\n {\n \"properties\": {}\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/crm/v3/objects/deals/batch/create")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/crm/v3/objects/deals/batch/create")
.header("content-type", "application/json")
.body("{\n \"inputs\": [\n {\n \"properties\": {}\n }\n ]\n}")
.asString();
const data = JSON.stringify({
inputs: [
{
properties: {}
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/crm/v3/objects/deals/batch/create');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/crm/v3/objects/deals/batch/create',
headers: {'content-type': 'application/json'},
data: {inputs: [{properties: {}}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/crm/v3/objects/deals/batch/create';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"inputs":[{"properties":{}}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/crm/v3/objects/deals/batch/create',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "inputs": [\n {\n "properties": {}\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"inputs\": [\n {\n \"properties\": {}\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/crm/v3/objects/deals/batch/create")
.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/crm/v3/objects/deals/batch/create',
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: [{properties: {}}]}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/crm/v3/objects/deals/batch/create',
headers: {'content-type': 'application/json'},
body: {inputs: [{properties: {}}]},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/crm/v3/objects/deals/batch/create');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
inputs: [
{
properties: {}
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/crm/v3/objects/deals/batch/create',
headers: {'content-type': 'application/json'},
data: {inputs: [{properties: {}}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/crm/v3/objects/deals/batch/create';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"inputs":[{"properties":{}}]}'
};
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": @[ @{ @"properties": @{ } } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/crm/v3/objects/deals/batch/create"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/crm/v3/objects/deals/batch/create" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"inputs\": [\n {\n \"properties\": {}\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/crm/v3/objects/deals/batch/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
[
'properties' => [
]
]
]
]),
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}}/crm/v3/objects/deals/batch/create', [
'body' => '{
"inputs": [
{
"properties": {}
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/crm/v3/objects/deals/batch/create');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'inputs' => [
[
'properties' => [
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'inputs' => [
[
'properties' => [
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/crm/v3/objects/deals/batch/create');
$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}}/crm/v3/objects/deals/batch/create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": [
{
"properties": {}
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/crm/v3/objects/deals/batch/create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": [
{
"properties": {}
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"inputs\": [\n {\n \"properties\": {}\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/crm/v3/objects/deals/batch/create", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/crm/v3/objects/deals/batch/create"
payload = { "inputs": [{ "properties": {} }] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/crm/v3/objects/deals/batch/create"
payload <- "{\n \"inputs\": [\n {\n \"properties\": {}\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}}/crm/v3/objects/deals/batch/create")
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 \"properties\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/crm/v3/objects/deals/batch/create') do |req|
req.body = "{\n \"inputs\": [\n {\n \"properties\": {}\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/crm/v3/objects/deals/batch/create";
let payload = json!({"inputs": (json!({"properties": 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}}/crm/v3/objects/deals/batch/create \
--header 'content-type: application/json' \
--data '{
"inputs": [
{
"properties": {}
}
]
}'
echo '{
"inputs": [
{
"properties": {}
}
]
}' | \
http POST {{baseUrl}}/crm/v3/objects/deals/batch/create \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "inputs": [\n {\n "properties": {}\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/crm/v3/objects/deals/batch/create
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["inputs": [["properties": []]]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/crm/v3/objects/deals/batch/create")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"results": [
{
"createdAt": "2019-10-30T03:30:17.883Z",
"archived": false,
"id": "512",
"properties": {
"amount": "1500.00",
"closedate": "2019-12-07T16:50:06.678Z",
"createdate": "2019-10-30T03:30:17.883Z",
"dealname": "Custom data integrations",
"dealstage": "presentation scheduled",
"hs_lastmodifieddate": "2019-12-07T16:50:06.678Z",
"hubspot_owner_id": "910901",
"pipeline": "default"
},
"updatedAt": "2019-12-07T16:50:06.678Z"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"results": [
{
"createdAt": "2019-10-30T03:30:17.883Z",
"archived": false,
"id": "512",
"properties": {
"amount": "1500.00",
"closedate": "2019-12-07T16:50:06.678Z",
"createdate": "2019-10-30T03:30:17.883Z",
"dealname": "Custom data integrations",
"dealstage": "presentation scheduled",
"hs_lastmodifieddate": "2019-12-07T16:50:06.678Z",
"hubspot_owner_id": "910901",
"pipeline": "default"
},
"updatedAt": "2019-12-07T16:50:06.678Z"
}
]
}
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Read a batch of deals by internal ID, or unique property values
{{baseUrl}}/crm/v3/objects/deals/batch/read
BODY json
{
"properties": [],
"idProperty": "",
"inputs": [
{
"id": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/crm/v3/objects/deals/batch/read");
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 \"properties\": [],\n \"idProperty\": \"\",\n \"inputs\": [\n {\n \"id\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/crm/v3/objects/deals/batch/read" {:content-type :json
:form-params {:properties []
:idProperty ""
:inputs [{:id ""}]}})
require "http/client"
url = "{{baseUrl}}/crm/v3/objects/deals/batch/read"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"properties\": [],\n \"idProperty\": \"\",\n \"inputs\": [\n {\n \"id\": \"\"\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}}/crm/v3/objects/deals/batch/read"),
Content = new StringContent("{\n \"properties\": [],\n \"idProperty\": \"\",\n \"inputs\": [\n {\n \"id\": \"\"\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}}/crm/v3/objects/deals/batch/read");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"properties\": [],\n \"idProperty\": \"\",\n \"inputs\": [\n {\n \"id\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/crm/v3/objects/deals/batch/read"
payload := strings.NewReader("{\n \"properties\": [],\n \"idProperty\": \"\",\n \"inputs\": [\n {\n \"id\": \"\"\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/crm/v3/objects/deals/batch/read HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 88
{
"properties": [],
"idProperty": "",
"inputs": [
{
"id": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/crm/v3/objects/deals/batch/read")
.setHeader("content-type", "application/json")
.setBody("{\n \"properties\": [],\n \"idProperty\": \"\",\n \"inputs\": [\n {\n \"id\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/crm/v3/objects/deals/batch/read"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"properties\": [],\n \"idProperty\": \"\",\n \"inputs\": [\n {\n \"id\": \"\"\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 \"properties\": [],\n \"idProperty\": \"\",\n \"inputs\": [\n {\n \"id\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/crm/v3/objects/deals/batch/read")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/crm/v3/objects/deals/batch/read")
.header("content-type", "application/json")
.body("{\n \"properties\": [],\n \"idProperty\": \"\",\n \"inputs\": [\n {\n \"id\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
properties: [],
idProperty: '',
inputs: [
{
id: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/crm/v3/objects/deals/batch/read');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/crm/v3/objects/deals/batch/read',
headers: {'content-type': 'application/json'},
data: {properties: [], idProperty: '', inputs: [{id: ''}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/crm/v3/objects/deals/batch/read';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"properties":[],"idProperty":"","inputs":[{"id":""}]}'
};
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}}/crm/v3/objects/deals/batch/read',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "properties": [],\n "idProperty": "",\n "inputs": [\n {\n "id": ""\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 \"properties\": [],\n \"idProperty\": \"\",\n \"inputs\": [\n {\n \"id\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/crm/v3/objects/deals/batch/read")
.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/crm/v3/objects/deals/batch/read',
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({properties: [], idProperty: '', inputs: [{id: ''}]}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/crm/v3/objects/deals/batch/read',
headers: {'content-type': 'application/json'},
body: {properties: [], idProperty: '', inputs: [{id: ''}]},
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}}/crm/v3/objects/deals/batch/read');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
properties: [],
idProperty: '',
inputs: [
{
id: ''
}
]
});
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}}/crm/v3/objects/deals/batch/read',
headers: {'content-type': 'application/json'},
data: {properties: [], idProperty: '', inputs: [{id: ''}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/crm/v3/objects/deals/batch/read';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"properties":[],"idProperty":"","inputs":[{"id":""}]}'
};
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 = @{ @"properties": @[ ],
@"idProperty": @"",
@"inputs": @[ @{ @"id": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/crm/v3/objects/deals/batch/read"]
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}}/crm/v3/objects/deals/batch/read" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"properties\": [],\n \"idProperty\": \"\",\n \"inputs\": [\n {\n \"id\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/crm/v3/objects/deals/batch/read",
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([
'properties' => [
],
'idProperty' => '',
'inputs' => [
[
'id' => ''
]
]
]),
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}}/crm/v3/objects/deals/batch/read', [
'body' => '{
"properties": [],
"idProperty": "",
"inputs": [
{
"id": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/crm/v3/objects/deals/batch/read');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'properties' => [
],
'idProperty' => '',
'inputs' => [
[
'id' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'properties' => [
],
'idProperty' => '',
'inputs' => [
[
'id' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/crm/v3/objects/deals/batch/read');
$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}}/crm/v3/objects/deals/batch/read' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"properties": [],
"idProperty": "",
"inputs": [
{
"id": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/crm/v3/objects/deals/batch/read' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"properties": [],
"idProperty": "",
"inputs": [
{
"id": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"properties\": [],\n \"idProperty\": \"\",\n \"inputs\": [\n {\n \"id\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/crm/v3/objects/deals/batch/read", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/crm/v3/objects/deals/batch/read"
payload = {
"properties": [],
"idProperty": "",
"inputs": [{ "id": "" }]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/crm/v3/objects/deals/batch/read"
payload <- "{\n \"properties\": [],\n \"idProperty\": \"\",\n \"inputs\": [\n {\n \"id\": \"\"\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}}/crm/v3/objects/deals/batch/read")
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 \"properties\": [],\n \"idProperty\": \"\",\n \"inputs\": [\n {\n \"id\": \"\"\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/crm/v3/objects/deals/batch/read') do |req|
req.body = "{\n \"properties\": [],\n \"idProperty\": \"\",\n \"inputs\": [\n {\n \"id\": \"\"\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}}/crm/v3/objects/deals/batch/read";
let payload = json!({
"properties": (),
"idProperty": "",
"inputs": (json!({"id": ""}))
});
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}}/crm/v3/objects/deals/batch/read \
--header 'content-type: application/json' \
--data '{
"properties": [],
"idProperty": "",
"inputs": [
{
"id": ""
}
]
}'
echo '{
"properties": [],
"idProperty": "",
"inputs": [
{
"id": ""
}
]
}' | \
http POST {{baseUrl}}/crm/v3/objects/deals/batch/read \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "properties": [],\n "idProperty": "",\n "inputs": [\n {\n "id": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/crm/v3/objects/deals/batch/read
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"properties": [],
"idProperty": "",
"inputs": [["id": ""]]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/crm/v3/objects/deals/batch/read")! 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
{
"results": [
{
"createdAt": "2019-10-30T03:30:17.883Z",
"archived": false,
"id": "512",
"properties": {
"amount": "1500.00",
"closedate": "2019-12-07T16:50:06.678Z",
"createdate": "2019-10-30T03:30:17.883Z",
"dealname": "Custom data integrations",
"dealstage": "presentation scheduled",
"hs_lastmodifieddate": "2019-12-07T16:50:06.678Z",
"hubspot_owner_id": "910901",
"pipeline": "default"
},
"updatedAt": "2019-12-07T16:50:06.678Z"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"results": [
{
"createdAt": "2019-10-30T03:30:17.883Z",
"archived": false,
"id": "512",
"properties": {
"amount": "1500.00",
"closedate": "2019-12-07T16:50:06.678Z",
"createdate": "2019-10-30T03:30:17.883Z",
"dealname": "Custom data integrations",
"dealstage": "presentation scheduled",
"hs_lastmodifieddate": "2019-12-07T16:50:06.678Z",
"hubspot_owner_id": "910901",
"pipeline": "default"
},
"updatedAt": "2019-12-07T16:50:06.678Z"
}
]
}
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Update a batch of deals
{{baseUrl}}/crm/v3/objects/deals/batch/update
BODY json
{
"inputs": [
{
"properties": {},
"id": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/crm/v3/objects/deals/batch/update");
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 \"properties\": {},\n \"id\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/crm/v3/objects/deals/batch/update" {:content-type :json
:form-params {:inputs [{:properties {}
:id ""}]}})
require "http/client"
url = "{{baseUrl}}/crm/v3/objects/deals/batch/update"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"inputs\": [\n {\n \"properties\": {},\n \"id\": \"\"\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}}/crm/v3/objects/deals/batch/update"),
Content = new StringContent("{\n \"inputs\": [\n {\n \"properties\": {},\n \"id\": \"\"\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}}/crm/v3/objects/deals/batch/update");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"inputs\": [\n {\n \"properties\": {},\n \"id\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/crm/v3/objects/deals/batch/update"
payload := strings.NewReader("{\n \"inputs\": [\n {\n \"properties\": {},\n \"id\": \"\"\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/crm/v3/objects/deals/batch/update HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 72
{
"inputs": [
{
"properties": {},
"id": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/crm/v3/objects/deals/batch/update")
.setHeader("content-type", "application/json")
.setBody("{\n \"inputs\": [\n {\n \"properties\": {},\n \"id\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/crm/v3/objects/deals/batch/update"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"inputs\": [\n {\n \"properties\": {},\n \"id\": \"\"\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 \"properties\": {},\n \"id\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/crm/v3/objects/deals/batch/update")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/crm/v3/objects/deals/batch/update")
.header("content-type", "application/json")
.body("{\n \"inputs\": [\n {\n \"properties\": {},\n \"id\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
inputs: [
{
properties: {},
id: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/crm/v3/objects/deals/batch/update');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/crm/v3/objects/deals/batch/update',
headers: {'content-type': 'application/json'},
data: {inputs: [{properties: {}, id: ''}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/crm/v3/objects/deals/batch/update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"inputs":[{"properties":{},"id":""}]}'
};
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}}/crm/v3/objects/deals/batch/update',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "inputs": [\n {\n "properties": {},\n "id": ""\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 \"properties\": {},\n \"id\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/crm/v3/objects/deals/batch/update")
.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/crm/v3/objects/deals/batch/update',
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: [{properties: {}, id: ''}]}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/crm/v3/objects/deals/batch/update',
headers: {'content-type': 'application/json'},
body: {inputs: [{properties: {}, id: ''}]},
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}}/crm/v3/objects/deals/batch/update');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
inputs: [
{
properties: {},
id: ''
}
]
});
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}}/crm/v3/objects/deals/batch/update',
headers: {'content-type': 'application/json'},
data: {inputs: [{properties: {}, id: ''}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/crm/v3/objects/deals/batch/update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"inputs":[{"properties":{},"id":""}]}'
};
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": @[ @{ @"properties": @{ }, @"id": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/crm/v3/objects/deals/batch/update"]
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}}/crm/v3/objects/deals/batch/update" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"inputs\": [\n {\n \"properties\": {},\n \"id\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/crm/v3/objects/deals/batch/update",
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' => [
[
'properties' => [
],
'id' => ''
]
]
]),
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}}/crm/v3/objects/deals/batch/update', [
'body' => '{
"inputs": [
{
"properties": {},
"id": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/crm/v3/objects/deals/batch/update');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'inputs' => [
[
'properties' => [
],
'id' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'inputs' => [
[
'properties' => [
],
'id' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/crm/v3/objects/deals/batch/update');
$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}}/crm/v3/objects/deals/batch/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": [
{
"properties": {},
"id": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/crm/v3/objects/deals/batch/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": [
{
"properties": {},
"id": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"inputs\": [\n {\n \"properties\": {},\n \"id\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/crm/v3/objects/deals/batch/update", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/crm/v3/objects/deals/batch/update"
payload = { "inputs": [
{
"properties": {},
"id": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/crm/v3/objects/deals/batch/update"
payload <- "{\n \"inputs\": [\n {\n \"properties\": {},\n \"id\": \"\"\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}}/crm/v3/objects/deals/batch/update")
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 \"properties\": {},\n \"id\": \"\"\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/crm/v3/objects/deals/batch/update') do |req|
req.body = "{\n \"inputs\": [\n {\n \"properties\": {},\n \"id\": \"\"\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}}/crm/v3/objects/deals/batch/update";
let payload = json!({"inputs": (
json!({
"properties": json!({}),
"id": ""
})
)});
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}}/crm/v3/objects/deals/batch/update \
--header 'content-type: application/json' \
--data '{
"inputs": [
{
"properties": {},
"id": ""
}
]
}'
echo '{
"inputs": [
{
"properties": {},
"id": ""
}
]
}' | \
http POST {{baseUrl}}/crm/v3/objects/deals/batch/update \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "inputs": [\n {\n "properties": {},\n "id": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/crm/v3/objects/deals/batch/update
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["inputs": [
[
"properties": [],
"id": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/crm/v3/objects/deals/batch/update")! 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
{
"results": [
{
"createdAt": "2019-10-30T03:30:17.883Z",
"archived": false,
"id": "512",
"properties": {
"amount": "1500.00",
"closedate": "2019-12-07T16:50:06.678Z",
"createdate": "2019-10-30T03:30:17.883Z",
"dealname": "Custom data integrations",
"dealstage": "presentation scheduled",
"hs_lastmodifieddate": "2019-12-07T16:50:06.678Z",
"hubspot_owner_id": "910901",
"pipeline": "default"
},
"updatedAt": "2019-12-07T16:50:06.678Z"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"results": [
{
"createdAt": "2019-10-30T03:30:17.883Z",
"archived": false,
"id": "512",
"properties": {
"amount": "1500.00",
"closedate": "2019-12-07T16:50:06.678Z",
"createdate": "2019-10-30T03:30:17.883Z",
"dealname": "Custom data integrations",
"dealstage": "presentation scheduled",
"hs_lastmodifieddate": "2019-12-07T16:50:06.678Z",
"hubspot_owner_id": "910901",
"pipeline": "default"
},
"updatedAt": "2019-12-07T16:50:06.678Z"
}
]
}
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Filter, Sort, and Search CRM Objects
{{baseUrl}}/crm/v3/objects/deals/search
BODY json
{
"filterGroups": [
{
"filters": [
{
"value": "",
"propertyName": "",
"operator": ""
}
]
}
],
"sorts": [],
"query": "",
"properties": [],
"limit": 0,
"after": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/crm/v3/objects/deals/search");
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 \"filterGroups\": [\n {\n \"filters\": [\n {\n \"value\": \"\",\n \"propertyName\": \"\",\n \"operator\": \"\"\n }\n ]\n }\n ],\n \"sorts\": [],\n \"query\": \"\",\n \"properties\": [],\n \"limit\": 0,\n \"after\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/crm/v3/objects/deals/search" {:content-type :json
:form-params {:filterGroups [{:filters [{:value ""
:propertyName ""
:operator ""}]}]
:sorts []
:query ""
:properties []
:limit 0
:after 0}})
require "http/client"
url = "{{baseUrl}}/crm/v3/objects/deals/search"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"filterGroups\": [\n {\n \"filters\": [\n {\n \"value\": \"\",\n \"propertyName\": \"\",\n \"operator\": \"\"\n }\n ]\n }\n ],\n \"sorts\": [],\n \"query\": \"\",\n \"properties\": [],\n \"limit\": 0,\n \"after\": 0\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}}/crm/v3/objects/deals/search"),
Content = new StringContent("{\n \"filterGroups\": [\n {\n \"filters\": [\n {\n \"value\": \"\",\n \"propertyName\": \"\",\n \"operator\": \"\"\n }\n ]\n }\n ],\n \"sorts\": [],\n \"query\": \"\",\n \"properties\": [],\n \"limit\": 0,\n \"after\": 0\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}}/crm/v3/objects/deals/search");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"filterGroups\": [\n {\n \"filters\": [\n {\n \"value\": \"\",\n \"propertyName\": \"\",\n \"operator\": \"\"\n }\n ]\n }\n ],\n \"sorts\": [],\n \"query\": \"\",\n \"properties\": [],\n \"limit\": 0,\n \"after\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/crm/v3/objects/deals/search"
payload := strings.NewReader("{\n \"filterGroups\": [\n {\n \"filters\": [\n {\n \"value\": \"\",\n \"propertyName\": \"\",\n \"operator\": \"\"\n }\n ]\n }\n ],\n \"sorts\": [],\n \"query\": \"\",\n \"properties\": [],\n \"limit\": 0,\n \"after\": 0\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/crm/v3/objects/deals/search HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 242
{
"filterGroups": [
{
"filters": [
{
"value": "",
"propertyName": "",
"operator": ""
}
]
}
],
"sorts": [],
"query": "",
"properties": [],
"limit": 0,
"after": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/crm/v3/objects/deals/search")
.setHeader("content-type", "application/json")
.setBody("{\n \"filterGroups\": [\n {\n \"filters\": [\n {\n \"value\": \"\",\n \"propertyName\": \"\",\n \"operator\": \"\"\n }\n ]\n }\n ],\n \"sorts\": [],\n \"query\": \"\",\n \"properties\": [],\n \"limit\": 0,\n \"after\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/crm/v3/objects/deals/search"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"filterGroups\": [\n {\n \"filters\": [\n {\n \"value\": \"\",\n \"propertyName\": \"\",\n \"operator\": \"\"\n }\n ]\n }\n ],\n \"sorts\": [],\n \"query\": \"\",\n \"properties\": [],\n \"limit\": 0,\n \"after\": 0\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 \"filterGroups\": [\n {\n \"filters\": [\n {\n \"value\": \"\",\n \"propertyName\": \"\",\n \"operator\": \"\"\n }\n ]\n }\n ],\n \"sorts\": [],\n \"query\": \"\",\n \"properties\": [],\n \"limit\": 0,\n \"after\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/crm/v3/objects/deals/search")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/crm/v3/objects/deals/search")
.header("content-type", "application/json")
.body("{\n \"filterGroups\": [\n {\n \"filters\": [\n {\n \"value\": \"\",\n \"propertyName\": \"\",\n \"operator\": \"\"\n }\n ]\n }\n ],\n \"sorts\": [],\n \"query\": \"\",\n \"properties\": [],\n \"limit\": 0,\n \"after\": 0\n}")
.asString();
const data = JSON.stringify({
filterGroups: [
{
filters: [
{
value: '',
propertyName: '',
operator: ''
}
]
}
],
sorts: [],
query: '',
properties: [],
limit: 0,
after: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/crm/v3/objects/deals/search');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/crm/v3/objects/deals/search',
headers: {'content-type': 'application/json'},
data: {
filterGroups: [{filters: [{value: '', propertyName: '', operator: ''}]}],
sorts: [],
query: '',
properties: [],
limit: 0,
after: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/crm/v3/objects/deals/search';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"filterGroups":[{"filters":[{"value":"","propertyName":"","operator":""}]}],"sorts":[],"query":"","properties":[],"limit":0,"after":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/crm/v3/objects/deals/search',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "filterGroups": [\n {\n "filters": [\n {\n "value": "",\n "propertyName": "",\n "operator": ""\n }\n ]\n }\n ],\n "sorts": [],\n "query": "",\n "properties": [],\n "limit": 0,\n "after": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"filterGroups\": [\n {\n \"filters\": [\n {\n \"value\": \"\",\n \"propertyName\": \"\",\n \"operator\": \"\"\n }\n ]\n }\n ],\n \"sorts\": [],\n \"query\": \"\",\n \"properties\": [],\n \"limit\": 0,\n \"after\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/crm/v3/objects/deals/search")
.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/crm/v3/objects/deals/search',
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({
filterGroups: [{filters: [{value: '', propertyName: '', operator: ''}]}],
sorts: [],
query: '',
properties: [],
limit: 0,
after: 0
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/crm/v3/objects/deals/search',
headers: {'content-type': 'application/json'},
body: {
filterGroups: [{filters: [{value: '', propertyName: '', operator: ''}]}],
sorts: [],
query: '',
properties: [],
limit: 0,
after: 0
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/crm/v3/objects/deals/search');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
filterGroups: [
{
filters: [
{
value: '',
propertyName: '',
operator: ''
}
]
}
],
sorts: [],
query: '',
properties: [],
limit: 0,
after: 0
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/crm/v3/objects/deals/search',
headers: {'content-type': 'application/json'},
data: {
filterGroups: [{filters: [{value: '', propertyName: '', operator: ''}]}],
sorts: [],
query: '',
properties: [],
limit: 0,
after: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/crm/v3/objects/deals/search';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"filterGroups":[{"filters":[{"value":"","propertyName":"","operator":""}]}],"sorts":[],"query":"","properties":[],"limit":0,"after":0}'
};
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 = @{ @"filterGroups": @[ @{ @"filters": @[ @{ @"value": @"", @"propertyName": @"", @"operator": @"" } ] } ],
@"sorts": @[ ],
@"query": @"",
@"properties": @[ ],
@"limit": @0,
@"after": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/crm/v3/objects/deals/search"]
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}}/crm/v3/objects/deals/search" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"filterGroups\": [\n {\n \"filters\": [\n {\n \"value\": \"\",\n \"propertyName\": \"\",\n \"operator\": \"\"\n }\n ]\n }\n ],\n \"sorts\": [],\n \"query\": \"\",\n \"properties\": [],\n \"limit\": 0,\n \"after\": 0\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/crm/v3/objects/deals/search",
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([
'filterGroups' => [
[
'filters' => [
[
'value' => '',
'propertyName' => '',
'operator' => ''
]
]
]
],
'sorts' => [
],
'query' => '',
'properties' => [
],
'limit' => 0,
'after' => 0
]),
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}}/crm/v3/objects/deals/search', [
'body' => '{
"filterGroups": [
{
"filters": [
{
"value": "",
"propertyName": "",
"operator": ""
}
]
}
],
"sorts": [],
"query": "",
"properties": [],
"limit": 0,
"after": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/crm/v3/objects/deals/search');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'filterGroups' => [
[
'filters' => [
[
'value' => '',
'propertyName' => '',
'operator' => ''
]
]
]
],
'sorts' => [
],
'query' => '',
'properties' => [
],
'limit' => 0,
'after' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'filterGroups' => [
[
'filters' => [
[
'value' => '',
'propertyName' => '',
'operator' => ''
]
]
]
],
'sorts' => [
],
'query' => '',
'properties' => [
],
'limit' => 0,
'after' => 0
]));
$request->setRequestUrl('{{baseUrl}}/crm/v3/objects/deals/search');
$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}}/crm/v3/objects/deals/search' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"filterGroups": [
{
"filters": [
{
"value": "",
"propertyName": "",
"operator": ""
}
]
}
],
"sorts": [],
"query": "",
"properties": [],
"limit": 0,
"after": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/crm/v3/objects/deals/search' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"filterGroups": [
{
"filters": [
{
"value": "",
"propertyName": "",
"operator": ""
}
]
}
],
"sorts": [],
"query": "",
"properties": [],
"limit": 0,
"after": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"filterGroups\": [\n {\n \"filters\": [\n {\n \"value\": \"\",\n \"propertyName\": \"\",\n \"operator\": \"\"\n }\n ]\n }\n ],\n \"sorts\": [],\n \"query\": \"\",\n \"properties\": [],\n \"limit\": 0,\n \"after\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/crm/v3/objects/deals/search", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/crm/v3/objects/deals/search"
payload = {
"filterGroups": [{ "filters": [
{
"value": "",
"propertyName": "",
"operator": ""
}
] }],
"sorts": [],
"query": "",
"properties": [],
"limit": 0,
"after": 0
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/crm/v3/objects/deals/search"
payload <- "{\n \"filterGroups\": [\n {\n \"filters\": [\n {\n \"value\": \"\",\n \"propertyName\": \"\",\n \"operator\": \"\"\n }\n ]\n }\n ],\n \"sorts\": [],\n \"query\": \"\",\n \"properties\": [],\n \"limit\": 0,\n \"after\": 0\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}}/crm/v3/objects/deals/search")
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 \"filterGroups\": [\n {\n \"filters\": [\n {\n \"value\": \"\",\n \"propertyName\": \"\",\n \"operator\": \"\"\n }\n ]\n }\n ],\n \"sorts\": [],\n \"query\": \"\",\n \"properties\": [],\n \"limit\": 0,\n \"after\": 0\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/crm/v3/objects/deals/search') do |req|
req.body = "{\n \"filterGroups\": [\n {\n \"filters\": [\n {\n \"value\": \"\",\n \"propertyName\": \"\",\n \"operator\": \"\"\n }\n ]\n }\n ],\n \"sorts\": [],\n \"query\": \"\",\n \"properties\": [],\n \"limit\": 0,\n \"after\": 0\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/crm/v3/objects/deals/search";
let payload = json!({
"filterGroups": (json!({"filters": (
json!({
"value": "",
"propertyName": "",
"operator": ""
})
)})),
"sorts": (),
"query": "",
"properties": (),
"limit": 0,
"after": 0
});
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}}/crm/v3/objects/deals/search \
--header 'content-type: application/json' \
--data '{
"filterGroups": [
{
"filters": [
{
"value": "",
"propertyName": "",
"operator": ""
}
]
}
],
"sorts": [],
"query": "",
"properties": [],
"limit": 0,
"after": 0
}'
echo '{
"filterGroups": [
{
"filters": [
{
"value": "",
"propertyName": "",
"operator": ""
}
]
}
],
"sorts": [],
"query": "",
"properties": [],
"limit": 0,
"after": 0
}' | \
http POST {{baseUrl}}/crm/v3/objects/deals/search \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "filterGroups": [\n {\n "filters": [\n {\n "value": "",\n "propertyName": "",\n "operator": ""\n }\n ]\n }\n ],\n "sorts": [],\n "query": "",\n "properties": [],\n "limit": 0,\n "after": 0\n}' \
--output-document \
- {{baseUrl}}/crm/v3/objects/deals/search
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"filterGroups": [["filters": [
[
"value": "",
"propertyName": "",
"operator": ""
]
]]],
"sorts": [],
"query": "",
"properties": [],
"limit": 0,
"after": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/crm/v3/objects/deals/search")! 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
{
"results": [
{
"createdAt": "2019-10-30T03:30:17.883Z",
"archived": false,
"id": "512",
"properties": {
"amount": "1500.00",
"closedate": "2019-12-07T16:50:06.678Z",
"createdate": "2019-10-30T03:30:17.883Z",
"dealname": "Custom data integrations",
"dealstage": "presentation scheduled",
"hs_lastmodifieddate": "2019-12-07T16:50:06.678Z",
"hubspot_owner_id": "910901",
"pipeline": "default"
},
"updatedAt": "2019-12-07T16:50:06.678Z"
}
],
"paging": {
"next": {
"link": "?after=NTI1Cg%3D%3D",
"after": "NTI1Cg%3D%3D"
}
}
}
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}