APIs & Integrations

PaulAlmond91
Participant

Response deserialization error - CRM Extension

SOLVE

I have created an integration with our app and have successfully made this work without including a link.

This morning I have attempted to add the link and I'm receiving the response deserialization error which I understand is that the output is not matching the required format/fields.

 

Here is the json that I am returning 

{
   "results":[
      {
         "objectId":124783,
         "title":"Presentation and Public Speaking Skills",
         "link":"https://tswt.administrateapp.com/beta#/events/events/31823#students",
         "type":"Delegate",
         "status":"attended",
         "event_start":"2019-12-10T09:00:00Z",
         "event_end":"2019-12-11T09:00:00Z",
         "attendance":100
      },
      {
         "objectId":124781,
         "title":"Time Management",
         "link":"https://tswt.administrateapp.com/beta#/events/events/31794#students",
         "type":"Delegate",
         "status":"attended",
         "event_start":"2019-12-02T09:00:00Z",
         "event_end":"2019-12-02T09:00:00Z",
         "attendance":100
      },
      {
         "objectId":116803,
         "title":"Time Management",
         "link":"https://tswt.administrateapp.com/beta#/events/events/31792#students",
         "type":"Delegate",
         "status":"cancelled",
         "event_start":"2019-06-07T09:00:00Z",
         "event_end":"2019-06-07T09:00:00Z",
         "attendance":0
      },
      {
         "objectId":115684,
         "title":"Mental Health Awareness",
         "link":"https://tswt.administrateapp.com/beta#/events/events/32951#students",
         "type":"Delegate",
         "status":"cancelled",
         "event_start":"2019-04-02T09:00:00Z",
         "event_end":"2019-04-02T09:00:00Z",
         "attendance":0
      },
      {
         "objectId":116095,
         "title":"Time Management",
         "link":"https://tswt.administrateapp.com/beta#/events/events/31790#students",
         "type":"Delegate",
         "status":"cancelled",
         "event_start":"2019-01-29T09:00:00Z",
         "event_end":"2019-01-29T09:00:00Z",
         "attendance":0
      },
      {
         "objectId":112287,
         "title":"HABC Emergency First Aid at Work",
         "link":"https://tswt.administrateapp.com/beta#/events/events/30881#students",
         "type":"Delegate",
         "status":"attended",
         "event_start":"2018-09-21T09:00:00Z",
         "event_end":"2018-09-21T09:00:00Z",
         "attendance":100
      },
      {
         "objectId":105933,
         "title":"Customer Service & Complaint Handling",
         "link":"https://tswt.administrateapp.com/beta#/events/events/29721#students",
         "type":"Delegate",
         "status":"attended",
         "event_start":"2018-03-29T09:00:00Z",
         "event_end":"2018-03-29T09:00:00Z",
         "attendance":100
      }
   ],
   "totalCount":7,
   "allItemLink":"https://tswt.administrateapp.com/ViewContact/view/id/29883",
   "itemLabel":"View all Events"
}

I'm pretty sure it is to do with the link but I cannot identify the cause. I've checked the usual issues (making sure a link is set or is null etc) but no joy. Any advice?

0 Upvotes
1 Accepted solution
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Response deserialization error - CRM Extension

SOLVE

Hey @PaulAlmond91,

 

Just an update here. I've checked in with our team and we are able to confirm that the URI provided - https://tswt.administrateapp.com/beta#/events/events/31823#students is not valid according to RFC 3986https://tools.ietf.org/html/rfc3986#section-3.5.

 

A # symbol is reserved for a fragment . Any characters that follow a # until the end of the URI are considered part of the fragment and additional # are not allowed. Since the URI provided has more than one # , the one that indicates the fragment should be left as a # and the other one needs to be encoded with %23.

 

Our best guess looking at it is that the fragment is “#students” and the earlier # needs to be encoded with %23. Something like this - https://tswt.administrateapp.com/beta%23/events/events/31823#students

 

