pCloud / pcloud-sdk-php

pCloud SDK for PHP
MIT License
54 stars 22 forks source link

register call no longer works #30

Closed gravelld closed 8 months ago

gravelld commented 8 months ago

register used to allow me to register new users - I used this with the affiliate programme.

However, now it responds with an error code 1101 "Invalid request".

I've tried through both the PHP SDK and the HTTP API. Both return the same thing. Here's my code:

$access_token = "???";
$locationid = 1;

$pCloudApp = new pCloud\Sdk\App();
$pCloudApp->setAccessToken($access_token);
$pCloudApp->setLocationId($locationid);

$method = "register";
$params = [
    "mail"=>"anewemailaddress@mydomain.com",
    "password"=>"test4£$%AAA",
    "termsaccepted"=>"yes",
    "ref"=>"affiliateProgrammeCodeLinkNum",
    "os"=>"4",
    "device"=>"MyDeviceName",
    "language"=>"en"
];

$request = new pCloud\Sdk\Request($pCloudApp);
$response = $request->get($method, $params); // the second argument is optional

echo print_r($response, true);

Note that auth is documented as no in the docs linked above. I've also tried setting an auth with the OAuth token for my affiliate programme's user.

What has changed?

theroot79 commented 8 months ago

Hello @gravelld ,

The /register API endpoint is deprecated and will be removed from our documentation at docs.pcloud.com in the near future. To ensure a seamless user experience for login and registration processes. I can recommend you transitioning to the OAuth flow. This approach will not only facilitate a more secure login process for your users but also streamline their registration experience. Check the following link for more details: https://docs.pcloud.com/methods/oauth_2.0/authorize.html

Best regards,

gravelld commented 8 months ago

Thanks for the suggestion. We already authenticate users with our own secure login process, so forcing these users to also step through signup with pCloud, on pCloud's site, would be too high friction. Thus we'll probably have to withdraw from the affiliate programme, or introduce it at a less critical time for signup for our service.