APIs & Integrations

juliardi
Member

Workflow extension empty contact properties

SOLVE

Hi there, I have tested my workflow extension which successfully enrolled contacts. However the request was :

{
    "origin": {
        "portalId": 7861782,
        "actionDefinitionId": 1581,
        "actionDefinitionVersion": 5,
        "extensionDefinitionId": 1581,
        "extensionDefinitionVersionId": 5
    },
    "object": {
        "objectId": 3827,
        "propertyValues": {},
        "properties": {},
        "objectType": "CONTACT"
    },
    "fields": {
        "message_id": "kajdklajldja",
        "internal_key": "kajdla",
        "message_placeholder": "adadkajlda"
    },
    "callbackId": "ap-7861782-37634654884-180105910-0",
    "inputFields": {
        "message_id": "kajdklajldja",
        "internal_key": "kajdla",
        "message_placeholder": "adadkajlda"
    }
}

the contact properties was empty, then I tried to use webhook instead. All the contact properties showed up :

{
    "vid": 1797,
    "canonical-vid": 1797,
    "merged-vids": [],
    "portal-id": 7861782,
    "is-contact": true,
    "profile-token": "AO_T-mPMi9AOVLNu9ym1pYbEL-r-OlFMaabah8s2oeaiwSNiepFRUSec06nvAfrYawRnmh_u-RX2m5KXOMEajngSJwbXAcSup8Z8Owx4BautGoHgfi26Gt5Bnza5ioRKKTEzBspLVjsr",
    "profile-url": "https://app.hubspot.com/contacts/7861782/contact/1797",
    "properties": {
        "hs_is_unworked": {
            "value": "true",
            "versions": [
                {
                    "value": "true",
                    "source-type": "CALCULATED",
                    "source-id": null,
                    "source-label": null,
                    "timestamp": 1591578540338,
                    "selected": false
                }
            ]
        },
        "firstname": {
            "value": "Dummy1",
            "versions": [
                {
                    "value": "Dummy1",
                    "source-type": "IMPORT",
                    "source-id": "9578346",
                    "source-label": null,
                    "timestamp": 1591578539973,
                    "selected": false
                }
            ]
        },
        "num_unique_conversion_events": {
            "value": "0",
            "versions": [
                {
                    "value": "0",
                    "source-type": "CALCULATED",
                    "source-id": null,
                    "source-label": null,
                    "timestamp": 0,
                    "selected": false
                }
            ]
        },
        "hs_analytics_revenue": {
            "value": "0.0",
            "versions": [
                {
                    "value": "0.0",
                    "source-type": "ANALYTICS",
                    "source-id": "ContactAnalyticsDetailsUpdateWorker",
                    "source-label": null,
                    "timestamp": 1591578541863,
                    "selected": false
                }
            ]
        },
        "createdate": {
            "value": "1591578539981",
            "versions": [
                {
                    "value": "1591578539981",
                    "source-type": "IMPORT",
                    "source-id": "9578346",
                    "source-label": null,
                    "timestamp": 1591578539981,
                    "selected": false
                }
            ]
        },
        "hs_social_num_broadcast_clicks": {
            "value": "0",
            "versions": [
                {
                    "value": "0",
                    "source-type": "ANALYTICS",
                    "source-id": "ContactAnalyticsDetailsUpdateWorker",
                    "source-label": null,
                    "timestamp": 1591578541863,
                    "selected": false
                }
            ]
        },
        "hs_analytics_num_visits": {
            "value": "0",
            "versions": [
                {
                    "value": "0",
                    "source-type": "ANALYTICS",
                    "source-id": "ContactAnalyticsDetailsUpdateWorker",
                    "source-label": null,
                    "timestamp": 1591578541863,
                    "selected": false
                }
            ]
        },
        "dummy": {
            "value": "TRUE",
            "versions": [
                {
                    "value": "TRUE",
                    "source-type": "IMPORT",
                    "source-id": "9578346",
                    "source-label": null,
                    "timestamp": 1591578539973,
                    "selected": false
                }
            ]
        },
        "hs_social_linkedin_clicks": {
            "value": "0",
            "versions": [
                {
                    "value": "0",
                    "source-type": "ANALYTICS",
                    "source-id": "ContactAnalyticsDetailsUpdateWorker",
                    "source-label": null,
                    "timestamp": 1591578541863,
                    "selected": false
                }
            ]
        },
        "hs_analytics_source": {
            "value": "OFFLINE",
            "versions": [
                {
                    "value": "OFFLINE",
                    "source-type": "ANALYTICS",
                    "source-id": "ContactAnalyticsDetailsUpdateWorker",
                    "source-label": null,
                    "timestamp": 1591578541863,
                    "selected": false
                }
            ]
        },
        "hs_analytics_num_page_views": {
            "value": "0",
            "versions": [
                {
                    "value": "0",
                    "source-type": "ANALYTICS",
                    "source-id": "ContactAnalyticsDetailsUpdateWorker",
                    "source-label": null,
                    "timestamp": 1591578541863,
                    "selected": false
                }
            ]
        },
        "hs_email_domain": {
            "value": "d.com",
            "versions": [
                {
                    "value": "d.com",
                    "source-type": "CALCULATED",
                    "source-id": null,
                    "source-label": null,
                    "timestamp": 1591578539981,
                    "selected": false
                }
            ]
        },
        "email": {
            "value": "dummy1@d.com",
            "versions": [
                {
                    "value": "dummy1@d.com",
                    "source-type": "IMPORT",
                    "source-id": "9578346",
                    "source-label": null,
                    "timestamp": 1591578539981,
                    "selected": false
                }
            ]
        },
        "hs_analytics_first_timestamp": {
            "value": "1591578539981",
            "versions": [
                {
                    "value": "1591578539981",
                    "source-type": "ANALYTICS",
                    "source-id": "ContactAnalyticsDetailsUpdateWorker",
                    "source-label": null,
                    "timestamp": 1591578541863,
                    "selected": false
                }
            ]
        },
        "lastmodifieddate": {
            "value": "1591580810255",
            "versions": [
                {
                    "value": "1591580810255",
                    "source-type": "CALCULATED",
                    "source-id": null,
                    "source-label": null,
                    "timestamp": 1591580810255,
                    "selected": false
                }
            ]
        },
        "hs_social_google_plus_clicks": {
            "value": "0",
            "versions": [
                {
                    "value": "0",
                    "source-type": "ANALYTICS",
                    "source-id": "ContactAnalyticsDetailsUpdateWorker",
                    "source-label": null,
                    "timestamp": 1591578541863,
                    "selected": false
                }
            ]
        },
        "hs_lifecyclestage_subscriber_date": {
            "value": "1591578539981",
            "versions": [
                {
                    "value": "1591578539981",
                    "source-type": "IMPORT",
                    "source-id": "9578346",
                    "source-label": null,
                    "timestamp": 1591578539981,
                    "selected": false
                }
            ]
        },
        "hs_analytics_average_page_views": {
            "value": "0",
            "versions": [
                {
                    "value": "0",
                    "source-type": "ANALYTICS",
                    "source-id": "ContactAnalyticsDetailsUpdateWorker",
                    "source-label": null,
                    "timestamp": 1591578541863,
                    "selected": false
                }
            ]
        },
        "hs_social_facebook_clicks": {
            "value": "0",
            "versions": [
                {
                    "value": "0",
                    "source-type": "ANALYTICS",
                    "source-id": "ContactAnalyticsDetailsUpdateWorker",
                    "source-label": null,
                    "timestamp": 1591578541863,
                    "selected": false
                }
            ]
        },
        "hs_predictivecontactscore_v2": {
            "value": "3.15",
            "versions": [
                {
                    "value": "3.15",
                    "source-type": "CALCULATED",
                    "source-id": null,
                    "source-label": "HubSpot Predictive Contact Scoring Model",
                    "timestamp": 1591578565741,
                    "selected": false
                }
            ]
        },
        "hs_is_contact": {
            "value": "true",
            "versions": [
                {
                    "value": "true",
                    "source-type": "CALCULATED",
                    "source-id": null,
                    "source-label": null,
                    "timestamp": 0,
                    "selected": false
                }
            ]
        },
        "num_conversion_events": {
            "value": "0",
            "versions": [
                {
                    "value": "0",
                    "source-type": "CALCULATED",
                    "source-id": null,
                    "source-label": null,
                    "timestamp": 1591578539981,
                    "selected": false
                }
            ]
        },
        "hs_object_id": {
            "value": "1797",
            "versions": [
                {
                    "value": "1797",
                    "source-type": "CALCULATED",
                    "source-id": null,
                    "source-label": null,
                    "timestamp": 1591578539981,
                    "selected": false
                }
            ]
        },
        "currentlyinworkflow": {
            "value": "false",
            "versions": [
                {
                    "value": "false",
                    "source-type": "WORKFLOWS",
                    "source-id": "13566793",
                    "source-label": null,
                    "timestamp": 1591580809858,
                    "selected": false
                },
                {
                    "value": "true",
                    "source-type": "WORKFLOWS",
                    "source-id": "13566793",
                    "source-label": null,
                    "timestamp": 1591580806690,
                    "selected": false
                },
                {
                    "value": "false",
                    "source-type": "WORKFLOWS",
                    "source-id": "13566793",
                    "source-label": null,
                    "timestamp": 1591578689749,
                    "selected": false
                },
                {
                    "value": "true",
                    "source-type": "WORKFLOWS",
                    "source-id": "13566793",
                    "source-label": null,
                    "timestamp": 1591578688366,
                    "selected": false
                }
            ]
        },
        "hs_analytics_num_event_completions": {
            "value": "0",
            "versions": [
                {
                    "value": "0",
                    "source-type": "ANALYTICS",
                    "source-id": "ContactAnalyticsDetailsUpdateWorker",
                    "source-label": null,
                    "timestamp": 1591578541863,
                    "selected": false
                }
            ]
        },
        "hs_analytics_source_data_2": {
            "value": "9578346",
            "versions": [
                {
                    "value": "9578346",
                    "source-type": "ANALYTICS",
                    "source-id": "ContactAnalyticsDetailsUpdateWorker",
                    "source-label": null,
                    "timestamp": 1591578541863,
                    "selected": false
                }
            ]
        },
        "hs_social_twitter_clicks": {
            "value": "0",
            "versions": [
                {
                    "value": "0",
                    "source-type": "ANALYTICS",
                    "source-id": "ContactAnalyticsDetailsUpdateWorker",
                    "source-label": null,
                    "timestamp": 1591578541863,
                    "selected": false
                }
            ]
        },
        "hs_analytics_source_data_1": {
            "value": "IMPORT",
            "versions": [
                {
                    "value": "IMPORT",
                    "source-type": "ANALYTICS",
                    "source-id": "ContactAnalyticsDetailsUpdateWorker",
                    "source-label": null,
                    "timestamp": 1591578541863,
                    "selected": false
                }
            ]
        },
        "lifecyclestage": {
            "value": "subscriber",
            "versions": [
                {
                    "value": "subscriber",
                    "source-type": "IMPORT",
                    "source-id": "9578346",
                    "source-label": null,
                    "timestamp": 1591578539981,
                    "selected": false
                }
            ]
        },
        "age": {
            "value": "1000",
            "versions": [
                {
                    "value": "1000",
                    "source-type": "IMPORT",
                    "source-id": "9578346",
                    "source-label": null,
                    "timestamp": 1591578539973,
                    "selected": false
                }
            ]
        }
    },
    "form-submissions": [],
    "list-memberships": [
        {
            "static-list-id": 1,
            "internal-list-id": 1,
            "timestamp": 1591578688800,
            "vid": 1797,
            "is-member": true
        },
        {
            "static-list-id": 2,
            "internal-list-id": 2,
            "timestamp": 1591580836844,
            "vid": 1797,
            "is-member": true
        },
        {
            "static-list-id": 3,
            "internal-list-id": 3,
            "timestamp": 1591578690395,
            "vid": 1797,
            "is-member": true
        },
        {
            "static-list-id": 5,
            "internal-list-id": 5,
            "timestamp": 1591578556439,
            "vid": 1797,
            "is-member": true
        }
    ],
    "identity-profiles": [
        {
            "vid": 1797,
            "is-deleted": false,
            "is-contact": false,
            "pointer-vid": 0,
            "previous-vid": 0,
            "linked-vids": [],
            "saved-at-timestamp": 0,
            "deleted-changed-timestamp": 0,
            "identities": [
                {
                    "type": "EMAIL",
                    "value": "dummy1@d.com",
                    "timestamp": 1591578539981,
                    "is-primary": true,
                    "source": "UNSPECIFIED"
                },
                {
                    "type": "LEAD_GUID",
                    "value": "5e9605c9-557d-4b73-81ba-cb6e408caa61",
                    "timestamp": 1591578539988,
                    "source": "UNSPECIFIED"
                }
            ]
        }
    ],
    "merge-audits": []
}

