Upload

Description

Upload a new public image to PIC service. It is possible to link with geographic info.

URL

/VERSION/image/upload

Available Format

JSON

HTTP Method

POST MULTIPART

Accepted Version

1

Requires

Authorization

Headers

Generic parameters (those must be included always)

  • access_token: (Required) access_token to user resources.
  • file: (Required)¬†¬†Serialized and Base64 encoded image. You must provide the “filename” attribute.
  • filename: (Required) desired name for the uploaded resource. It will change if the filename already exists.
  • fileformat: (Optional) 3 character image extension (ex. jpeg, png, gif) it will be extracted from the file parameter.
  • keywords: (Optional) comma separated string keywords. Max 250 characters.
  • privacy: (Optional) privacy mode. Default value is “PUBLIC”. String values allowed:
    • ‘public’: image can be retrieved by all app users and it can be viewed with a public uri without access token specified
    • ‘client’: all app users can request and view this image by specifing any app access token.
    • ‘user’: only user resource owner access token can retrieve this image.

GEO parameters

You must choose 1 method. Should be included only if you want image geopositioning.

Link with existing position.

  • pos_id: (Optional) preregistered position identifier.

Link with existing POI.

  • poi_id: (Optional) preregistered POI identifier.

Example

Reply
JSON example reply

{
        "id": 1012,
        "client_id": "522b28ea-3c00-4be4-89ea-bf86f02f243b",
        "user_id": "c21427c7-16db-4044-93c3-4aa3ad09fb34",
        "filename": "penguins",
        "filename_unique": "penguins_2",
        "file_ext": ".jpg",
        "uri": "https://pic.topoos.com/penguins_2",
        "register_date": "2014-01-02T10:44:36.983+01:00",
        "geo_data": {
             "id": 17,
             "position_id": null,
             "poi_id": 13
        },
        "keywords": [
            "animal",
            "bonito",
            "feo"
        ],
        "privacy": "client"
}