Get HubSpot Contact Data
curl --request POST \
--url https://api-lr.agent.ai/v1/action/get_hubspot_contact_object \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "[email protected]"
}
'import requests
url = "https://api-lr.agent.ai/v1/action/get_hubspot_contact_object"
payload = { "query": "[email protected]" }
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({query: '[email protected]'})
};
fetch('https://api-lr.agent.ai/v1/action/get_hubspot_contact_object', 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-lr.agent.ai/v1/action/get_hubspot_contact_object",
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([
'query' => '[email protected]'
]),
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-lr.agent.ai/v1/action/get_hubspot_contact_object"
payload := strings.NewReader("{\n \"query\": \"[email protected]\"\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-lr.agent.ai/v1/action/get_hubspot_contact_object")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"[email protected]\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-lr.agent.ai/v1/action/get_hubspot_contact_object")
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 \"query\": \"[email protected]\"\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"response": {
"id": "12345678",
"properties": {
"firstname": "John",
"lastname": "Doe",
"email": "[email protected]",
"phone": "+1-123-456-7890",
"jobtitle": "Product Manager",
"company": "Acme Corporation",
"createdate": "2023-05-20T13:45:22.123Z",
"hs_lastmodifieddate": "2024-02-15T11:24:36.789Z"
},
"createdAt": "2023-05-20T13:45:22.123Z",
"updatedAt": "2024-02-15T11:24:36.789Z",
"archived": false
}
}HubSpot
Get HubSpot Contact Data
Retrieve contact data from HubSpot based on a query or get the most recent contact.
POST
/
action
/
get_hubspot_contact_object
Get HubSpot Contact Data
curl --request POST \
--url https://api-lr.agent.ai/v1/action/get_hubspot_contact_object \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "[email protected]"
}
'import requests
url = "https://api-lr.agent.ai/v1/action/get_hubspot_contact_object"
payload = { "query": "[email protected]" }
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({query: '[email protected]'})
};
fetch('https://api-lr.agent.ai/v1/action/get_hubspot_contact_object', 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-lr.agent.ai/v1/action/get_hubspot_contact_object",
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([
'query' => '[email protected]'
]),
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-lr.agent.ai/v1/action/get_hubspot_contact_object"
payload := strings.NewReader("{\n \"query\": \"[email protected]\"\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-lr.agent.ai/v1/action/get_hubspot_contact_object")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"[email protected]\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-lr.agent.ai/v1/action/get_hubspot_contact_object")
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 \"query\": \"[email protected]\"\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"response": {
"id": "12345678",
"properties": {
"firstname": "John",
"lastname": "Doe",
"email": "[email protected]",
"phone": "+1-123-456-7890",
"jobtitle": "Product Manager",
"company": "Acme Corporation",
"createdate": "2023-05-20T13:45:22.123Z",
"hs_lastmodifieddate": "2024-02-15T11:24:36.789Z"
},
"createdAt": "2023-05-20T13:45:22.123Z",
"updatedAt": "2024-02-15T11:24:36.789Z",
"archived": false
}
}Authorizations
Bearer token from your account (https://agent.ai/user/integrations#api)
Body
application/json
Search query to find specific contact. Defaults to '_most_recent_contact' if not provided or too short.
Example:
⌘I