my question is, how to make this contact properties appear in my workflow entenstion outbound request like common webhook ? thank you.

  

0 Upvotes
1 Accepted solution
Willson
Solution
HubSpot Employee
HubSpot Employee

Workflow extension empty contact properties

SOLVE

Hi @juliardi 

 

The Workflow Extensions and Workflow Webhooks tools work differently with regards to the data they post. The extension is defined by yourself and will only work with the information that is provided to the extension. As an example, if we take a look at the sample defintion from our docs:

 

{
    "integrationAppId": 1162896,
    "extensionName": "Create New Appointment",
    "webhookUrl": "https://api.myservice.com/hubspot/new-appointment",
    "fieldMetadata": [
        {
            "label": "Appointment Summary",
            "key": "appointment_title",
            "fieldType": "TEXT",
            "values": [
                {
                    "type": "STATIC_VALUE",
                    "allowsMergeTags": true
                }
            ]
        },
        {
            "label": "Requested Appointment Date",
            "key": "appointment_date",
            "fieldType": "DATE",
            "values": [
                {
                    "type": "OBJECT_PROPERTY"
                }
            ]
        },
        {
            "label": "Appointment Notes",
            "key": "appointment_notes",
            "fieldType": "TEXTAREA",
            "values": [
                {
                    "type": "STATIC_VALUE",
                    "allowsMergeTags": true
                }
            ]
        }
    ]
}

 

 

