I'm playing with Dropbox API for PHP, and I would like know the correct way to upload files automatically without command line.
Now my process is:
php -f upload.php
- Copy long url on browser
- Click allow button
- Copy the token
- paste the token on console and done.
My plan is do an automated backup of some JSON files on my Dropbox.
Is there other way to make that without console? and copying tokens and simple solution?
EDIT When I try to hardcode it, the output it´s ->
Fatal error: Uncaught exception 'Dropbox\Exception_BadRequest' with message 'HTTP status 400
{"error_description": "code has already been used", "error": "invalid_grant"}'
EDIT 2*
The access token output
dusIlAq36pkAAAAAAAAHQ6daX9hwt-3wUL240gUUjIOYrscX2OYOkCyj8ZghUgG2
I set it as
$authCode = 'dusIlAq36pkAAAABBBBBAAAHQ6daX9hwt-3wUL240gUUjIOYrscX2OYOkCyj8ZghUgG2';
Here Drop MSG
...Fatal error: Uncaught exception 'Dropbox\Exception_BadRequest' with message 'HTTP status 400
{"error_description": "code doesn't exist or has expired",