ACTIONS
  • Home
  • My Actions
  • My Projects
  • My Packages
Hubspot -> List Deals
HubSpot → List Deals

Action summary

Hubspot -> List Deals

Xano

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

  1. hubspot_api_key (registry|text) Required Sensitive data

    • Description: The API key for your HubSpot account.
  2. after (integer)

    • Description: The paging cursor to get the next set of deals.
  3. limit (integer)

    • Description: The maximum number of deals to retrieve.
  4. properties (text[])

    • Description: A list of deal properties to retrieve.
  5. properties_with_history (text[])

    • Description: A list of deal properties with their history to retrieve.

Function Stack

1. HubSpot API Request

  1. 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.

2. Preconditions

  1. 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

{
  "deal_id": 22413038713,
  "properties": [],
  "properties_with_history": [
    "closed_won_reason"
  ]
}

Error response

{
    "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

{
  "after": "22393633108",
  "limit": 10,
  "properties": [],
  "properties_with_history": [
    "dealname"
  ]
}

Output

[
    {
        "id": "22393633108",
        .
        .
        .
    },
    .
    .
]

Version notes

2024-10-04 14:23:33
Current
2024-10-04T19:23:35.000+00:00