Sidecard Loading Error


#1

HI I'm trying to load data from my dataFetchURI for my custom side card.

My api current returns

   {
        "results": [
           {
                "objectId": "51",
                "title": "Last updated",
                "properties": [
                    {
                        "lastUpdated": "1536710400000"
                    }
                ]
            }
        ]
    }

For the endpoint:

https://mysiteurl.com/contact?userId=6545462&userEmail=user@user.com&associatedObjectId=51&associatedObjectType=CONTACT&portalId=4929475&last_updated_from_clearbit=1536710400000&email=bh@hubspot.com

But for some reason I get the error
Sorry, but there's been an error loading the Side Card extension. Please try again or contact Support.

I'm trying to display some user data here pulled from another source. Is my response data formatted correctly? For the object type itself I created a custom object type


#3

Hi @matthew,

This may be due to a slight formatting issue. I see that your endpoint returns objectId as a string instead of a number. The CRM Extensions API documentation and this similar topic indicate that 51 should be returned instead of "51".


#4

Hi @matthew,

Also, the properties array is an optional list of custom properties which does not support key-value pairs. Instead, it requires the format:

{
  "label": "Last updated",
  "dataType": "DATETIME",
  "value": "1536710400000"
}

Instead of placing the lastUpdated property in the properties array, I recommend defining it on the object type. For example:

{
  "results": [
    {
      "objectId": 51,
      "title": "Last updated",
      "lastUpdated": "1536710400000"
    }
  ]
}

#5