[Rt-devel] REST Interface for Creating Ticket?

Mike Melson Mike.Melson at Caringo.com
Mon Dec 1 14:20:23 EST 2008


Success!

Based on the comments in this thread, I was able to use the following 
HTML form to create a new ticket:

<form method="POST" 
action="https://support.<myservernamehere>.com/REST/1.0/ticket/new/">
  User: <input type="text" name="user" size="20"><br>
  Pass: <input type="text" name="pass" size="20"><br>
  Content: <textarea rows="10" name="content" cols="30">id: new
Text: This is the ticket text
Subject: This is my ticket
Queue: General</textarea><br>
  <p><input type="submit" value="Submit" name="B1"><input type="reset" 
value="Reset" name="B2"></p>
</form>

Interestingly, the Queue field had to be at the end of the list or it 
didn't work.

Thanks again for the excellent help! I'll start the integration via php 
using the code Tim supplied (thanks Tim!)

M2


Frank F. Smith wrote:
> Tim Coles wrote:
>   
>> I think simple forms fail because the REST interface is quite particular
>> about carriage return/line feed combinations. IIRC it requires a CF/LF
>> between each http field but within the http field called "content"
>> (where you pass it all of your ticket fields) it will just accept a \n
>> between each one. Something like that anyway.
>>
>> Either way having or not having the right combination was the difference
>> between success and failure for me on several occasions (and was the
>> main problem our .NET devs had when doing their test forms).
>>   
>>     
> Sounds about right to me, though I've not tested all the combinations.
>
> Mike: In the sample content I sent moments ago, I failed to note that 
> what _I_ am sending (based on my understanding of the RT::Client::REST 
> modules) has CrLf after each line _except_ the field: value lines, which 
> all end with just Lf.
>
> Frank
>   
>> Tim
>>
>>   
>>     
> <snip>
>
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bestpractical.com/pipermail/rt-devel/attachments/20081201/2ea07797/attachment.htm 


More information about the Rt-devel mailing list