• 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
    • 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
    • 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

collection_linkfiles

Name

collection_linkfiles

Auth

yes

Description

Appends files to the collection.

The files will be added at the end of the collection. If you want to insert the files at another position, then link them via this method and then use collection_move.

This method preserves the relative order given in the fileids field.

Duplicates are not allowed to be met in the collections.

URL

https://api.pcloud.com/collection_linkfiles

Required

ParameterDescription
collectionidint the id of the collection.
fileidsstring comma-separated list of ids of the files to be added.

Optional

ParameterDescription
noitemsint if set, then linkresult will be empty

Output

On success returns the updated collection.

linkresult contains the result for all items, unless noitems is set. It has the format:

CodeDescription
resultint code of the operation. 0 means success, otherwise the file could not be linked.
fileidint the id of the file that is linked
messagestring if an error occures, then this the message of the error. Not set, if successful.
metadatametadata the metadata of the linked file, if linked successfully.

The fields are added:
position - where the item is added to the collection
added - when the item was linked to the collection

Example

{
    "result": 0,
    "linkresult": [
    {
        "fileid": "599457",
        "result": 0,
        "metadata": {
            "id": "f599457",
            "fileid": 599457,
            "contenttype": "audio/mpeg",

            "position": 9,
            "added": "Tue, 18 Feb 2014 11:16:24 +0000",

            "created": "Mon, 16 Sep 2013 12:10:32 +0000",
            "modified": "Mon, 16 Sep 2013 12:10:32 +0000",
            "hash": 1682158607045670700,
            "icon": "audio",
            "parentfolderid": 21383,
            "ismine": true,
            "isshared": false,
            "isfolder": false,
            "name": "Demo Audio 2.mp3",
            "category": 3,
            "thumb": false,
            "size": 1442376
        }
    },
    {
        "fileid": "123",
        "result": 2009,
        "message": "File not found."
    },

    ...

    ],
    "collection": {
        "id": 40,
        "name": "my music",
        "type": "audio",
        "ismine": true,
        "system": false,
        "items": 11,
        "created": "Thu, 13 Feb 2014 12:34:22 +0000",
        "modified": "Tue, 18 Feb 2014 11:16:24 +0000",
        "contents": []
    }
}

Errors

CodeDescription
1000Log in required.
1038Please provide 'fileids'.
1057Please provide 'collectionid'.
2000Log in failed.
2009File not found.
2065Collection not found.
2071Could not add file to collection - invalid format.
2072Could not add file to collection - already in the collection.
2073The name for the collection is already used.
4000Too many login tries from this IP address.
5000Internal error. Try again later.
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