×Read this message from Erik, founder of YouMagine

Params

Param nameDescription
document
required

Value:

Must be hash

document[name]
optional

name of the image (file name is used by default)


Value:

Must be string.

document[description]
optional

description of the image


Value:

Must be text/html.

document[file]
required

an document file (any, except exe)


Value:

Must be file.

Supported Formats

json

Examples

Request

POST /v1/designs/kaymbo-11/documents?auth_token=7xzteYVvTfjd4kSZC-dU
Content-Type: multipart/form-data; boundary=APIPIE_RECORDER_EXAMPLE_BOUNDARY

--APIPIE_RECORDER_EXAMPLE_BOUNDARY
Content-Disposition: form-data; name="document[file]"; filename="example.pdf"
Content-Type: text/plain
Content-Length: 67

... contents of "document[file]" ...
--APIPIE_RECORDER_EXAMPLE_BOUNDARY--

Response

201
{
  "id": 15,
  "name": "Tagopia",
  "description": "<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Proin risus. Praesent lectus.</p>\n\n<p>Vestibulum quam sapien, varius ut, blandit non, interdum in, ante. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Duis faucibus accumsan odio. Curabitur convallis.</p>\n\n<p>Duis consequat dui nec nisi volutpat eleifend. Donec ut dolor. Morbi vel lectus in quam fringilla rhoncus.</p>\n\n<p>Mauris enim leo, rhoncus sed, vestibulum sit amet, cursus id, turpis. Integer aliquet, massa id lobortis convallis, tortor risus dapibus augue, vel accumsan tellus nisi eu orci. Mauris lacinia sapien quis libero.</p>",
  "user_id": 39,
  "documentable_id": 11,
  "documentable_type": "Design",
  "file": {
    "url": "/spec_uploads/document/file/15/example.pdf"
  },
  "created_at": "2016-06-10T12:16:59.394+02:00",
  "updated_at": "2016-06-10T12:16:59.394+02:00",
  "file_contains_3d_model": false,
  "design_tool_id": null,
  "design_tool_version_id": null,
  "file_tmp": null,
  "properties": {},
  "download_count": 0,
  "ctm_file": {
    "url": null
  },
  "jscad_file": {
    "url": null
  },
  "obj_file": {
    "url": null
  },
  "obj_zip_file": {
    "url": null
  },
  "scad_file": {
    "url": null
  },
  "stl_file": {
    "url": null
  },
  "stl_zip_file": {
    "url": null
  },
  "modelhash": "12345"
}