• 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
      • getapiserver
    • Folder
      • createfolder
      • createfolderifnotexists
      • listfolder
      • renamefolder
      • deletefolder
      • deletefolderrecursive
      • copyfolder
    • File
      • uploadfile
      • uploadprogress
      • downloadfile
      • downloadfileasync
      • copyfile
      • checksumfile
      • deletefile
      • renamefile
      • stat
    • 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

getpublinkdownload

This method can't be used from web applications. Referrer is restricted to pcloud.com.

Name

getpublinkdownload

Auth

no

Description

Returns link(s) where the file can be downloaded

Expects as parameter code that can be either 'code' or 'shortcode'.

The code could be obtained from:

  • getfilepublink - link to a single file
  • getfolderpublink - link to a folder
  • gettreepublink - link to a tree
  • getcollectionpublink - link to a collection
If the link is to a folder also expects fileid.

Optional parameters
  • forcedownload
  • contenttype
  • skipfilename
  • maxspeed
work exaclty as explained in getfilelink.

This call is intentionally split from showpublink.

Getting download links for files you do not intend to download is considered bad behaviour.

getpublinkdownload is to be called when user intents to actually download the file.

URL

https://api.pcloud.com/getpublinkdownload

Required

ParameterDescription
codestring either 'code' or 'shortcode'
fileidint File id, if the link is to a folder

Optional

ParameterDescription
forcedownloadint Download with 'Content-Type' = 'application/octet-stream'
contenttypestring Set 'Content-Type'
maxspeedint limit the download speed
skipfilenameint include the name of the file in the generated link

Output

Returns link(s) where the file can be downloaded (same as getfilelink hosts, path and expire are returned).

Example

{
    result: 0,
    path: "/hash/My%20picture.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.
1005Unknown content-type requested.
1028Please provide link 'code'.
1029Please provide 'fileid'.
2000Log in failed.
2002A component of parent directory does not exist.
2009File not found.
2010Invalid path.
2011Requested speed limit too low, see minspeed for minimum.
4000Too many login tries from this IP address.
5002Internal error, no servers available. Try again later.
7001Invalid link 'code'.
7002This link is deleted by the owner.
7004This link has expired.
7005This link has reached its traffic limit.
7006This link has reached maximum downloads.
2014 © pCloud. Terms and Conditions. Privacy Policy. Intellectual Property.
© pCloud. Terms and Conditions. Privacy Policy. Intellectual Property.
Reset Password
Check your e-mail for further instructions.
Reset