If I want I want the object array to populate with object property values, I need to ensure that the value definition types are set to OBJECT_PROPERTY. Once done, the field presents a dropdown menu containing HubSpot properties within the extension UI. When the extension is executed, the value contained in the property is used as the value corresponding to the field’s key.

 

 

Whereas the webhook, this is designed by default to post the API data we have associated to the object that is enrolled. In this case, if a contact is enrolled and the webhook action executes, we will post the API data for said contact to the webhook URL. 

 

I hope this helps!

Product Manager @ HubSpot

View solution in original post

0 Upvotes
2 Replies 2
Willson
Solution
HubSpot Employee
HubSpot Employee

Workflow extension empty contact properties

SOLVE

Hi @juliardi 

 

The Workflow Extensions and Workflow Webhooks tools work differently with regards to the data they post. The extension is defined by yourself and will only work with the information that is provided to the extension. As an example, if we take a look at the sample defintion from our docs:

 

{
    "integrationAppId": 1162896,
    "extensionName": "Create New Appointment",
    "webhookUrl": "https://api.myservice.com/hubspot/new-appointment",
    "fieldMetadata": [
        {
            "label": "Appointment Summary",
            "key": "appointment_title",
            "fieldType": "TEXT",
            "values": [
                {
                    "type": "STATIC_VALUE",
                    "allowsMergeTags": true
                }
            ]
        },
        {
            "label": "Requested Appointment Date",
            "key": "appointment_date",
            "fieldType": "DATE",
            "values": [
                {
                    "type": "OBJECT_PROPERTY"
                }
            ]
        },
        {
            "label": "Appointment Notes",
            "key": "appointment_notes",
            "fieldType": "TEXTAREA",
            "values": [
                {
                    "type": "STATIC_VALUE",
                    "allowsMergeTags": true
                }
            ]
        }
    ]
}

 

 

If I want I want the object array to populate with object property values, I need to ensure that the value definition types are set to OBJECT_PROPERTY. Once done, the field presents a dropdown menu containing HubSpot properties within the extension UI. When the extension is executed, the value contained in the property is used as the value corresponding to the field’s key.

 

 

Whereas the webhook, this is designed by default to post the API data we have associated to the object that is enrolled. In this case, if a contact is enrolled and the webhook action executes, we will post the API data for said contact to the webhook URL. 

 

I hope this helps!

Product Manager @ HubSpot
0 Upvotes
kmuenze
Participant | Platinum Partner
Participant | Platinum Partner

Workflow extension empty contact properties

SOLVE

It would be fantastic if we could request the properties of the object as a part of the payload.

 

For example, we need to get the contact owner's email address in the payload which works wonderfully in the standard webhook but with the extension we need to make an additional api call to get that data.

0 Upvotes