Skip to content
Philipp Wolfer edited this page Nov 11, 2013 · 5 revisions
* POST /project/{projectId}/job/{jobId}/document/{documentName} Request: =POST /project/{projectId}/job/{jobId}/document/{documentName}= Uploads a new source document for translation to a job. Each job can have exactly one document. If the job already had a source document it will be overwritten by this request. The content type of the uploaded document should be specified with the =Content-Type= header, the document itself is directly posted in the request body. TEXTKING supports a variety of different document formats. Currently this includes docx, doc, xlsx, xls, pptx, idml, rtf, odt, html, txt and xml. ** Request headers |Header|Description| |-+-| |Authorization|[[Authorization and authentication][oAuth 2 authentication header]]| |Content-Type| The content type of the posted data. Can be any content type supported by TEXTKING.| ** Response status codes |HTTP status|Description| |-+-| |201 Created|The document was successfully uploaded, the =Content-Location= header contains the URI of the uploaded document.| |400 Bad Request|There was a problem processing the input data.| |404 Not Found|The job or project with the given ID does not exist.| |406 Not Acceptable|The posted content type is not supported.| ** Example Upload a new plain text document named =MyFile.txt= as source document for the job with the ID =d0c30471-7c70-45d4-bcc1-a7773cb352bd=: #+BEGIN_EXAMPLE POST /v1/project/bc141454-5949-401b-9c05-7591ee2f5624/job/d0c30471-7c70-45d4-bcc1-a7773cb352bd/document/MyFile.txt HTTP/1.1 Host: api.textking.com Content-Type: text/plain Authorization: Bearer youraccesstoken Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. #+END_EXAMPLE Response: #+BEGIN_EXAMPLE HTTP/1.1 201 Created Location: https://api.textking.com/v1/project/bc141454-5949-401b-9c05-7591ee2f5624/job/d0c30471-7c70-45d4-bcc1-a7773cb352bd/document Content-Location: https://api.textking.com/v1/project/bc141454-5949-401b-9c05-7591ee2f5624/job/d0c30471-7c70-45d4-bcc1-a7773cb352bd/document #+END_EXAMPLE

Clone this wiki locally