Create ticket via REST API with a content



I use the REST API 2.0 and try to create a ticket with a text.
I create a ticket with the POST method and a JSON content, but I don’t understand which key I have to use to add a text.

For example, today my JSON content seems like :
“Queue”:“My Queue”,
“Subject”:“Subject of the ticket”,

I tried with the key “Text” and “Content”, but nothing works.

Thanks for your help.



The key is ‘Text’. Here’s a snippet of PHP code I use. The variable $msg contains the body. Note the comment I’m including about continuation lines needing to begin with spaces.

  /* RT content with newlines must have spaces at beginning of
   subsequent lines */
  $rtcontent['Text'] = preg_replace("/\n/", "\n ", $msg);
  $rtresponse = $rt->createTicket($rtcontent);

Hope this helps,

-Rob McNicholas
UC Berkeley