• 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

authorize

Name

authorize

Auth

web page

Description

This is a web page which starts the OAuth 2.0 authorization flow. On this page the user logs in to pCloud and then decides whether to grant the access to your app.

After the user takes the decision to give or not access to your application to his profile information and personal data, they will be redirected to the URI specified by redirect_uri.

User's data could be store either in United States or in Europe. In the parameters in the redirect URL there will parameters locationid and hostname which will provide information about the location. See output parameters for more information.

OAuth 2.0 has two different authorization flows:

  • Code flow - returns a code via the redirect_uri redirect. This code after that should be converted inot a bearer token using oauth2_token method.
  • Token (implicit) flow - returns the bearer token via the redirect_uri redirect. It does not rquires your app to initiate a second call to pCloud API.

Code flow is recommended if the app is using a server.
Token flow is appropriate for pure client-side apps - such for mobile devices or based only on JavaScript.

URL

https://my.pcloud.com/oauth2/authorize

Required

ParameterDescription
client_idstring id of the app.
response_typestring code or token.

Optional

ParameterDescription
redirect_uristring where to redirect after approval, mandatory for token, optional for code (code will be displayed to the user in this case).
statestring opaque data that will be passed back to redirect_uri.
force_reapprovebool if set, will force re-approval even if the application is already approved by the user.
permissionsa comma (,) separated list. If set additional permissions will appear in the approval form. Currently the only option is manageshares

Output

On approval redirects to:

Code flow

These parameters are pased in the query string (after ?)

ParameterDescription
codestring The authorization code that could be exchanged for a bearer token by calling oauth2_token
statestring The contents of the state parameter, that was passed.
locationidnumber The ID for the location of the data center where the user is located. 1 - US, 2 - Europe
hostnamestring The host name of the API server. Consequent API calls have to be made to that host name.

redirect_uri?code=XXXXX&state=YYYYY&locationid=[1 or 2]&hostname=[api.pcloud.com or eapi.pcloud.com]

Token flow
These parameters are pased in the URI fragment (after #)
ParameterDescription
locationidnumber The ID for the location of the data center where the user is located. 1 - US, 2 - Europe
hostnamestring The host name of the API server. Consequent API calls have to be made to that host name.
access_tokenstring A token that could be used to call pCloud API methods.
token_typestring The type of the token (always bearer).
uidint The ID of the user, who gave access to the app.
statestring The contents of the state parameter, that was passed.

redirect_uri#access_token=XXXXX&token_type=bearer&uid=YYYYYY&state=ZZZZZZ&locationid=[1 or 2]&hostname=[api.pcloud.com or eapi.pcloud.com]

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