ACTIONS
  • Home
  • My Actions
  • My Projects
  • My Packages
Hubspot -> Get Deal
HubSpot → Get Deal

Action summary

Hubspot -> Get Deal

Xano

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

  1. hubspot_api_key (registry|text) Required Sensitive data

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

    • Description: The unique identifier of the deal to be retrieved.
  3. properties (text[])

    • Description: A list of deal properties to retrieve.
  4. 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/{deal_id}
    • Purpose: Sends a GET request to retrieve the specified deal from HubSpot.

2. Preconditions

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

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

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

Output

{
    "id": "22413038713",
    "properties": {
        "amount": "1456.55",
        .
        .
        .
    },
    "createdAt": "2024-09-26T12:02:50.213Z",
    "updatedAt": "2024-09-26T12:02:50.213Z",
    "archived": false
}

Version notes

2024-10-04 14:21:55
Current
2024-10-04T19:21:57.000+00:00