HubSpot Read
In this article
Overview
Use this Snap to retrieve data objects from HubSpot. For more information about HubSpot APIs, see HubSpot Documentation.
Prerequisites
None
Support for Ultra Pipelines
Works in Ultra Pipelines.
See Snap Support for Ultra Pipelines.
Limitations
None.
Known Issues
None.
Snap Views
Type | Format | Number of Views | Examples of Upstream and Downstream Snaps | Description |
---|---|---|---|---|
Input | Document |
|
| A document containing details with which to identify the data object to retrieve from HubSpot. |
Output | Document |
|
| A document containing details of the data object retrieved from HubSpot. |
Error | Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the pipeline by choosing one of the following options from the When errors occur list under the Views tab:
Learn more about Error handling in Pipelines. |
Snap Settings
Asterisk ( * ): Indicates a mandatory field.
Suggestion icon (): Indicates a list that is dynamically populated based on the configuration.
Expression icon ( ): Indicates the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.
Add icon ( ): Indicates that you can add fields in the fieldset.
Remove icon ( ): Indicates that you can remove fields from the fieldset.
Upload icon ( ): Indicates that you can upload files.
Field Name | Field Type | Description | |
---|---|---|---|
Label* Default Value: HubSpot Read | String | Specify a name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline. | |
Entity*
Default Value: N/A | String | Select the data object to read. | |
Action*
Default Value: N/A | String | Select the read-action to perform on the entity selected above. Click the Suggestion icon to see the list of supported actions. | |
Required parameters
| Use this field set to enable the Snap to perform a specific action. | ||
Parameter
Default Value: N/A | String | Specify the names of the required parameters. Click the Suggestion icon to see the list of supported parameters. | |
Value
Default Value: N/A | Multiple | Specify the values of the required parameters. The data type of this field depends on the specified parameter. | |
Optional parameters | Specify the optional parameters for a specific action. Specify each parameter in a separate row. | ||
| Parameter
Default Value: N/A | String | Specify the names of the optional parameters. Click the Suggestion icon to see the list of supported parameters. |
| Value Default Value: N/A | String | Specify the values for optional parameters. The data type of this field depends on the specified parameter. |
Filter parameters
| This property enables you to filter the results from the API response based on logical operations.
| ||
Parameter
Default Value: N/A | String | Specify the system parameter $filter fields to be included in the output. | |
Operator
Default Value: Like | String | Specify the comparison operator for the system parameter $filter. | |
Value
Default Value: N/A | Multiple | Enter the values of the specified input $filter fields. The data type of this field depends on the specified parameter. | |
Order records by
| Select the order of the specified parameters. The order types to be selected are either ascending or descending. Not all parameters support sorting. Refer to HubSpot API Documentation for more information. | ||
Parameter
Default Value: N/A | String | Enter the parameter for which to specify the order. | |
Value Default Value: ASCENDING | String | Select one of the following orders in which to sort the specified parameter:
| |
Advanced options | Use this section of Snap Settings to specify options to control the number of records in the output. This section comprises the following fields:
| ||
Output entry offset
Default Value: 0 | Integer | Specify the number of records to skip during the read operation. Leave it empty so as not to skip any records. | |
Output entry limit
Default Value: 100 | Integer | Select the number of records to fetch in the read operation. Leave it empty to retrieve the default number of records. | |
Automatic pagination
Default Value: Selected | Checkbox | Select this checkbox to enable the Snap to return all the records in the output. By default, the HubSpot Read Snap returns the maximum number of records per page from HubSpot based on the entity. The remaining records, if any, display in the subsequent pages. If you deselect the Automatic pagination checkbox, the Snap returns only the records of the first page in the output. Learn more about Usage of Automatic pagination. | |
Connection timeout*
Default Value: 30 | Integer | Specify the time in seconds for the Snap to wait before terminating the request because of a failure to establish a connection to the target service. | |
Number of retries*
Default Value: 3 | Integer | Specify the maximum number of retry attempts to make if a connection failure or timeout occurs. | |
Retry interval (seconds)*
Default Value: N/A | Integer | Specify the number of seconds for which the Snap must wait before attempting recovery from a network failure. | |
Retry policy
Default Value: Connection errors | Dropdown list | Choose the retry policy for connection and error responses. The available options are:
| |
Snap Execution
Default Value: Validate & Execute | Dropdown list | Indicates how the Snap must be executed. Available options are:
|
Troubleshooting
Error | Reason | Resolution |
---|---|---|
Missing required parameters. | There is a required parameter that was not provided. | Verify whether all required parameters are configured. |
You have reached your ten secondly rolling limit. | There are too many requests to REST endpoint. | Select Connection and API limit exceeded (429) errors in the Retry Policy and adjust the values for “Number of retries” and “Retry interval”. |
You have reached your daily limit. | There are too many requests to REST endpoint. | The maximum number of daily requests has been reached, and no further requests can be made until it resets. For more information refer to API Meters. |
Additional information
Usage of Automatic pagination
The response for auto pagination is an array of response batches where each batch contains the default number of records returned by the HubSpot API for the specific entity. By default, the HubSpot Read Snap returns the maximum number of records per page in the response from HubSpot based on the entity. The remaining records, if any, display in the subsequent pages.
If you select the Automatic pagination checkbox, this Snap returns all the records in the output. For example, if there are 100 records for a certain object, and:
if the Output entry limit is 5, and the Output entry offset is 0, then the Snap returns 20 batches in the response, with each batch containing 5 records.
if the Output entry limit is set as 5, and the Output entry offset is 10, then the Snap returns 18 batches in the response, each batch containing 5 records. The response starts from the 11th record and skips the initial 10 records.
If you deselect the Automatic pagination checkbox, the Snap returns only the records of the first page in the output. The Snap decodes the JSON-formatted API response to split all records into single output documents, which are displayed in the output view of the Snap. You can use the Output entry limit and Output entry offset fields to control the number of records.
General Behavior
The following behaviors of HubSpot are useful to know in order to easily use the read snap:
There are two different date input:
Milliseconds.
Example: Date 1420772453000. This value represents the date Fri Jan 09 2015 04:00:53 GMT+0100
Dates.
Example: Date 20150109. This value represents the date Fri Jan 09 2015 00:00:00
The maximum of records returned is endpoint specific.
Some Entities of HubSpot have required parameters to be used. Without which, a 404 exception is thrown by HubSpot. This exception will indicate which mandatory field is required. You will need to specify it in the Required parameters section.
Refer to HubSpot API Documentation to see endpoints information.
Example
Retrieving user data from HubSpot
The HubSpot Read Snap is used to retrieve user data from HubSpot. The following HubSpot Read Snap shows how we can use the HubSpot Read Snap to accomplish this task.
We configure the HubSpot Read Snap to read the entity Company with the Get all companies action as shown below:
A successful validation or execution of the Snap gives the following output preview, showing the query results.
We format the above output as a JSON file using the JSON Formatter Snap and write the JSON Formatter Snap's output into a local file using the File Writer Snap.
To view the newly-created file, you must SSH to the target directory and open the newly-created file.
The following picture shows the preview of the result output JSON file.
Downloads
Download and import the Pipeline into SnapLogic.
Configure Snap accounts as applicable.
Furnish Pipeline parameters as applicable.
See Also
Have feedback? Email helpdesk@rojoconsultancy.com © Rojo Consultancy