CRM Card: Response data format

Hi

During my implemenation of a CRM Card, I found two different response data documentation.

First:

Second (a newer docu):

Accounts Dashboard | HubSpot then you have to go to the endpoints tab. At the end there is a sample response:

https://api.hubapi.com/crm/v3/extensions/cards/sample-response

Whitch one is the best for a new CRM Card implementation?

Thanks a lot

Hey @baernhardj

The sample response shown on the webhook tab here (and below) is what I’d suggest you use.

// example response
{
 "results": [
 {
 "objectId": 245,
 "title": "API-22: APIs working too fast",
 "link": "http://example.com/1",
 "created": "2016-09-15",
 "priority": "HIGH",
 "project": "API",
 "reported_by": "msmith@hubspot.com",
 "description": "Customer reported that the APIs are just running too fast. This is causing a problem in that they're so happy.",
 "reporter_type": "Account Manager",
 "status": "In Progress",
 "ticket_type": "Bug",
 "updated": "2016-09-28",
 "actions": [
 {
 "type": "IFRAME",
 "width": 890,
 "height": 748,
 "uri": "https://example.com/edit-iframe-contents",
 "label": "Edit",
 "associatedObjectProperties": []
 },
 {
 "type": "IFRAME",
 "width": 890,
 "height": 748,
 "uri": "https://example.com/reassign-iframe-contents",
 "label": "Reassign",
 "associatedObjectProperties": []
 },
 {
 "type": "ACTION_HOOK",
 "httpMethod": "PUT",
 "associatedObjectProperties": [],
 "uri": "https://example.com/tickets/245/resolve",
 "label": "Resolve"
 },
 {
 "type": "CONFIRMATION_ACTION_HOOK",
 "confirmationMessage": "Are you sure you want to delete this ticket?",
 "confirmButtonText": "Yes",
 "cancelButtonText": "No",
 "httpMethod": "DELETE",
 "associatedObjectProperties": [
 "protected_account"
 ],
 "uri": "https://example.com/tickets/245",
 "label": "Delete"
 }
 ]
 },
 {
 "objectId": 988,
 "title": "API-54: Question about bulk APIs",
 "link": "http://example.com/2",
 "created": "2016-08-04",
 "priority": "HIGH",
 "project": "API",
 "reported_by": "ksmith@hubspot.com",
 "description": "Customer is not able to find documentation about our bulk Contacts APIs.",
 "reporter_type": "Support Rep",
 "status": "Resolved",
 "ticket_type": "Bug",
 "updated": "2016-09-23",
 "properties": [
 {
 "label": "Resolved by",
 "dataType": "EMAIL",
 "value": "ijones@hubspot.com"
 },
 {
 "label": "Resolution type",
 "dataType": "STRING",
 "value": "Referred to documentation"
 },
 {
 "label": "Resolution impact",
 "dataType": "CURRENCY",
 "value": "94.34",
 "currencyCode": "GBP"
 }
 ],
 "actions": [
 {
 "type": "IFRAME",
 "width": 890,
 "height": 748,
 "uri": "https://example.com/edit-iframe-contents",
 "label": "Edit"
 },
 {
 "type": "CONFIRMATION_ACTION_HOOK",
 "confirmationMessage": "Are you sure you want to delete this ticket?",
 "confirmButtonText": "Yes",
 "cancelButtonText": "No",
 "httpMethod": "DELETE",
 "associatedObjectProperties": [
 "protected_account"
 ],
 "uri": "https://example.com/tickets/245",
 "label": "Delete"
 }
 ]
 }
 ],
 "settingsAction": {
 "type": "IFRAME",
 "width": 890,
 "height": 748,
 "uri": "https://example.com/settings-iframe-contents",
 "label": "Settings"
 },
 "primaryAction": {
 "type": "IFRAME",
 "width": 890,
 "height": 748,
 "uri": "https://example.com/create-iframe-contents",
 "label": "Create Ticket"
 }
}

Also if it helps I just recently recorded a CRM Card API walkthrough video.

Best of luck with the project!

Hi @coldrickjack

Thanks for the video. I liked it.

The response on the Webhook tab of the docu Accounts Dashboard | HubSpot (same as the legacy documentation) differs from the sample response of the Endpoints tab of the same page.

In that case I will continue with my implementation based on the webhook tab (and legacy docu).

By the way:

Is there a place in HubSpot with more detailed information about errors, than in the monitoring list of the public app? In this monitoring list, I see only the HTTP Status and a general error text.

Thanks an best regads

Bernhard

Hi @baernhardj :waving_hand:

To supplment @coldrickjack’s response, when trying to understand what data HubSpot will send to varying app/webhook endpoints, I like to do some initial testing with a webhook testing tool (e.g. webhook.site).

Specific to your example, simply use the unique URL supplied by your webhook testing tool as your HubSpot App’s Custom Card “Data fetch URL”, then visit a relevant HubSpot CRM record view within the UI. An example request should be visible within your webhook testing tool.

Obviously, it’s best to use this kind of approach with non-sensitive data only (i.e. dummy/test data from a sandbox environment).

I hope that proves useful.

Hi @zach_threadint

Thanks for the linkt to this test tool. This saved me a lot of deployments to our webserver.

So I found my errors in the JSON response.

Kind regadrs

Bernhard

Hi @baernhardj :waving_hand:

Happy to help :slightly_smiling_face: