Jump to content

OpenTicket API - text formatting issue


Remitur

Recommended Posts

According to https://developers.whmcs.com/api-reference/openticket/ , it seems that it's possible text formatting using the same syntax available in the ticket web text editor; that's to say, their code sample:

$command = 'OpenTicket';
$postData = array(
    'deptid' => '1',
    'subject' => 'This is a sample ticket',
    'message' => 'This is a **sample** ticket message',
    'clientid' => '1',
    'priority' => 'Medium',
    'markdown' => true,
    'attachments' => base64_encode(json_encode([['name' => 'sample_text_file.txt', 'data' => base64_encode('This is a sample text file contents')]])),
);
$adminUsername = 'ADMIN_USERNAME'; // Optional for WHMCS 7.2 and later

$results = localAPI($command, $postData, $adminUsername);
print_r($results);

suggests that "sample" should be bold.
And, if I insert *sample*, it will be italic, and so on...

But (for me) it doesn't work: if I use that syntax, I get exactly the same message, without any text formatting; that's to say, if I specify

$textmessage = $textmessage ."\r\n[Text to display](http://www.example.com)";    
  
$textmessage = $textmessage ."\r\n**bold**\r\n*italic*\r\n### Small header\r\n";

the text I will get in the ticket will be:

Quote

 [Text to display](http://www.example.com)
**bold**
*italic*
### Small header



Am I missing something, or is the doc wrong?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated