Xano
Actions (10)
Function Documentation: HubSpot → Create Contact
Overview
This function creates a new contact in HubSpot using specified input parameters. It involves setting environment variables, preparing the request, and handling the response.
Inputs
hubspotapikey (registry|text) Required Sensitive data
Description: The API key for your HubSpot account.
first_name (text)
Description: The first name of the contact.
last_name (text)
Description: The last name of the contact.
email (text)
Description: The email address of the contact.
company (text)
Description: The company associated with the contact.
lead_status (enum)
Description: The lead status of the contact.
Options:
NEW
OPEN
IN_PROGRESS
OPEN_DEAL
UNQUALIFIED
ATTEMPTEDTOCONTACT
CONNECTED
BAD_TIMING
contact_owner (integer)
Description: The owner of the contact.
phone_number (text)
Description: The phone number of the contact.
additional_properties (json)
Description: Additional properties in JSON format.
Schema:
`json
{
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
}
`
Function Stack
Set Properties Object
Create Variable: properties_object
Purpose: Sets properties object from input: additional_properties.
HubSpot API Request
API Request to https://api.hubapi.com/crm/v3/objects/contacts
Purpose: Sends a POST request to create a new contact in HubSpot.
Preconditions
Precondition: hubspot_api.response.status == 201
Purpose: Ensures successful creation of the contact with HTTP status code 201.
Response
The function returns the result from the HubSpot API response.
Success response
`json
{
"id": "12345678",
"properties": {
"company": "Xano",
.
.
.
},
"createdAt": "2024-09-23T13:26:23.352Z",
"updatedAt": "2024-09-23T13:26:23.352Z",
"archived": false
}
`
Error message
`json
{
"message":"Uh oh! Hubspot returned with an error: Property values were not valid: [{\"isValid\":false,\"message\":\"Property \\\"prop2\\\" does not exist\",\"error\":\"PROPERTYDOESNTEXIST\",\"name\":\"prop2\",\"localizedErrorMessage\":\"Property \\\"prop2\\\" does not exist\",\"portalId\":47373842},{\"isValid\":false,\"message\":\"Property \\\"prop1\\\" does not exist\",\"error\":\"PROPERTYDOESNTEXIST\",\"name\":\"prop1\",\"localizedErrorMessage\":\"Property \\\"prop1\\\" does not exist\",\"portalId\":47373842}]"
}
`
Example
Input
`json
{
"first_name": "Unico",
"last_name": "Connect",
"email": "imagine@xano.com",
"company": "UC",
"lead_status": "OPEN",
"contact_owner": 0,
"phone_number": "123456",
"customer_Id": 0,
"additional_properties":
{
"mobilephone":"123456"
}
}
`
Output
`json
{
"id": "123456789",
"properties": {
"company": "UC",
"createdate": "2024-09-23T13:30:40.386Z",
"email": "imagine@xano.com",
"firstname": "Unico",
"hsallcontact_vids": "60968500829",
"hscurrentlyenrolledinprospecting_agent": "false",
"hsemaildomain": "xano.com",
"hsiscontact": "true",
"hsisunworked": "true",
"hsleadstatus": "OPEN",
"hslifecyclestagelead_date": "2024-09-23T13:30:40.386Z",
"hsmarketablestatus": "false",
"hsmarketableuntil_renewal": "false",
"hsmembershiphasaccessedprivate_content": "0",
"hsobjectid": "60968500829",
"hsobjectsource": "INTEGRATION",
"hsobjectsource_id": "3898752",
"hsobjectsource_label": "INTEGRATION",
"hs_pipeline": "contacts-lifecycle-pipeline",
"hsregisteredmember": "0",
"hssearchablecalculatedmobilenumber": "123456",
"hssearchablecalculatedphonenumber": "123456",
"lastmodifieddate": "2024-09-23T13:30:40.386Z",
"lastname": "Connect",
"lifecyclestage": "lead",
"mobilephone": "123456",
"phone": "123456"
},
"createdAt": "2024-09-23T13:30:40.386Z",
"updatedAt": "2024-09-23T13:30:40.386Z",
"archived": false
}
`
Automation
Updated 1 day ago
Function Documentation: HubSpot → Create Deal
Overview
This function creates a new deal in HubSpot using specified input parameters. It involves setting environment variables, preparing the request with deal details, and handling the response from the HubSpot API.
Inputs
hubspotapikey (registry|text) Required Sensitive data
Description: The API key for your HubSpot account.
name (text)
Description: The name of the deal.
deal_stage (enum)
Description: The stage of the deal.
Options
appointmentscheduled
qualifiedtobuy
presentationscheduled
decisionmakerboughtin
contractsent
closedwon
closedlost
close_date (timestamp)
Description: The expected close date of the deal. A unix timestamp in milliseconds.
owner_id (integer)
Description: The ID of the owner of the deal.
amount (decimal)
Description: The amount associated with the deal.
additional_properties (json)
Description: Additional properties in JSON format for the deal.
Function Stack
Create Properties Object
Create Variable: properties_obj
Purpose: Sets properties object from input: additional_properties and other input fields.
HubSpot API Request
API Request to https://api.hubapi.com/crm/v3/objects/deals
Purpose: Sends a POST request to create a new deal in HubSpot.
Preconditions
Precondition: hubspot_api.response.status == 201
Purpose: Ensures successful creation of the deal with HTTP status code 201.
Response
The function returns the result from the HubSpot API response.
Success response
`json
{
"id": "22658811284",
"properties": {
"createdate": "2024-09-26T11:47:07.243Z",
.
.
.
},
"createdAt": "2024-09-26T11:47:07.243Z",
"updatedAt": "2024-09-26T11:47:07.243Z",
"archived": false
}
`
Error response
`json
{
"message": "Uh oh! Hubspot returned with an error: Authentication credentials not found. This API supports OAuth 2.0 authentication and you can find more details at https://developers.hubspot.com/docs/methods/auth/oauth-overview"
}
`
Example
Input
`json
{
"name": "Xano Actions",
"deal_stage": "qualifiedtobuy",
"close_date": 1729771263000,
"owner_id": 0,
"amount": 1456.55,
"additional_properties":
{
"closedwonreason": "Quick deployment"
}
}
`
Output
`json
{
"id": "22651426560",
"properties": {
"amount": "1456.55",
.
.
.
},
"createdAt": "2024-09-26T12:02:50.213Z",
"updatedAt": "2024-09-26T12:02:50.213Z",
"archived": false
}
`
Automation
Updated 2 days ago
Function Documentation: HubSpot → Get Contact
Overview
This function retrieves a specific contact from HubSpot using the contact's ID. It involves setting environment variables, preparing the request, and handling the response from the HubSpot API.
Inputs
id (integer)
Description: The unique identifier of the contact to be retrieved.
properties (text[])
Description: A list of contact properties to retrieve.
Function Stack
HubSpot API Request
API Request to https://api.hubapi.com/crm/v3/objects/contacts/{id}
Purpose: Sends a GET request to retrieve the specified contact from HubSpot.
Preconditions
Precondition: hubspot_api.response.status == 200
Purpose: Ensures successful retrieval of the contact with HTTP status code 200.
Response
The function returns the result from the HubSpot API response.
Success response
`json
{
"id": "12345",
"properties": {
"company": "HubSpot",
"createdate": "2024-09-12T10:58:14.335Z",
"hsobjectid": "12345",
"lastmodifieddate": "2024-09-12T10:58:18.831Z"
},
"createdAt": "2024-09-12T10:58:14.335Z",
"updatedAt": "2024-09-12T10:58:18.831Z",
"archived": false
}
`
Error response
`json
{
"message": "Uh oh! Hubspot returned with an error: Authentication credentials not found. This API supports OAuth 2.0 authentication and you can find more details at https://developers.hubspot.com/docs/methods/auth/oauth-overview"
}
`
Example
Input
`json
{
"id": 123456,
"properties": [
"company"
]
}
`
Output
`json
{
"id": "123456",
"properties": {
"company": "UC",
"createdate": "2024-09-23T13:30:40.386Z",
"hsobjectid": "60968500829",
"lastmodifieddate": "2024-09-23T13:31:43.044Z"
},
"createdAt": "2024-09-23T13:30:40.386Z",
"updatedAt": "2024-09-23T13:31:43.044Z",
"archived": false
}
`
Automation
Updated 3 days ago
HubSpot → Get Deal
Overview
This function retrieves a specific deal from HubSpot using the deal's ID. It involves setting environment variables, preparing the request, and handling the response from the HubSpot API.
Inputs
hubspotapikey (registry|text) Required Sensitive data
Description: The API key for your HubSpot account.
deal_id (integer)
Description: The unique identifier of the deal to be retrieved.
properties (text[])
Description: A list of deal properties to retrieve.
propertieswithhistory (text[])
Description: A list of deal properties with their history to retrieve.
Function Stack
HubSpot API Request
API Request to https://api.hubapi.com/crm/v3/objects/deals/{deal_id}
Purpose: Sends a GET request to retrieve the specified deal from HubSpot.
Preconditions
Precondition: hubspot_api.response.status == 200
Purpose: Ensures successful retrieval of the deal with HTTP status code 200.
Response
The function returns the result from the HubSpot API response.
Success response
`json
{
"deal_id": 22413038713,
"properties": [],
"propertieswithhistory": [
"closedwonreason"
]
}
`
Error response
`json
{
"message": "Uh oh! Hubspot returned with an error: Authentication credentials not found. This API supports OAuth 2.0 authentication and you can find more details at https://developers.hubspot.com/docs/methods/auth/oauth-overview"
}
`
Example
Input
`json
{
"deal_id": 22413038713,
"properties": [],
"propertieswithhistory": [
"closedwonreason"
]
}
`
Output
`json
{
"id": "22413038713",
"properties": {
"amount": "1456.55",
.
.
.
},
"createdAt": "2024-09-26T12:02:50.213Z",
"updatedAt": "2024-09-26T12:02:50.213Z",
"archived": false
}
`
Automation
Updated 3 days ago
Function Documentation: HubSpot → List Contacts
Overview
This function retrieves a list of contacts from HubSpot. It involves setting environment variables, preparing the request with optional parameters, and handling the response from the HubSpot API.
Inputs
hubspotapikey (registry|text) Required Sensitive data
Description: The API key for your HubSpot account.
after (integer)
Description: The paging cursor to get the next set of contacts.
properties (text[])
Description: A list of contact properties to retrieve.
Function Stack
HubSpot API Request
API Request to https://api.hubapi.com/crm/v3/objects/contacts
Purpose: Sends a GET request to retrieve contacts from HubSpot.
Parameters: Includes archived=false, optional after cursor, and specified properties.
Preconditions
Precondition: hubspot_api.response.status == 200
Purpose: Ensures successful retrieval of contacts with HTTP status code 200.
Response
The function returns the result from the HubSpot API response.
Success response
`json
{
"results": [
{
"id": "123456789",
"properties": {
"createdate": "2024-09-12T11:36:05.267Z",
"hsmarketablestatus": "false",
"hsobjectid": "123456789",
"lastmodifieddate": "2024-09-12T11:36:22.982Z"
},
"createdAt": "2024-09-12T11:36:05.267Z",
"updatedAt": "2024-09-12T11:36:22.982Z",
"archived": false
},
.
.
.
],
"paging": {
"next": {
"after": "123456789",
"link": "https://api.hubapi.com/crm/v3/objects/contacts/?archived=false&after=123456789&properties=hsmarketablestatus"
}
}
}
`
Error response
`json
{
"message": "Uh oh! Hubspot returned with an error: Authentication credentials not found. This API supports OAuth 2.0 authentication and you can find more details at https://developers.hubspot.com/docs/methods/auth/oauth-overview"
}
`
Example
Input
`json
{
"after": 0,
"properties": [
"hsmarketablestatus"
]
}
`
Output
`json
{
"results": [
{
"id": "12345",
"properties": {
"createdate": "2024-09-12T11:36:05.267Z",
"hsmarketablestatus": "false",
"hsobjectid": "57309372733",
"lastmodifieddate": "2024-09-12T11:36:22.982Z"
},
"createdAt": "2024-09-12T11:36:05.267Z",
"updatedAt": "2024-09-12T11:36:22.982Z",
"archived": false
},
.
.
.
],
"paging": {
"next": {
"after": "1234",
"link": "https://api.hubapi.com/crm/v3/objects/contacts/?archived=false&after=12345&properties=hsmarketablestatus"
}
}
}
`
Automation
Updated 3 days ago
HubSpot → List Deals
Overview
This function retrieves a list of deals from HubSpot. It involves setting environment variables, preparing the request with optional parameters, and handling the response from the HubSpot API.
Inputs
hubspotapikey (registry|text) Required Sensitive data
Description: The API key for your HubSpot account.
after (integer)
Description: The paging cursor to get the next set of deals.
limit (integer)
Description: The maximum number of deals to retrieve.
properties (text[])
Description: A list of deal properties to retrieve.
propertieswithhistory (text[])
Description: A list of deal properties with their history to retrieve.
Function Stack
HubSpot API Request
API Request to https://api.hubapi.com/crm/v3/objects/deals
Purpose: Sends a GET request to retrieve deals from HubSpot.
Parameters: Includes optional after cursor, limit, and specified properties.
Preconditions
Precondition: hubspot_api.response.status == 200
Purpose: Ensures successful retrieval of deals with HTTP status code 200.
Response
The function returns the result from the HubSpot API response.
Success response
`json
{
"deal_id": 22413038713,
"properties": [],
"propertieswithhistory": [
"closedwonreason"
]
}
`
Error response
`json
{
"message": "Uh oh! Hubspot returned with an error: Authentication credentials not found. This API supports OAuth 2.0 authentication and you can find more details at https://developers.hubspot.com/docs/methods/auth/oauth-overview"
}
`
Example
Input
`json
{
"after": "22393633108",
"limit": 10,
"properties": [],
"propertieswithhistory": [
"dealname"
]
}
`
Output
`json
[
{
"id": "22393633108",
.
.
.
},
.
.
]
`
Automation
Updated 3 days ago
Function Documentation: HubSpot → Update Contact
Overview
This function allows you to edit an existing contact in HubSpot using specified input parameters. It involves setting environment variables, preparing the request with updated information, and handling the response from the HubSpot API.
Inputs
hubspotapikey (registry|text) Required Sensitive data
Description: The API key for your HubSpot account.
first_name (text)
Description: The updated first name of the contact.
last_name (text)
Description: The updated last name of the contact.
email (email)
Description: The updated email address of the contact.
company (text)
Description: The updated company associated with the contact.
lead_status (enum)
Description: The updated lead status of the contact.
Options:
NEW
OPEN
IN_PROGRESS
OPEN_DEAL
UNQUALIFIED
ATTEMPTEDTOCONTACT
CONNECTED
BAD_TIMING
contact_owner (integer)
Description: The updated owner of the contact.
phone_number (text)
Description: The updated phone number of the contact.
contact_id (integer)
Description: The unique identifier of the contact to be edited.
additional_properties (json)
Description: Additional properties in JSON format to be updated.
Schema:
`json
{
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
}
`
> [❗] You can clear a property value by passing an empty string. Example: {"company":""} . This will clear the value stored in the company field.
Function Stack
Set Properties Object
Create Variable: properties_object
Purpose: Sets properties object from input: additional_properties and other input fields.
HubSpot API Request
API Request to https://api.hubapi.com/crm/v3/objects/contacts/{contact_id}
Purpose: Sends a PATCH request to update the specified contact in HubSpot.
Create Variable
Create Variable: inputss
Purpose: Checks if the company input is null.
Preconditions
Precondition: hubspot_api.response.status == 200
Purpose: Ensures successful update of the contact with HTTP status code 200.
Response
The function returns the result from the HubSpot API response.
Success response
`json
{
"id": "123456789",
"properties": {
"company": "Xano",
.
.
.
"phone": "42"
},
"createdAt": "2024-09-16T12:11:28.596Z",
"updatedAt": "2024-09-23T13:41:47.246Z",
"archived": false
}
`
Error message
`json
{
"message":"Uh oh! Hubspot returned with an error: Property values were not valid: [{\"isValid\":false,\"message\":\"Property \\\"prop2\\\" does not exist\",\"error\":\"PROPERTYDOESNTEXIST\",\"name\":\"prop2\",\"localizedErrorMessage\":\"Property \\\"prop2\\\" does not exist\",\"portalId\":47373842},{\"isValid\":false,\"message\":\"Property \\\"prop1\\\" does not exist\",\"error\":\"PROPERTYDOESNTEXIST\",\"name\":\"prop1\",\"localizedErrorMessage\":\"Property \\\"prop1\\\" does not exist\",\"portalId\":47373842}]"
}
`
Example
Input
`json
{
"first_name": "Xano",
"last_name": "Actions",
"email": "actions@xano.com",
"company": "Xano",
"leadstatus": "OPENDEAL",
"contact_owner": 0,
"phone_number": "42",
"contact_id": 123456789,
"additional_properties": {
"mobilephone":"1024"
}
`
Output
`json
{
"id": "123456789",
"properties": {
"company": "Xano",
.
.
.
"phone": "42"
},
"createdAt": "2024-09-16T12:11:28.596Z",
"updatedAt": "2024-09-23T13:41:47.246Z",
"archived": false
}
`
Automation
Updated 3 days ago
HubSpot → Update Deal
Overview
This function allows you to edit an existing deal in HubSpot using specified input parameters. It involves setting environment variables, preparing the request with updated deal details, and handling the response from the HubSpot API.
Inputs
hubspotapikey (registry|text) Required Sensitive data
Description: The API key for your HubSpot account.
name (text)
Description: The updated name of the deal.
deal_stage (enum)
Description: The updated stage of the deal.
Options
appointmentscheduled
qualifiedtobuy
presentationscheduled
decisionmakerboughtin
contractsent
closedwon
closedlost
close_date (timestamp)
Description: The updated expected close date of the deal in unix timestamp format in milliseconds.
owner_id (integer)
Description: The updated ID of the owner of the deal.
amount (decimal)
Description: The updated amount associated with the deal.
deal_id (text)
Description: The unique identifier of the deal to be edited.
additional_properties (json)
Description: Additional properties in JSON format to be updated.
Function Stack
Create Properties Object
Create Variable: properties_obj
Purpose: Sets properties object from input: additional_properties and other input fields.
HubSpot API Request
API Request to https://api.hubapi.com/crm/v3/objects/deals/{deal_id}
Purpose: Sends a PATCH request to update the specified deal in HubSpot.
Preconditions
Precondition: hubspot_api.response.status == 200
Purpose: Ensures successful update of the deal with HTTP status code 200.
Response
The function returns the result from the HubSpot API response.
Success response
`json
{
"name": "Xano Actions",
"deal_stage": "qualifiedtobuy",
"close_date": 1729771263000,
"owner_id": 0,
"amount": 1456.55,
"additional_properties":
{
"closedwonreason": "Quick deployment"
},
"deal_id": "22413038713"
}
`
Error response
`json
{
"message": "Uh oh! Hubspot returned with an error: Authentication credentials not found. This API supports OAuth 2.0 authentication and you can find more details at https://developers.hubspot.com/docs/methods/auth/oauth-overview"
}
`
Example
Input
`json
{
"name": "Xano Actions",
"deal_stage": "qualifiedtobuy",
"close_date": 1729771263000,
"owner_id": 0,
"amount": 1456.55,
"additional_properties":
{
"closedwonreason": "Quick deployment"
},
"deal_id": "22413038713"
}
`
Output
`json
{
"id": "22413038713",
"properties": {
"amount": "1456.55",
.
.
.
},
"createdAt": "2024-09-26T12:02:50.213Z",
"updatedAt": "2024-09-26T12:02:50.213Z",
"archived": false
}
`
Automation
Updated 3 days ago
Function Documentation: OpenAI -> Create a Chat Completion
OpenAI API documentation
Overview
This function generates a chat completion using the OpenAI API based on a user-provided input text. It requires parameters such as the model & input message. The function validates environment variables and conditions before making an API request and processing the response.
Inputs
openaiapikey (registry|text) Required Sensitive data
Description: The API key for your OpenAI account.
model (enum) Required
Description: Specifies the model to be used for generating the chat completion.
Options:
gpt-4o-mini (default)
gpt-4o
message (text) Required
Description: The input message or prompt that will be sent to the OpenAI API for generating the chat completion.
Function Stack
OpenAI API Request
API Request to https://api.openai.com
Purpose: Sends a request to the OpenAI API using the specified model and message.
Precondition: openaiapiresponse.status == 200
Purpose: Confirms that the API request was successful (HTTP status code 200).
OpenAI API Response
Create Variable: response
Purpose: Stores the response from the OpenAI API.
Response
The function returns the generated chat completion
Success response
`json
{"Barack Obama is 6 feet 1 inch tall (185 cm)."}
`
Error response
`json
{
"message": "Incorrect API key provided: ssk-None***GQPD. You can find your API key at https://platform.openai.com/account/api-keys."
}
`
Example
Input
`json
{ "model": "gpt-4o-mini", "message": "What is Obama's height?" }
`
Response
`json
{"Barack Obama is 6 feet 1 inch tall (185 cm)."}
`
AI
Updated 31 min ago
Function Documentation: OpenAI -> Describe an Image from a URL
OpenAI Vision API
Overview
This function generates a description of an image using the OpenAI API based on the provided image URL. It requires parameters such as the image URL & model. The function ensures necessary environment variables are set and verifies conditions before making the API request and processing the response.
Inputs
openaiapikey (registry|text) Required Sensitive data
Description: The API key for your OpenAI account.
image_url (text) Required
Description: The URL of the image that will be sent to the OpenAI API for generating the description.
model (enum) Required
Description: Specifies the model to be used for generating the image description.
Options:
gpt-4o-mini (default)
gpt-4o
Function Stack
OpenAI API Request
API Request to https://api.openai.com
Purpose: Sends a request to the OpenAI API using the specified model and image URL.
Precondition: openaiapiresponse.status == 200
Purpose: Confirms that the API request was successful (HTTP status code 200).
OpenAI API Response
Create Variable: response
Purpose: Stores the response from the OpenAI API.
Response
The function returns the generated image description, optionally including token usage details if the showtokenusage flag is set to true.
Success response
`json
{
"The image depicts a model or miniature of a fortified castle or walled city. It features a large structure at the top, resembling a castle, with walls and towers surrounding smaller buildings that likely represent a village or town inside the fortifications. The overall layout suggests a historical or fantasy setting, commonly seen in architectural models or films."
}
`
Error response
`json
{
"message":"Invalid image."
}
`
Example
Input
`json
{
"imageurl": "https://upload.wikimedia.org/wikipedia/commons/b/b7/MedievalDurr%C3%ABs.jpg",
"model": "gpt-4o-mini",
}
`
Response
`json
{
"The image depicts a model or miniature of a fortified castle or walled city. It features a large structure at the top, resembling a castle, with walls and towers surrounding smaller buildings that likely represent a village or town inside the fortifications. The overall layout suggests a historical or fantasy setting, commonly seen in architectural models or films."
}
`
AI
Updated 1 day ago