What is required for the response from the CRM extensions dataFetchUri?

SOLVE
Highlighted
Regular Contributor

Hi,

 

We are trying to simply put an action button to launch a modal as part of the CRM extensions. We don't need a card as there aren't any objects to technically display. We keep receiving "Response deserialization error", but we suspect it's for not having enough of the json response filled out.

 

What is required?

 

Thanks!

 
Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
HubSpot Moderator

Hey, @brianjlowry.

 

I think I've identified the issue.

 

Your object type has a dataFetchUri which uses a path which is not included in your baseUris array.

 

Per the Object Type Fields section of this article, the baseUris array is "A list of acceptable base URIs for actions. All action URIs must be located under one of these paths."

 

If you include https://developer-test.[YourApp].com/ as a base URI, then your data fetch URI will be a valid path and the object should render.

 

Let me know if this works or I can clarify further!

Isaac Takushi

HubSpot Developer Support
11 Replies 11
HubSpot Moderator

Hi, @brianjlowry.

 

It's not possible to avoid cards completely, but you should be able to create a single card on each record with objectId and title. These are the only fields which are listed as required in our documentation.

 

If I have misunderstood you, could you share an example request and the error you receive?

Isaac Takushi

HubSpot Developer Support
Regular Contributor

Thanks for the reply - we thought as much and tried that already. We're still getting the same error. "Response deserialization error" is showing in the monitoring section of our CRM Extension.

 

Here's the modified JSON:

{
"results": [{
"objectId": 1,
"title": "Not Important"
}],
"primaryAction": {
"type": "IFRAME",
"width": 1920,
"height": 1280,
"uri": "https://development.url",
"label": "Create Quote"
}
}
 
Reply
0 Upvotes
HubSpot Moderator

Hey, @brianjlowry.

 

Apologies for the delayed response. Thanks for confirming.

 

Interestingly, @Derek_Gervais was able to populate an object type without a card using the following code:

 

{
  "results": [],
  "primaryAction": {
      "type": "IFRAME",
      "width": 890,
      "height": 748,
      "uri": "https://example-app.com/endpoint",
      "label": "Do something"
    }
}

Is this what you've been trying? Can you provide the Hub ID of the developer account where this app lives and specify the object type ID?

Isaac Takushi

HubSpot Developer Support
Regular Contributor

Hi @IsaacTakushi ,

 

Thanks for your reply and sorry for my delay. It slipped my mind after I read it initially. Our Hub ID: 2683117 and the App ID: 198067

 

Thanks for your help!

Reply
0 Upvotes
Regular Contributor

Hi @IsaacTakushi,

Any idea would could be the issue? Was it setup wrong originally?

 

Thanks!

Reply
0 Upvotes
HubSpot Moderator

Hey, @brianjlowry.

 

Apologies for the delayed response!

 

To clarify, have you tried returning an empty results array?

 

The following response is producing this behavior in Derek's account, so it's possible to only populate a primary action button:

 

{
  "results": [],
  "primaryAction": {
      "type": "IFRAME",
      "width": 890,
      "height": 748,
      "uri": "https://example-app.com/endpoint",
      "label": "Do something"
    }
}

Isaac Takushi

HubSpot Developer Support
Regular Contributor

Hi @IsaacTakushi ,

 

No worries at all - we're just stuck looking at a black box. We did try the empty result set originally, and the same error ocurred - that was our reasoning for adding the other piece as it seemed like two of those fields were required.

 

Any other ideas in looking at our app setup?

 

Thanks again - we greatly appreciate your help.

Reply
0 Upvotes
HubSpot Moderator

Hey, @brianjlowry.

 

Sorry again for the delay on my end; I was out of office yesterday.

 

I don't have any ideas quite yet, but I'll continue digging. Thank you so much for your continued patience. It's obviously possible, so we'll track down the cause eventually Smiley Wink

Isaac Takushi

HubSpot Developer Support
HubSpot Moderator

Hey, @brianjlowry.

 

I think I've identified the issue.

 

Your object type has a dataFetchUri which uses a path which is not included in your baseUris array.

 

Per the Object Type Fields section of this article, the baseUris array is "A list of acceptable base URIs for actions. All action URIs must be located under one of these paths."

 

If you include https://developer-test.[YourApp].com/ as a base URI, then your data fetch URI will be a valid path and the object should render.

 

Let me know if this works or I can clarify further!

Isaac Takushi

HubSpot Developer Support
Regular Contributor

Hi @IsaacTakushi,

You are the man! Our baseUri has a folder path in it - that appears to be the difference. We'll give it a whirl and see how it goes.

 

Thanks - I truly appreciate your help in tracking this down for us!

Regular Contributor

Hi @IsaacTakushi ,

 

We fixed the issue with the baseUris, and we're still receiving Response Deserialization Errors when it sends the JSON back from our data response action.

 

Here is the JSON:

{ "results": [],"primaryAction": {"type":"IFRAME","width":1920,"height":1280,"uri":"https://www.website.com/","label":"Create Quote"} }

 

Other than formatting, it appears to match the JSON above exactly.

 

Any ideas?

 

Reply
0 Upvotes