cURL
curl --request POST \
--url https://api.dock.us/{version}/accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Dock",
"website": "https://dock.us",
"ownerId": "RiHO4e0Ju3DS",
"logo": "https://dock.us/logo.png"
}
'import requests
url = "https://api.dock.us/{version}/accounts"
payload = {
"name": "Dock",
"website": "https://dock.us",
"ownerId": "RiHO4e0Ju3DS",
"logo": "https://dock.us/logo.png"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Dock',
website: 'https://dock.us',
ownerId: 'RiHO4e0Ju3DS',
logo: 'https://dock.us/logo.png'
})
};
fetch('https://api.dock.us/{version}/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dock.us/{version}/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Dock',
'website' => 'https://dock.us',
'ownerId' => 'RiHO4e0Ju3DS',
'logo' => 'https://dock.us/logo.png'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dock.us/{version}/accounts"
payload := strings.NewReader("{\n \"name\": \"Dock\",\n \"website\": \"https://dock.us\",\n \"ownerId\": \"RiHO4e0Ju3DS\",\n \"logo\": \"https://dock.us/logo.png\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.dock.us/{version}/accounts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Dock\",\n \"website\": \"https://dock.us\",\n \"ownerId\": \"RiHO4e0Ju3DS\",\n \"logo\": \"https://dock.us/logo.png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dock.us/{version}/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Dock\",\n \"website\": \"https://dock.us\",\n \"ownerId\": \"RiHO4e0Ju3DS\",\n \"logo\": \"https://dock.us/logo.png\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"account": {
"id": "RiHO4e0Ju3DS",
"updatedAt": "2021-01-01T00:00:00.000Z",
"createdAt": "2021-01-01T00:00:00.000Z",
"object": "account",
"url": "https://api.dock.us/v1/accounts/RiHO4e0Ju3DS",
"name": "Dock",
"website": "https://dock.us",
"ownerId": "RiHO4e0Ju3DS",
"logo": "https://dock.us/logo.png",
"salesforceAccountId": "0015f00000Bg59dAAB",
"hubspotCompanyId": "8662045446",
"customFields": [
{
"id": "RiHO4e0Ju3DS",
"updatedAt": "2021-01-01T00:00:00.000Z",
"createdAt": "2021-01-01T00:00:00.000Z",
"object": "customField",
"url": "https://api.dock.us/v1/custom-fields/RiHO4e0Ju3DS",
"variableName": "account.name",
"type": "singleCheckbox",
"options": [
{
"index": 1,
"label": "Yes",
"value": "true"
}
],
"value": "Yes"
}
]
}
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "The request could not be understood or was missing required parameters"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Access denied. You are not authorized to access this resource"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Access to this resource is restricted"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource could not be found"
}
}{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Please try again later"
}
}{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "The server has encountered a situation it does not know how to handle"
}
}Accounts
Create an account
Create an account
POST
/
accounts
cURL
curl --request POST \
--url https://api.dock.us/{version}/accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Dock",
"website": "https://dock.us",
"ownerId": "RiHO4e0Ju3DS",
"logo": "https://dock.us/logo.png"
}
'import requests
url = "https://api.dock.us/{version}/accounts"
payload = {
"name": "Dock",
"website": "https://dock.us",
"ownerId": "RiHO4e0Ju3DS",
"logo": "https://dock.us/logo.png"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Dock',
website: 'https://dock.us',
ownerId: 'RiHO4e0Ju3DS',
logo: 'https://dock.us/logo.png'
})
};
fetch('https://api.dock.us/{version}/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dock.us/{version}/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Dock',
'website' => 'https://dock.us',
'ownerId' => 'RiHO4e0Ju3DS',
'logo' => 'https://dock.us/logo.png'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dock.us/{version}/accounts"
payload := strings.NewReader("{\n \"name\": \"Dock\",\n \"website\": \"https://dock.us\",\n \"ownerId\": \"RiHO4e0Ju3DS\",\n \"logo\": \"https://dock.us/logo.png\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.dock.us/{version}/accounts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Dock\",\n \"website\": \"https://dock.us\",\n \"ownerId\": \"RiHO4e0Ju3DS\",\n \"logo\": \"https://dock.us/logo.png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dock.us/{version}/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Dock\",\n \"website\": \"https://dock.us\",\n \"ownerId\": \"RiHO4e0Ju3DS\",\n \"logo\": \"https://dock.us/logo.png\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"account": {
"id": "RiHO4e0Ju3DS",
"updatedAt": "2021-01-01T00:00:00.000Z",
"createdAt": "2021-01-01T00:00:00.000Z",
"object": "account",
"url": "https://api.dock.us/v1/accounts/RiHO4e0Ju3DS",
"name": "Dock",
"website": "https://dock.us",
"ownerId": "RiHO4e0Ju3DS",
"logo": "https://dock.us/logo.png",
"salesforceAccountId": "0015f00000Bg59dAAB",
"hubspotCompanyId": "8662045446",
"customFields": [
{
"id": "RiHO4e0Ju3DS",
"updatedAt": "2021-01-01T00:00:00.000Z",
"createdAt": "2021-01-01T00:00:00.000Z",
"object": "customField",
"url": "https://api.dock.us/v1/custom-fields/RiHO4e0Ju3DS",
"variableName": "account.name",
"type": "singleCheckbox",
"options": [
{
"index": 1,
"label": "Yes",
"value": "true"
}
],
"value": "Yes"
}
]
}
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "The request could not be understood or was missing required parameters"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Access denied. You are not authorized to access this resource"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Access to this resource is restricted"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource could not be found"
}
}{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Please try again later"
}
}{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "The server has encountered a situation it does not know how to handle"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Select the account properties that should be returned
Available options:
name, website, ownerId, logo, salesforceAccountId, hubspotCompanyId, createdAt, updatedAt, customFields.name, customFields.type, customFields.variableName, customFields.value Body
application/json
Response
Account created
Show child attributes
Show child attributes
⌘I