Strange results connecting using phpSmug and oauth
Lint
Registered Users Posts: 27 Big grins
A quick question about whether anyone's noticed a difference between what phpSmug's images_get() returns when using different authorisation methods. I seem to be getting wildly different results when I use oauth as opposed to email/password. Essentially, results are correct with the former but very odd with the latter:
help appreciated, ta.
$f = new phpSmug("APIKey=<key>", "AppName=<myAPIname>" ); $f->login("EmailAddress=bing@bong.com", "Password=<password>" );works
$f = new phpSmug("APIKey=<key>", "AppName=<myAPIname>", "OAuthSecret=<secret>" ); $f->setToken("id=<ID>", "Secret=<secret>");comes back with what looks like a corrupted array.
help appreciated, ta.
0
Comments
Not sure if this is a phpSmug thing or a smugmug thing but I'll pass the word on to Colin Seymour anyway and dig in a bit more if I get a moment.
The problem comes about because the array returned by images.get is different between the two versions. The line:
fixes the problem.
Cheers all,
K.
www.flickr.com/photos/kimaldis/
sorry for the noise.
www.flickr.com/photos/kimaldis/
Just replying here so others can see.
First off, good to hear you've resolved the issue.
As you pointed out, OAuth is only available with the 1.2.2 endpoint. Accordingly, phpSmug will force the use of this endpoint if you instantiate using the OAuthSecret argument indicating your intent to use OAuth.
The differences in results is actually an API thing, and not phpSmug. The different endpoints return slightly different results.
At one stage phpSmug did try and keep things uniform, but I changed that to try and keep phpSmug as close to the API documentation as possible.
HTH
Colin
Personal Blog | Tech Blog | phpSmug
www.flickr.com/photos/kimaldis/