Attachment POST Resources

Uploads MUST be performed using the multipart/form-data Content-Type.

Simple file upload

The upload endpoint allows to upload images which can be displayed inline. (E.g. this can be used for the inline image functionality of a WYSIWYG editor).

The following image types are supported: Jpeg, Png, Gif

POST /upload
Parameter Type Default Required Description
file file Any file type which is allowed for the network.

Response

{
    "path": "1/file/4fe68cde12aa9c56c30617f135daa802afb5bb40",
    "name": "sherlock.png",
    "size": 80773,
    "mime_type": "image/png"
}

The absolute URI for the image paths is the asset base domain (e.g. https://cdn.starmind.com/) + path + name

For example: https://cdn.starmind.com/1/file/4fe68cde12aa9c56c30617f135daa802afb5bb40/sherlock.png

Files uploaded via this endpoint are read only and can not be altered or deleted.

Upload a question attachment

POST /questions/:id/attachments
Parameter Type Default Required Description
file file Any file type which is allowed for the network.

Response

{
    "id": 42,
    "name": "sherlock.zip",
    "hash": "017eb2b4018cd555cdb3db0a79c1e65d68bd376a",
    "size": 32054569,
    "mime_type": "application/zip",
    "created": "2012-05-20T14:35:27.000Z"
}

Upload a solution attachment

POST /solutions/:id/attachments
Parameter Type Default Required Description
file file Any file type which is allowed for the network.

Response

{
    "id": 42,
    "name": "sherlock.zip",
    "hash": "017eb2b4018cd555cdb3db0a79c1e65d68bd376a",
    "size": 32054569,
    "mime_type": "application/zip",
    "created": "2012-05-20T14:35:27.000Z"
}