What is the correct way of sending html messages in API. The data/html;charset=utf-8 is not working. I am using osTicket Version v1.10 (901e5ea). Thanks$data = array( "alert" => true, "autorespond" => false, 'name' => 'Support', // from name aka User/Client Name 'email' => $email, // from email aka User/Client Email 'subject' => $subject, // test subject, aka Issue Summary "source" => "API", 'message' => "data/html;charset=utf-8,$message" // test ticket body, aka Issue Details.);

I have not tried the api myself but i would try html encoding the html message.http://string-functions.com/htmlencode.aspx

Please see documenation:https://github.com/osTicket/osTicket/blob/55dc25ace736baeaf224ee608cfabc0218022036/setup/doc/api.mdandhttps://github.com/osTicket/osTicket/blob/55dc25ace736baeaf224ee608cfabc0218022036/setup/doc/api/tickets.md

I am testing on PostMan app. And can't get it right. Followed the instructions. {    "alert": true,    "autorespond": true,    "source": "API",    "name": "Angry User",    "email": "suppoer@api.com",    "phone": "3185558634X123",    "subject": "Testing API",    "message": "data/html,<b>HERE</b>"}HeadersX-API-Key:<API Key>Content-Type/jsonMIME-Version.0But can't get it right

Screen Shot 2017-05-09 at 3.21.30 PM.png

Screen Shot 2017-05-09 at 3.21.41 PM.png

Screen Shot 2017-05-09 at 3.21.50 PM.png

I have no idea what "PostMan app" means.

Postman app - https://www.getpostman.com - is a tool that sends POST requests. I sent json data to osTicket api/json page. Is this correct format?   "message": "data/html,<b>HERE</b>"

It looks like you haven't entered the API key in the header.you can get your API key here: http://domain.com/scp/apikeys.php

I found the problem. Comodo update is blocking "data/html". I read that data/html has vulnerabilities. I am going to create non-html version. Thanks

Comodo!!!!! Thought they died off. So is your issue resolved and Comodo (Firewall/AV) was blocking it from working? 

Yes, The issue is resolved. I create plain text tickets instead of html version.The shared hosting has its own cross platform protection.  The protection text has a specific line prohibiting "data/html" text. Here is the part of the filter "data:(?:(?:\w+\/\w+\w)?|?; ?\b(?|charset=)"

Awesome, thanks for letting us know the outcome. i will close this thread, if you need it re-opened for any reason just private message me. Otherwise open a new one for any further issues.Have a good day!

Write a Reply...