The API returns an empty message body when the message is long

lock
push_pin
done
Answered
7

I convert images to base64. When someone posts a message with 2+ large images, the message displays correctly in SuperOffice. However, the REST API returns the message with no value for both ‘body’ and ‘htmlbody'. Is the character limit lower for loading messages with the REST API then the character limit for posting messages?

15 Apr 2024 | 11:39 AM

All Replies (7)

Hi Vidar,

Please provide an example to reproduce:

1. What you expect
2. What you observe

Assuming you are just using the Ticket endpoint, and expecting to get back all properties of each ticket message...

Have you tried using the TicketMessage endpoint to get each individual message with body content?

Best regards.

15 Apr 2024 | 12:23 PM

Ticket, ticket/id/messages, ticketmessage, archive/dynamic - Same result.

In SuperOffice the message(created with REST API) has images:

What the API returns for the same message:




What the API returns for a message with just one small image:

15 Apr 2024 | 12:40 PM

Hi Vidar,

I am unable to recreate your observered error. 

I did POST a ticketmessage with a 4.3MB image as base64 img source and it does appear successfully in the client, as you successfully observed as well. 

When sending a GET request for that TicketMessage, I find that different clients handling the response differently. For example, using VS Code and the Rest Client extension with .http file, I observe this response:

And again with VS Code, using the ThunderBird extension (Similar to Postman), I initially observe this response:

 

Then, when I click the Open in Code link, the complete raw response is displayed containing the complete HtmlBody content with the entire base64 image string.

So, my question to you is, is it possible that the Postman client is truncating the base64 image string, and not the actual response?

Best regards.

 

16 Apr 2024 | 06:57 AM

Thank you for your reply. The size of the response and the raw result in postman is consistent with what I showed it the last reply. Thunder Client in VS code and HttpClient in c# gets the same result. (When testing, for example, the archive/dynamic endpoint I have reviced much larger responses)

Is there no known reason for why the REST API retruns a message diffrent from the message shown in SuperOffice?

16 Apr 2024 | 08:11 AM
Hi Vidar,

As you can see my response size using ThunderBird client is 5.75MB, and I am unable to reproduce your observed results.

Also, it looks like you are running an onsite installation. What version of SuperOffice are you using?

16 Apr 2024 | 08:29 AM

16 Apr 2024 | 08:31 AM

Hi Vidar,

I can't confirm is this issue is related to Bug ID: 34693, but there was some issues with TicketMessage that was fixed in 10.1.8. 

Best regards.

16 Apr 2024 | 08:39 AM

Add reply