Skip to content

Latest commit

 

History

History
executable file
·
683 lines (603 loc) · 12.6 KB

resources-file.md

File metadata and controls

executable file
·
683 lines (603 loc) · 12.6 KB

File

List files

Route

GET https://api.doctape.com/v1/doc

Required scopes

file.read

Parameters (Query string)

Name Description
include_meta include meta data for each file

Response (JSON)

Name Description
id file id
public_url public file url
name file name without extension
extension file extension
size file size in bytes
time_added unix timestamp
media_type one of the following: document, image, audio, video, archive, unknown
tags tag array
origin one of the following: webupload, dropbox, mail, mobile or tapename
starred true | false
shared 0: own document, 1: personal share, uid: tape share
processing_status ok, failed, processing
meta take a look at metadata

Response (Example)

{
  "error": null,
  "result": {
    "2224c539-e5d6-425a-8e0d-9516db6dc462": {
      "id": "2224c539-e5d6-425a-8e0d-9516db6dc462",
      "public_url": "http://dt.pe/w23Oj9",
      "name": "example017872",
      "extension": "jpg",
      "size": 730782,
      "time_added": 1358457759,
      "media_type": "image",
      "tags": ["+bobby", "#bobby/wallpaper"],
      "origin": "bobby/wallpaper",
      "shared": 0,
      "processing_status": "ok",
      "meta": {}
    },
    ...
  }
}

back to top


Retrieve file info

Route

GET https://api.doctape.com/v1/doc/{id}

Required scopes

file.read

Parameters (Route)

Name Description
id file id

Response (JSON)

Name Description
id file id
public_url public file url
name file name without extension
extension file extension
size file size in bytes
time_added unix timestamp
media_type one of the following: document, image, audio, video, archive, unknown
tags tag array
origin one of the following: webupload, dropbox, mail, mobile or tapename
starred true | false
shared 0: own document, 1: personal share, uid: tape share
processing_status ok, failed, processing
meta take a look at metadata

Response (Example)

{
  "error": null,
  "result": {
    "id": "2224c539-e5d6-425a-8e0d-9516db6dc462",
    "public_url": "http://dt.pe/w23Oj9",
    "name": "example017872",
    "extension": "jpg",
    "size": 730782,
    "time_added": 1358457759,
    "media_type": "image",
    "tags": ["+bobby", "#bobby/wallpaper"],
    "origin": "bobby/wallpaper",
    "shared": 0,
    "processing_status": "ok",
    "meta": {}
  }
}

back to top


Update file info

Route

POST https://api.doctape.com/v1/doc/{id}

Required scopes

file.update file.read 

Parameters (Route)

Name Description
id file id

Parameters (JSON)

Name Description
name file name
tags array containing all tags including shares and tapes
starred true | false

Response (JSON)

Name Description
id file id
public_url public file url
name file name without extension
extension file extension
size file size in bytes
time_added unix timestamp
media_type one of the following: document, image, audio, video, archive, unknown
tags tag array
origin one of the following: webupload, dropbox, mail, mobile or tapename
starred true | false
shared 0: own document, 1: personal share, uid: tape share
processing_status ok, failed, processing
meta take a look at metadata

Response (Example)

{
  "error": null,
  "result": {
    "id": "2224c539-e5d6-425a-8e0d-9516db6dc462",
    "public_url": "http://dt.pe/w23Oj9",
    "name": "example017872",
    "extension": "jpg",
    "size": 730782,
    "time_added": 1358457759,
    "media_type": "image",
    "tags": ["+bobby", "#bobby/wallpaper"],
    "origin": "bobby/wallpaper",
    "shared": 0,
    "processing_status": "ok",
    "meta": {}
  }
}

back to top


Retrieve file (original)

Route

GET https://api.doctape.com/v1/doc/{id}/original

Required scopes

file.read

Parameters (Route)

Name Description
id file id

Response (Binary)


back to top


Retrieve file thumbnail (jpg)

Route

GET https://api.doctape.com/v1/doc/{docid}/thumb_120.jpg

Required scopes

file.read

Response (Binary)


back to top


Retrieve file thumbnail large (jpg)

Route

GET https://api.doctape.com/v1/doc/{docid}/thumb_320.jpg

Required scopes

file.read

Response (Binary)


back to top


Upload file(s)

Route

POST https://api.doctape.com/v1/doc/upload

Required scopes

file.create

Parameters (Route)

Name Description
tags String of tags (separated with ",")
starred true | false

Parameters (Body)

multiparted body with file

Response (JSON)

Name Description
id file id
name file name
size file size

Response (Example)

{
  "error": null,
  "result": {
    "2224c539-e5d6-425a-8e0d-9516db6dc462": {
      "id": "2224c539-e5d6-425a-8e0d-9516db6dc462",
      "name": "017872.jpg",
      "size": "730782",
    },
  }
}

back to top


Clone file

None of the former tags is added to the clone.

Route

POST https://api.doctape.com/v1/doc/{id}/clone

Required scopes

file.create file.read

Parameters (Route)

Name Description
id file id

Response (JSON)

Name Description
id file id of the cloned file

Response (Example)

{
  "error": null,
  "result": {
    "cloned": true,
    "id": "1bde02fd-4082-4321-b210-7fe75a6e94ba"
  }
}

back to top


(Un-)publish file

Route

POST https://api.doctape.com/v1/doc/{id}/public

Required scopes

file.update file.read

Parameters (JSON)

Name Description
public true / false

Response (JSON)

Name Description
public true / false
public_url public url or empty string

Response (JSON)

{
  "error": null,
  "result": {
    "published": false,
    "public_url": ""
  }
}

back to top


Delete file

Route

DELETE https://api.doctape.com/v1/doc/{id}

Required scopes

file.delete file.read

Parameters (Route)

Name Description
id file id

Response (JSON)

Name Description
deleted true

Response (Example)

{
  "error": null,
  "result": {
    "deleted": true
  }
}

back to top


Extract archive (zip)

After unzipping, all files will be added to the processing queue as if they were uploaded directly. When processing finished, extracted files will appear in the doc-listing.

Route

POST https://api.doctape.com/doc/{id}/extract

Required scopes

file.create file.read

Parameters (Route)

Name Description
id file id

Response (JSON)

Name Description
extracted true

Response (Example)

{
  "error": null,
  "result": {
    "extracted": true
  }
}

back to top