Although, we would generally recommend avoiding the use of # in a URI other than for fragments as it can lead to difficulty in using the URI (due to the encoding requirement) as we are seeing here.

 

Let me know if this works for you!

View solution in original post

0 Upvotes
8 Replies 8
WendyGoh
HubSpot Employee
HubSpot Employee

Response deserialization error - CRM Extension

SOLVE

Hey @PaulAlmond91,

 

Digging into this it looks like your hypothesis was correct! The error is likely due to the link property and two things I noticed here:

1. When I remove the symbol '#', the CRM card shows up just fine with no error

2. When I attempted to add the following link 'https://tswt.administrateapp.com/beta#/events/events/31823#students' under 'Custom actions' tab to whitelist it, it throws a 'The provided URI was not valid' error when saving it

 

In this case, it looks like this is due to an invalid uri link. Could you try removing the '#' and see if it works for you?

0 Upvotes
PaulAlmond91
Participant

Response deserialization error - CRM Extension

SOLVE

Hi @WendyGoh 

Yeah it appears it doesn't like the #students at the end.


Another query just as it is happening - I included the allItemLink in hopes that would limit the results displayed and show a view all link at the bottom akin to what is shown here: https://developers.hubspot.com/docs/methods/crm-extensions/crm-extensions-overview (where it says view all 7 tickets)

 

However, the above output displays all entries on the screen and no view more link. Have I overlooked or structured the output incorrectly to enable this feature?

0 Upvotes
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Response deserialization error - CRM Extension

SOLVE

Hey @PaulAlmond91,

 

Just an update here. I've checked in with our team and we are able to confirm that the URI provided - https://tswt.administrateapp.com/beta#/events/events/31823#students is not valid according to RFC 3986https://tools.ietf.org/html/rfc3986#section-3.5.

 

A # symbol is reserved for a fragment . Any characters that follow a # until the end of the URI are considered part of the fragment and additional # are not allowed. Since the URI provided has more than one # , the one that indicates the fragment should be left as a # and the other one needs to be encoded with %23.

 

Our best guess looking at it is that the fragment is “#students” and the earlier # needs to be encoded with %23. Something like this - https://tswt.administrateapp.com/beta%23/events/events/31823#students

 

Although, we would generally recommend avoiding the use of # in a URI other than for fragments as it can lead to difficulty in using the URI (due to the encoding requirement) as we are seeing here.

 

Let me know if this works for you!

0 Upvotes
PaulAlmond91
Participant

Response deserialization error - CRM Extension

SOLVE

@WendyGoh That makes sense - its something I don't have too much control but I can use the link without the #students.

 

Do you have any thoughts regarding:

Another query just as it is happening - I included the allItemLink in hopes that would limit the results displayed and show a view all link at the bottom akin to what is shown here: https://developers.hubspot.com/docs/methods/crm-extensions/crm-extensions-overview (where it says view all 7 tickets)

 

Thanks

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Response deserialization error - CRM Extension

SOLVE

Hey @PaulAlmond91,

 

This looks to be an unexpected behavior. I would expect it to show 'View all 7 tickets'. In this case, I'll have to check in with my internal team and I'll keep you posted here!

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Response deserialization error - CRM Extension

SOLVE

Hey @PaulAlmond91,

 

Just an update here!

 

The team has recently pushed an update which appears to have resolved the "Response deserialization error" response for other customers and this may possibly resolved the `allItemLink` not displaying issue.

 

Can you check if you're still able to reproduce the error now, after the fix was pushed?

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Response deserialization error - CRM Extension

SOLVE

Hey @PaulAlmond91,

 

It looks like the results have "allItemLink", not "allItemsLink". Could you try and see if that fixes it?

0 Upvotes
PaulAlmond91
Participant

Response deserialization error - CRM Extension

SOLVE

Hi @WendyGoh 


That is indeed the error - always a simple answer.

Thanks for your assistance this is now working as i'd hope.

0 Upvotes