diff --git a/setup/doc/api.md b/setup/doc/api.md index 7509616aa2406b842f56cacd7a6c0693b23415ca..f40d7423c68730d2a20a2df58b36a6a1b2104a17 100644 --- a/setup/doc/api.md +++ b/setup/doc/api.md @@ -27,3 +27,4 @@ Resources --------- - [Tickets](api/tickets.md) +- [Tasks](api/tasks.md) diff --git a/setup/doc/api/tasks.md b/setup/doc/api/tasks.md new file mode 100644 index 0000000000000000000000000000000000000000..b40bbab21290188145b4488d34c145b1d313ea8e --- /dev/null +++ b/setup/doc/api/tasks.md @@ -0,0 +1,9 @@ +Tasks +======= +The API supports tasks execution via the HTTP API. Cron is the only supported task as the moment. + +Execute Cron Job +--------------- + +Cron job can be executed, remotely, by making a post to `POST /api/tasks/cron`. See `scripts/rcron.php` + diff --git a/setup/doc/api/tickets.md b/setup/doc/api/tickets.md index fc79b1aead833a9f4cf9fd3a214635dcba9e52fc..a8bfd39f1b0791d9bb097484d0d09364e1ef1749 100644 --- a/setup/doc/api/tickets.md +++ b/setup/doc/api/tickets.md @@ -9,7 +9,7 @@ Create a Ticket --------------- Tickets can be created in the osTicket system by sending an HTTP POST to -`api/tickets.xml` or `api/tickets.json` depending on the format of the +`api/tickets.xml`, `api/tickets.email` or `api/tickets.json` depending on the format of the request content. ### Fields ###### @@ -32,7 +32,7 @@ request content. * __name__: *required* name of the file to be attached. Multiple files with the same name are allowable * __type__: Mime type of the file. Default is `text/plain` - * __encoding__: Set to `base64` if content is base64 encoded + * __encoding__: Set to `base64` if content is base64 encoded ### XML Payload Example ###### @@ -109,6 +109,59 @@ an object or array definition, and newlines are not allowed inside strings. [rfc 2397]: http://www.ietf.org/rfc/rfc2397.txt "Data URLs" +### Email Payload Example ###### + +* `POST /api/tickets.email` + +osTicket supports both remote (over http) and local piping. Please refer to the wiki on step-by-step instruction of setting up email piping. + +```email + +MIME-Version: 1.0 +Received: by 10.194.9.167 with HTTP; Thu, 7 Feb 2013 09:01:04 -0800 (PST) +Date: Thu, 7 Feb 2013 11:01:04 -0600 +Delivered-To: support@osticket.com +Message-ID: <CAL4KyrgKmpYxdX+6u3HyHZ3qN5K0mU2_sdfoVu6rT8cUNn+52w@osticket.com> +Subject: Testing +From: Peter Rotich <peter@osticket.com> +To: support@osticket.com +Content-Type: multipart/mixed; boundary=047d7bfcfaf263782204d52563a5 + +--047d7bfcfaf263782204d52563a5 +Content-Type: multipart/alternative; boundary=047d7bfcfaf263781204d52563a3 + +--047d7bfcfaf263781204d52563a3 +Content-Type: text/plain; charset=ISO-8859-1 + +Testing testing. + +-- +Peter Rotich +http://www.osticket.com + +--047d7bfcfaf263781204d52563a3 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: quoted-printable + +<div dir=3D"ltr">Testing testing.<br clear=3D"all"><div><br></div>-- <br>Pe= +ter Rotich<br> +<a href=3D"http://www.osticket.com" target=3D"_blank">http://www.osticket.= +com</a> +</div> + +--047d7bfcfaf263781204d52563a3-- +--047d7bfcfaf263782204d52563a5 +Content-Type: text/plain; charset=US-ASCII; name="file.txt" +Content-Disposition: attachment; filename="file.txt" +Content-Transfer-Encoding: base64 +X-Attachment-Id: f_hcw5kqf60 + +Sm9lIGRhZGR5cyBjb250ZW50Cg== +--047d7bfcfaf263782204d52563a5-- +``` + +Local piping can utilize `api/pipe.php` without the neeed to setup an API key. + ### Response ###### If successful, the server will send `HTTP/201 Created`. Otherwise, it will