Skip to content
This repository has been archived by the owner on Oct 15, 2019. It is now read-only.

API Files

M. Fazel Soltani edited this page Oct 10, 2019 · 7 revisions

API Documentation

This article documentates the Files API.

This API is designed for use in Clouddrop context.

Services:

  1. Add a new File
  2. Update an existing file
  3. Download a file
  4. Delete a file
  5. List of files
  6. Search for a file with specific parameters

Add a new File

REQUEST

  • POST /files
+ HEADER
Headername Value
Content-Type multipart/form-data
Authorization Bearer <token>
+ BODY
+ ATTACHMENT

a binary data

RESPONSE

+ HEADER
Headername Value
Statuscode 200
+ BODY
{
  "code": 200,
  "type": "unknown",
  "message": "additionalMetadata: Fisch\nFile uploaded to ./Fisch.jpg, 81340 bytes"
}

Update an existing file

REQUEST

  • PUT /files
+ HEADER
Headername Value
Authorization Bearer <token>
+ BODY

RESPONSE

+ HEADER
Headername Value
Statuscode 200
Statuscode 404
+ BODY
{
  "id": -9223372036854776000,
  "category": {
    "id": 0,
    "name": "string"
  },
  "name": "doggie",
  "photoUrls": [
    "string"
  ],
  "tags": [
    {
      "id": 0,
      "name": "string"
    }
  ],
  "status": "available"
}

Download a file

REQUEST

  • GET /files/{ID}
+ HEADER
Headername Value
Authorization Bearer <token>
+ BODY

RESPONSE

+ HEADER
Headername Value
Statuscode 200
+ BODY
{
  "id": 0,
  "category": {
    "id": 0,
    "name": "string"
  },
  "name": "doggie",
  "photoUrls": [
    "string"
  ],
  "tags": [
    {
      "id": 0,
      "name": "string"
    }
  ],
  "status": "available"
}

Delete a file

REQUEST

  • DELETE /files/{ID}
+ HEADER
Headername Value
Authorization Bearer <token>
+ BODY

RESPONSE

+ HEADER
Headername Value
Statuscode 200
+ BODY

List of files

REQUEST

  • GET /files/list
+ HEADER
Headername Value
Authorization Bearer <token>
+ BODY

RESPONSE

+ HEADER
Headername Value
Statuscode 200
+ BODY

Search for a file with specific parameters

REQUEST

  • GET /files/list/search
+ HEADER
Headername Value
Authorization Bearer <token>
+ BODY

RESPONSE

+ HEADER
Headername Value
Statuscode 204
+ BODY