Closed ghost closed 6 years ago
It looks like you're using the numeric ID as applicationId
. It should be your 64-character access key.
We'll update the docs to make that more clear.
Yeah in the API screen on the website its called Application ID so thats confusing. However when using the access code instead it gives me a new error:
Failed to generate access token: invalid_grant: The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.
And now it looks like this:
'applicationId' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'callbackUrl' => '<LINK TO PHP PAGE>',
'utmSource' => 'AppName'
Yeah you're right about the confusion; we'll be fixing that.
This isn't an unsplash-php
issue - can you send me some more details? You can get in touch with us at api@unsplash.com.
I think I already solved it.
On https://github.com/unsplash/unsplash-php/blob/master/examples/oauth-flow.php (line 11) it shows a custom link. On line 26 and 44 those are different. So that made me think I only needed to change the first callbackurl. However when changing the others to the same as line 11 it seems to work.
However i'm struggling getting it to work. Would be great if I had some real-world examples. So far I failed with even doing a simple search. Might be mainly because my object-orientated programming skills are limited. So It would help me alot to have some good examples on basic tasks.
$search = 'forest';
$page = 3;
$per_page = 15;
$orientation = 'landscape';
$test = $httpClient::$connection->photos($search, $page, $per_page, $orientation);
echo "results:";
var_export($test);
No luck so far...
@Xionax OAuth problems are almost always that there's a mismatch in your requests; everything must match: key and secret, redirect URI, requested scopes, etc. I can help you via email.
When i'm trying to use oath authentication I keep getting this error. I have really no clue what is going wrong.
I'm using the script mentioned in the example folder. Specified: