• 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

Binary Protocol

Receiving binary response

The response starts with 4 byte (32 bit) length. The response is normally a tree structure. There are 6 types of values:

  • string
  • number
  • boolean
  • array
  • hash (like JSON object)
  • data

For each value, the first byte represent the type of the value. Since the response is highly compressed, each valuetype can have multiple types

Strings

String values can be reused values (pointer to a string value already sent) or new values. Each time a new string value is sent the client is supposed to assign it a new numeric id (starting 0), when the API server asks the client to reuse a string value, numeric id of the string will be sent. Old values are reused only per-request - that is server will use pointer string values only to objects from the same request. New strings types: [100,149] - short string between 0 and 49 bytes in len (type-100), the type is directly followed by string bytes

CodeDescription
01 byte len string, type is followed by 1 byte indicating string length and then by the string itself
12 byte len string....
23 byte len string....
34 byte len string....

Reused string types: [150,199] - for string ids between 0 and 49 id is directly encoded in type

CodeDescription
41 byte string id follows type
52 byte string id follows type
63 byte string id follows type
74 byte string id follows type

Numbers

Numbers types: [200, 219] - numbers between 0 and 19 are directly encoded in the type parameter

CodeDescription
81 byte number follows
92 byte number follows
....
147 byte number follows
158 byte number follows

Boolean

Boolean values are encoded as following types:

CodeDescription
18false
19true

Array

Name

Array

Type

17

Description

Arrays are represented as unspecified number of values, ending with value of type 255

Hash

Name

Hash

Type

16

Description

Hashes are represented as unspecified number of pairs of values, ending with value of type 255. First value of the pair is the key and second is the value of the given entry in the hash table. The key is always string value.

Data

Name

Data

Type

20

Description

Followed by 8 byte number that indicates how much data the server is sending after the response to this request (that is the data starts after the 4 byte length is read from the server)

Note: The first value you get is always of type hash. This is the same hash you get as JSON result that is it will always have key result with number value and optionally other keys and values, described in the descriptions of the methods.

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