Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hey Jaex. I would greatly appreciate any help getting pClloud to work. Here's what I have so far. (In reference to https://github.com/ShareX/ShareX/issues/2872)
- I need to do 3 things: Authenticate, Upload, and Get Share Link
- [Authenticate]
- In order to upload to pCloud, I need to auth first.
- I need to send a request to:
- https://api.pcloud.com/login?username=USERNAME&password=PASSWORD
- it returns json
- ```
- {
- "cryptosetup": false,
- "plan": 3,
- "cryptosubscription": false,
- "publiclinkquota": snip,
- "premiumexpires": "snip",
- "email": "snip",
- "auth": "snip",
- "userid": snip,
- "result": 0,
- "quota": snip,
- "trashrevretentiondays": 30,
- "premium": true,
- "premiumlifetime": true,
- "emailverified": true,
- "usedquota": snip,
- "language": "en",
- "business": false,
- "cryptolifetime": false,
- "registered": "snip",
- "journey": {
- "claimed": false,
- "steps": {
- "verifymail": true,
- "uploadfile": true,
- "autoupload": false,
- "downloadapp": true,
- "downloaddrive": true
- }
- }
- }
- ```
- I need the token from auth to do anything else.
- [Upload]
- Now I will upload the file by sending a request to https://api.pcloud.com/uploadfile with the following parameters.
- auth (string) the auth token obtained using login method
- path (string) path to the folder
- filename (string) the filename of each uploaded file
- https://api.pcloud.com/uploadfile?auth=J1YuRVftOz1ZTqQGkhKmY3FyGRYfeiGu32y8NhIV&path=/ShareX&filename=FILENAME_STRING.jpg (auth key in this example is fake)
- [Get Share Link]
- Finally, once the file is uploaded, I need to use method getfilepublink (https://api.pcloud.com/getfilepublink?auth=J1YuRVftOz1ZTqQGkhKmY3FyGRYfeiGu32y8NhIV&path=/ShareX/FILENAME_STRING.jpg) to get the link to share it to other people. I can also generate a shorten link by adding parameter shortlink=1 to the end of the url.
- [Final Notes
- I want to do more like enumerate folders so I can pick a folder directly from ShareX using folderid similiar to how google drive and onedrive works.
- I also want to get upload progress with method uploadprogress (https://api.pcloud.com/uploadprogress?progresshash=PROGRESSHASH) which will be necessary to get the Share Link. Can't get a share link if the upload hasn't completed.
- Thanks for your time and I hope to hear back from you.
- Jeff Savage ~ BetaLeaf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement