Create/Edit Ticket via HTTP and REST

Good Morning!
I hope this is the appropriate list – if “users” would be better, I
could do that too. I searched mailing list archives and found several
similar questions, but no answers.

Situation: I need to implement cross-platform programmatic CRUD access
to RT. RT is running on an email server under Linux/Apache, but we have
other code on other machines (viz. C#/.Net running under Windows) that
needs to create or edit RT tickets.

Obvious solution seems to be HTTP Get or Post to the RT server. Based on
http://wiki.bestpractical.com/view/REST, I can retrieve a ticket via
HTTP Get to {domain}{server}\REST\1.0\ticket{ticket_id}, getting
response with plain text content of ticket properties. Create and Edit
have me flummoxed, though.

Editing the content payload retrieved above (e.g., changing the Queue)
and POSTing to …\REST\1.0\ticket{ticket_id}: I just get back the
original ticket.
Likewise for …\REST\1.0\ticket{ticket_id}\edit
Other URIs I’ve tried (\ticket\edit{ticket_id}, \ticket\edit) all fail
with various error messages.

My Questions:
How do I construct the URI for create and edit?
If the content model for POST is different from the returned content
from GET, what is it?

Even a pointer in the right direction for someone whose Perl skills are
minimal would be appreciated.

Thanks,

Frank F. Smith

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

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

Drew Taylor wrote:

Take a look at RT::Client::REST on CPAN. It should hide most of the
complexity for you. I’m currently using it in product with excellent
results.

I’d looked at the documentation for RT::Client::REST on CPAN, which seemed
mostly useful for programming in Perl. But perhaps I can dive into the Perl
code itself. Or maybe investigate Perl.Net as a way to call into Perl from
C#.

Doh. Sorry I overlooked the part about doing it in C#. Between the
REST docs you mentioned on the wiki and the perl code I would imagine
you should be able to figure it out. What I do remember is that the
content POSTed is called a “form”. IITC it is colon delimited key =>
value pairs, like “Subject: foo\nCF-Whatever: bar\n”. If you do
reverse engineer things, I know the community would be most
appreciative if you updated the wiki page while you were at it. :slight_smile:

Hope this helps.

Drew
Drew Taylor * Web development & consulting
Email: drew@drewtaylor.com * Site implementation & hosting
Web : www.drewtaylor.com * perl/mod_perl/DBI/mysql/postgres