• General
  • My Apps
  • SDKs
  • Protocols
  • Structures
  • Methods
  • Errors
Log in Register Log out
  • General

  • My Apps

  • SDKs
    • C
    • Java
    • Javascript
    • Php
    • Swift

  • Protocols
    • HTTP JSON Protocol
      • Authentication
      • Single Connection
      • Uploading Files
    • Binary Protocol
      • Sending Binary Request
      • Sending Files
      • Receiving Binary Response
      • Receiving Files Data

  • Structures
    • Datetime
    • Event
    • File Descriptors
    • Filenames
    • Metadata
    • Share
    • Tree

  • Methods
    • Intro
      • Global Parameters
      • Authentication
    • General
      • getdigest
      • userinfo
      • supportedlanguages
      • setlanguage
      • feedback
      • currentserver
      • diff
      • getfilehistory
      • getip
    • Folder
      • createfolder
      • listfolder
      • renamefolder
      • deletefolder
      • deletefolderrecursive
    • File
      • uploadfile
      • uploadprogress
      • downloadfile
      • copyfile
      • checksumfile
      • deletefile
      • renamefile
    • Auth
      • sendverificationemail
      • verifyemail
      • changepassword
      • lostpassword
      • resetpassword
      • register
      • invite
      • userinvites
      • logout
      • listtokens
      • deletetoken
      • sendchangemail
      • changemail
      • senddeactivatemail
      • deactivateuser
    • Streaming
      • getfilelink
      • getvideolink
      • getvideolinks
      • getaudiolink
      • gethlslink
      • gettextfile
    • Archiving
      • getzip
      • getziplink
      • savezip
      • extractarchive
      • extractarchiveprogress
      • savezipprogress
    • Sharing
      • sharefolder
      • listshares
      • sharerequestinfo
      • cancelsharerequest
      • acceptshare
      • declineshare
      • removeshare
      • changeshare
    • Public Links
      • getfilepublink
      • getfolderpublink
      • gettreepublink
      • showpublink
      • getpublinkdownload
      • copypubfile
      • listpublinks
      • listplshort
      • deletepublink
      • changepublink
      • getpubthumb
      • getpubthumblink
      • getpubthumbslinks
      • savepubthumb
      • getpubzip
      • getpubziplink
      • savepubzip
      • getpubvideolinks
      • getpubaudiolink
      • getpubtextfile
      • getcollectionpublink
    • Thumbnails
      • getthumblink
      • getthumbslinks
      • getthumb
      • savethumb
    • Upload Links
      • createuploadlink
      • listuploadlinks
      • deleteuploadlink
      • changeuploadlink
      • showuploadlink
      • uploadtolink
      • uploadlinkprogress
      • copytolink
    • Revisions
      • listrevisions
      • revertrevision
    • Fileops
      • file_open
      • file_write
      • file_pwrite
      • file_read
      • file_pread
      • file_pread_ifmod
      • file_checksum
      • file_size
      • file_truncate
      • file_seek
      • file_close
      • file_lock
    • Newsletter
      • newsletter_subscribe
      • newsletter_check
      • newsletter_verifyemail
      • newsletter_unsubscribe
      • newsletter_unsibscribemail
    • Trash
      • trash_list
      • trash_restorepath
      • trash_restore
      • trash_clear
    • Collection
      • collection_list
      • collection_details
      • collection_create
      • collection_rename
      • collection_delete
      • collection_linkfiles
      • collection_unlinkfiles
      • collection_move
    • OAuth 2.0
      • authorize
      • oauth2_token
    • Transfer
      • uploadtransfer
      • uploadtransferprogress

  • Errors

getthumblink

Name

getthumblink

Auth

yes

Description

Get a link to a thumbnail of a file

Takes fileid (or path) as parameter and provides links from which a thumbnail of the file can be downloaded.

Thumbnails can be created only from files whose metadata has thumb value set to true.

The parameter size MUST be provided, in the format WIDTHxHEIGHT.

The width MUST be between 16 and 2048, and divisible by either 4 or 5.

The height MUST be between 16 and 1024, and divisible by either 4 or 5.

By default the thumb will have the same aspect ratio as the original image, so the resulting thumbnail width or height (but not both) might be less than requested.

If you want thumbnail exactly the size specified, you can set crop parameter. With crop, thumbnails will still have the right aspect ratio, but if needed some rows or cols (but not both) will be cropped from both sides. So if you have 1024x768 image and are trying to create 128x128 thumbnail, first the image will be converted to 768x768 by cutting 128 columns from both sides and then resized to 128x128. To create a rectangular thumb from 4:3 image exactly 1/8 is cropped from each side. By default the thumbnail is in jpeg format.

If the type parameter is set to png, a png image will be produced.

Thumbs are created on first request and cached for unspecified amount of time (or until file) changes.

Clients should attempt to cache thumbs if space permits.

It is also advisable to monitor the original file's hash to see if it has changed. If yes, a new thumbnail MUST be requested.

URL

https://api.pcloud.com/getthumblink

Required

ParameterDescription
fileidint id of the file for thumb
pathstring filepath to the file for thumb
sizestring WIDTHxHEIGHT
Use fileid or path

Optional

ParameterDescription
cropint If set, then the thumb will be cropped
typestring If set to png, then the thumb will be in png format

Output

On success the same data as with getfilelink is returned.

Additionally the real image produced size is returned

It will match reqested size if crop is specified or may differ otherwise.

Example

{
    result: 0,
    size: "32x32",
    path: "/hash/My%20thumb.jpg",
    expires: "Thu, 03 Oct 2013 01:06:49 +0000",
    hosts: [
        "c63.pcloud.com",
        "c1.pcloud.com"
    ]
}

Errors

CodeDescription
1000Log in required.
1004No fileid or path provided.
1014Thumb can not be created from this file type.
1015Please provide valid thumb size. Width and height must be divisible either by 4 or 5 and must be between 16 and 2048 (1024 for height).
2000Log in failed.
2002A component of parent directory does not exist.
2003Access denied. You do not have permissions to preform this operation.
2009File not found.
2010Invalid path.
3001Could not create thumb from the given file.
4000Too many login tries from this IP address.
5002Internal error, no servers available. Try again later.
2014 © pCloud. Terms and Conditions. Privacy Policy. Intellectual Property.
© pCloud. Terms and Conditions. Privacy Policy. Intellectual Property.
Log in to pCloud Account
Log in
Sign up
Login
Create a new account
Login
Sign up
Terms of Use
GET STARTED