Advertisement
Guest User

Untitled

a guest
Nov 11th, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. 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)
  2.  
  3. I need to do 3 things: Authenticate, Upload, and Get Share Link
  4.  
  5. [Authenticate]
  6.  
  7. In order to upload to pCloud, I need to auth first.
  8.  
  9. I need to send a request to:
  10. https://api.pcloud.com/login?username=USERNAME&password=PASSWORD
  11.  
  12. it returns json
  13.  
  14. ```
  15. {
  16. "cryptosetup": false,
  17. "plan": 3,
  18. "cryptosubscription": false,
  19. "publiclinkquota": snip,
  20. "premiumexpires": "snip",
  21. "email": "snip",
  22. "auth": "snip",
  23. "userid": snip,
  24. "result": 0,
  25. "quota": snip,
  26. "trashrevretentiondays": 30,
  27. "premium": true,
  28. "premiumlifetime": true,
  29. "emailverified": true,
  30. "usedquota": snip,
  31. "language": "en",
  32. "business": false,
  33. "cryptolifetime": false,
  34. "registered": "snip",
  35. "journey": {
  36. "claimed": false,
  37. "steps": {
  38. "verifymail": true,
  39. "uploadfile": true,
  40. "autoupload": false,
  41. "downloadapp": true,
  42. "downloaddrive": true
  43. }
  44. }
  45. }
  46. ```
  47.  
  48. I need the token from auth to do anything else.
  49.  
  50. [Upload]
  51.  
  52. Now I will upload the file by sending a request to https://api.pcloud.com/uploadfile with the following parameters.
  53. auth (string) the auth token obtained using login method
  54. path (string) path to the folder
  55. filename (string) the filename of each uploaded file
  56.  
  57. https://api.pcloud.com/uploadfile?auth=J1YuRVftOz1ZTqQGkhKmY3FyGRYfeiGu32y8NhIV&path=/ShareX&filename=FILENAME_STRING.jpg (auth key in this example is fake)
  58.  
  59. [Get Share Link]
  60. 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.
  61.  
  62. [Final Notes
  63. 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.
  64. 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.
  65.  
  66. Thanks for your time and I hope to hear back from you.
  67. Jeff Savage ~ BetaLeaf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement