I've been trying to access the viagogo API but I get a 500 error, i'm using the code sample here:
www.dropbox.com/s/8fqfkkmdcvjtzxt/apipublicaccess.php
Surprisingly, this code works fine here:
http://mynameisroman.com/apipublicaccess.php
but not here :
http://www.smapin.com/apipublicaccess.php
Any ideas ?
thanks a lot !
You do realize that you need to change the following lines of code to contain valid Consumer Key and Consumer Secret.
$VIAGOGO["CONSUMERKEY"]="3o*******0jUQ";
$VIAGOGO["CONSUMERSECRET"]="Cv3*************dx0J";
Related
EDIT
I found that if I edit the code to not use http_build_query($parameters);
to convert array of parameters into the url-string, but pass the strings directly to the url it works. So how is http_build_query destroying the grant_type= authorization_code?
ORIGINAL:
I'm using the php sdk api https://github.com/jwilsson/spotify-web-api-php
and trying to connect the user. I log in using the link
https://accounts.spotify.com/authorize?
client_id=--id--
&redirect_uri=https%3A%2F%2Fwww.testsite.com%2Fspotify_connect%2F
&response_type=code
&scope=user-read-email
and get a code in return and I've traced the code towards the curl in Request->send()
the full link is
https://accounts.spotify.com/api/token?
client_id=--client--&
code=--returned_code--
&grant_type=authorization_code
&redirect_uri=https%3A%2F%2Fwww.testsite.com%2Fspotify_connect%2F
&client_secret=--secret--
I get this in return:
{"error":"unsupported_grant_type","error_description":"grant_type parameter is missing"}
I've tried sending the authorization in the header as well. Same result
Authorization: Basic base64_encode(--clientid--:--clientsecret--);
What am I doing wrong?
Using the
https://accounts.spotify.com/api/token?grant_type=client_credentials
is working like a charm, but using the code I get in return does not work.
Thanks for help :)
So I'm using RECAPTCHA 2.0 and I can't seem to get this form to work without getting a SQL Query Error, If you can find a solution please reply and thanks.
(I've made the secret key secret)
Can't seem to post PHP Code here so here is a pastebin link - https://pastebin.com/CbMhKVPf
<?php
$link = "https://pastebin.com/CbMhKVPf";
?>
I can get it to work, just had some logic errors.
For some reason when I call the following code:
echo file_get_contents('http://gdata.youtube.com/feeds/api/videos/wGG543FeHOE?v=2&alt=json');
I get the following image: http://i.ytimg.com/vi/UKY3scPIMd8/sddefault.jpg
This was working a few days ago - have Youtube started to restrict PHP access to their API?
For anyone else who gets this problem - see https://developers.google.com/youtube/v3/getting-started. Basically they've deprecated the free4all api and are now limiting it to token access. Its quite easy to get a token and once you have one just call:
https://www.googleapis.com/youtube/v3/videos?id=ID&key=YOUR__KEY&part=snippet,contentDetails,statistics,status
Working with the Facebook php SDK's, I am having a lot of trouble figuring out how to delete comments, given its id and xid.
At first I was using the REST API, where you can call 'comments_remove($xid, $id);' to delete a comment. The problem with this method came when the xid parameter only accepts alphanumeric characters and underscores.
Based on the documentation (http://developers.facebook.com/docs/reference/fbml/comments ) a valid XID can be the result of any url_encode.
Now I am testing my luck with the new GRAPH api. Looking at http://developers.facebook.com/docs/api under 'Deleting Objects', It seems that comment deleting is definitely supported. However, I have tried sending a DELETE request, and I have also tried sending POST and GET to the object url with the argument 'method=delete'.
No matter how I try it, I always get the same error:
{"error":{"type":"GraphMethodException","message":"Unsupported delete request."}}
I am sending the access token as a parameter as well. The access token that I am sending is the access token saved in the facebook cookie from the single sign on javascript cookie. These are all comments made on my application. Does this happen to anyone else, or am I simply not doing this right?
Any help or guidance is GREATLY appreciated.
Fixed!
You have to prepend the userid to the object ID when deleting:
DELETE https://graph.facebook.com/673509687_104812882909249?access_token={access_token}
where
673509687 is my userID and 104812882909249 is the objectID
Hopefully we can get this looked at:
http://bugs.developers.facebook.com/show_bug.cgi?id=10413
or
http://bugs.developers.facebook.com/show_bug.cgi?id=10434
Try with this:
FB.api('/'+_idComment, 'get', { method:'delete' }, function(response){
//Your code
}
I'm getting the following using the PHP client on my server (connecting via FBML). I've included the appropriate php files (facebook etc..)
Fatal error:
Call to undefined method FacebookRestClient::feed_publishUserAction()
in ..../index.php on line 50
I'm trying to use the example given.
Any ideas?
You might want to take a quick browse/grep through your Facebook API files (facebookapi_php5_restlib.php) and make sure that the feed_publishUserAction() method exists. Perhaps you're using an older version of the API library?
OMG I found the answer
Because the facebookapi_php5_restlib.php that facebook.com provided you is a piece of outdated shit
i.e. you won't be able to find the word feed_publishUserAction in the facebookapi_php5_restlib.php file
HOWEVER, the official facebook smiley demo from this facebook wiki page , contained a more completed facebookapi_php5_restlib.php , along with the feed_publishUserAction function
Which finger would you like to show to the facebook developer staffs?