[Rt-devel] REST Interface for Creating Ticket?

Frank F. Smith ffs1 at cornell.edu
Mon Dec 1 13:07:11 EST 2008


Mike Melson wrote:
> A POST would be fine. (I actually did try a simple form but got the 
> same response). Thanks!
OK. Here's a simple example. Here, the boundary string xYzZY is some 
more-or-less random alphanumeric string that does not appear anywhere in 
the form data.

Send an HTTP POST request to the URI 
$RTBASE/REST/1.0/edit?user=xxxx&pass=xxxx
(You can also use an authentication cookie received from a previous request)
ContentType: multipart/form-data; boundary="xYzZY"
ContentLength: set based on content below

Content of the POST looks something like:
--xYzZY
Content-Disposition: form-data; name="content"

id: ticket/new
queue: General
subject: Creating a new ticket
requestors: me at somewhere.net

--xYzZY--



Note that the HTTP Response will almost always have a status code of 200 
"OK". The first line of the response content includes a status code, but 
it is also likely to be 200 OK, even if the create request failed. But 
that's another issue...

Hope this helps,
Frank
>
>
> Frank F. Smith wrote:
>> Mike Melson wrote:
>>> Thanks Dmitri. Unfortunately, I have to use PHP.
>> How about creating an HTTP POST with multi-part form content? If that 
>> works for you, I might be able to help a bit. (I need to create and 
>> edit tickets from C# code in .Net and have worked out some of the 
>> content model.)
>>
>> Frank
>>


-- 
Frank F. Smith

PESTICIDE SALES AND USE REPORTING DATABASE GROUP
20 THORNWOOD DR STE 106
ITHACA NY  14850-1265

Email: ffs1 at cornell.edu
Phone: (607) 257-5706



More information about the Rt-devel mailing list