Search Results

Search found 27 results on 2 pages for 'oauthexception'.

Page 1/2 | 1 2  | Next Page >

  • Uncaught OAuthException

    - by Christopher 'Cj' Jesudas
    Guys please help me out with this...the error which my program gives is "Fatal error: Uncaught OAuthException: Error validating application"... My program code is : require ("src/facebook.php"); $appapikey = '132347710178087'; $appsecret = 'e27456d003801ae145a77ab28904fca0'; $facebook = new Facebook($appapikey, $appsecret); $user_id = $facebook->getUser(); $friends = $facebook->api('friends.get'); echo "<p>Hello <fb:name uid=\"$user_id\" useyou=\"false\" linked=\"false\" firstnameonly=\"true\"></fb:name>, you have ".count($friends)." friends"; foreach($friends as $friend){ $infos.=$friend.","; } $infos = substr($infos,0,strlen($infos)-1); $gender=$facebook->api_client->users_getInfo($infos,'sex'); $gender_array = array(); foreach($gender as $gendervalue){ $gender_array[$gendervalue[sex]]++; } $male = round($gender_array[male]*100/($gender_array[male]+$gender_array[female]),2); $female = 100-$male; echo "<ul><li>Males: $male%</li><li>Females: $female%</li></ul>";

    Read the article

  • Need Help on OAuthException Code 2500

    - by Deepak
    I am trying to develop an Facebook application (apps.facebook.com/some_app) using PHP where I need to present some information based on user's music interests. I found that its under "user_likes games". My problems are as follows: To gain access, I have implemented the oauth dialog method as suggested in API in my index page. $auth_url = "http://www.facebook.com/dialog/oauth?client_id=" . $app_id . "&redirect_uri=" . urlencode($canvas_page) ."&scope=user_likes"; After successful authorization I come back to index page with "code" as parameters. http://MY_CANVAS_PAGE/?code=some base64 encoded letters Firstly I don't know if I need access_token just to read user's music interests but I have tried all the methods suggested. I couldn't move forward from this point I have a code like this (in my index page), which redirects for authorization if code parameters is not set. if(empty($code) && !isset($_REQUEST['error'])) { $_SESSION['state'] = md5(uniqid(rand(), TRUE)); //CSRF protection echo("<script> top.location.href='" . $auth_url . "'</script>"); } Currently I am just trying to get user's public information here but with no success. I have tried the signed_request method as suggested but no success $signed_request = $_REQUEST["signed_request"]; list($encoded_sig, $payload) = explode('.', $signed_request, 2); $data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true); echo ("Welcome User: " . $data["user_id"]); Also tried the code found in http://developers.facebook.com/blog/post/500/ but I am getting error when trying to get the debug info using print_r($decoded_response); stdClass Object ( [error] => stdClass Object ( [message] => An active access token must be used to query information about the current user. [type] => OAuthException [code] => 2500 ) ) To get user's public info, I have tried also the suggested example in PHP SDK $facebook = new Facebook(array( 'appId' => MY_APP_ID, //registered facebook APP ID 'secret' => MY_SECRET, //secret key for APP )); $fb_user = $facebook->getUser(); if($fb_user){ try { $user_profile = $facebook->api('/me'); echo $user_profile['email']; } catch(FacebookApiException $e) { $fb_user = null; } } But no success. Can somebody explain me why I am getting this error and how to access the user's music interest properly. Probably I misunderstood the API. Thanks Deepak

    Read the article

  • Getting empty result within PHP when in browser I get the JSON exception

    - by Pentium10
    I have this code: $url="https://graph.facebook.com/me/friends?access_token=".$access_token."&fields=id,first_name,last_name&limit=10"; $content=file_get_contents($url); Whenever I use this on a non authenticated user I should get feedback of OAuthException, which doesn't show up in the PHP the $content is empty. While if I copy the URL to the browser I get the result and I see the exception. I want to detect if the user is logged in and the session data is valid. What might be wrong?

    Read the article

  • facebook API error : Uncaught OAuthException: Error validating access token.

    - by iyad al aqel
    guys i'm getting this error Fatal error: Uncaught OAuthException: Error validating access token. thrown in /home/techtud1/public_html/library/facebook.php on line 543 i'm a newbie to facebook development but i'm using the exact steps of this tutorial http://www.joeyrivera.com/2010/facebook-graph-api-app-easy-w-php-sdk/ when i tried to get the information of the user i got it once , but when i tried to do it again i got this error . and whatever i'm doing , i'm getting this error as a result HELP PZ

    Read the article

  • What access token should i use?

    - by user548458
    I made a posting scores. It worked normaly sometimes. But, now I cant post any score. If I use user accessToken: string path = meID + "/scores"; var parameters = new Dictionary<string, object> (){ { "score", score.ToString () }, { "access_token", accessToken } }; facebook.post (path, parameters, ( error, obj ) => I get error: {"error":{"message":"(#15) This method must be called with an app access_token.", "type":"OAuthException", "code":15}} If I use an app access token: string path = meID + "/scores"; var parameters = new Dictionary<string, object> () { { "score", score.ToString () }, { "access_token", appAccessToken } }; facebook.post (path, parameters, ( error, obj ) => I get other error: {"error":{"message":"A user access token is required to request this resource.", "type":"OAuthException", "code":102}} Help me please, what am i doing wrong? PS: I worked well recently, but now - dont. Cant explain it...

    Read the article

  • PHP fb error posting story to user wall

    - by user237925
    I got an error from last 6 hrs. and stuck on it.While running my code i got this error again and again "Request failed with code: 400, message: {"error":{"message":"(#100) Object Invalid Value: Object at URL 'http://stayingnear.com/index.php?r=apartment\u00252Fview&id=1' of type 'stayingnearapp:apartment' is invalid because the given value '7.2853779052137E+14' for property 'fb:app_id' could not be parsed as type 'fbid'.","type":"OAuthException","code":100}}" is it the access token problem or what,and how can i handle this problem ?

    Read the article

  • What should I use as my connect URL when using FB AUTHENTICATION?

    - by adam
    { "error": { "type": "OAuthException", "message": "Invalid redirect_uri: The Facebook Connect cross-domain receiver URL (http://www.beta.neighborrow.com.com/callback) must have the application's Connect URL (http://www.beta.neighborrow.com/callback/) as a prefix. You can configure the Connect URL in the <a href=\"http://www.facebook.com/developers/editapp.php?app_id=2233125716\">Application Settings Editor</a>." } } What should I use as my connect URL

    Read the article

  • Troubleshooting Facebook's graph.put_object that returns error 400

    - by TimLeung
    I am using Facebook Python's SDK along with Google App Engine, and making a call to do a checkin: graph.put_object("me", "checkins", message="Hello, world", place="165039136840558", coordinates='{"latitude":"38.2454064", "longitude":"-122.0434404"}') However, this throws an error 400 Bad Request and I don't seem to be able to try catch it so I can have the important information. On a bad request, Facebook should return, an object like below which can help troubleshoot and address the issue, but I am not sure how I can retrieve this object: { "error": { "type" : "OAuthException", "message" : "An active access token must be used to query information about the current user." } }

    Read the article

  • Permanent access token to an app that posts to a fan page - error code:1

    - by Leandro Guedes
    I'm following the steps very well described here http://stackoverflow.com/a/18399927/2510225 , but, from my server, I receive the following error: {"error":{"message":"The access token does not belong to application APP-ID","type":"OAuthException","code":1}} I can't figure what I'm doing wrong. Anyone knows if the process to get a permanent access token has changed, or is having the same issue? The access token I'm using in the request is the user access token, which I think is correct.

    Read the article

  • on facebook, how do i authenticate an application, using JavaScript?

    - by GilShalit
    I can only find samples using php or curl. I want to do something like https://graph.facebook.com/<app_id>/accounts/test-users? installed=true&permissions=read_stream and the response is: { "error": { "type": "OAuthException", "message": "An access token is required to request this resource." } } as well is should... so how do i get the access token in JavaScript (using the JavaScript SDK obviously). thanks!

    Read the article

  • Unexpected error when attempting to delete a facebook story

    - by blueberryfields
    I'm attempting to delete a facebook story/action, like so: curl -F 'access_token=[valid_token]' -X DELETE https://graph.facebook.com/[action_id] Facebook is responding with an internal server error, like so: {"error": {"message":"An unexpected error has occurred. Please retry your request later.", "type":"OAuthException","code":2}} Is this an error caused by my actions, or something on Facebook's end? Additional info When I run curl -X GET https://graph.facebook.com/[action_id]?access_token=[valid_token] the result is "false"

    Read the article

  • LinkedIn API returns 'Unauthorized' response (PHP OAuth)

    - by Jim Greenleaf
    I've been struggling with this one for a few days now. I've got a test app set up to connect to LinkedIn via OAuth. I want to be able to update a user's status, but at the moment I'm unable to interact with LinkedIn's API at all. I am able to successfully get a requestToken, then an accessToken, but when I issue a request to the API, I see an 'unauthorized' error that looks something like this: object(OAuthException)#2 (8) { ["message:protected"]=> string(73) "Invalid auth/bad request (got a 401, expected HTTP/1.1 20X or a redirect)" ["string:private"]=> string(0) "" ["code:protected"]=> int(401) ["file:protected"]=> string(47) "/home/pmfeorg/public_html/dev/test/linkedin.php" ["line:protected"]=> int(48) ["trace:private"]=> array(1) { [0]=> array(6) { ["file"]=> string(47) "/home/pmfeorg/public_html/dev/test/linkedin.php" ["line"]=> int(48) ["function"]=> string(5) "fetch" ["class"]=> string(5) "OAuth" ["type"]=> string(2) "->" ["args"]=> array(2) { [0]=> string(35) "http://api.linkedin.com/v1/people/~" [1]=> string(3) "GET" } } } ["lastResponse"]=> string(358) " 401 1276375790558 0000 [unauthorized]. OAU:Bhgk3fB4cs9t4oatSdv538tD2X68-1OTCBg-KKL3pFBnGgOEhJZhFOf1n9KtHMMy|48032b2d-bc8c-4744-bb84-4eab53578c11|*01|*01:1276375790:xmc3lWhXJvLSUZh4dxMtrf55VVQ= " ["debugInfo"]=> array(5) { ["sbs"]=> string(329) "GET&http%3A%2F%2Fapi.linkedin.com%2Fv1%2Fpeople%2F~&oauth_consumer_key%3DBhgk3fB4cs9t4oatSdv538tD2X68-1OTCBg-KKL3pFBnGgOEhJZhFOf1n9KtHMMy%26oauth_nonce%3D7068001084c13f2ee6a2117.22312548%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1276375790%26oauth_token%3D48032b2d-bc8c-4744-bb84-4eab53578c11%26oauth_version%3D1.0" ["headers_sent"]=> string(401) "GET /v1/people/~?GET&oauth_consumer_key=Bhgk3fB4cs9t4oatSdv538tD2X68-1OTCBg-KKL3pFBnGgOEhJZhFOf1n9KtHMMy&oauth_signature_method=HMAC-SHA1&oauth_nonce=7068001084c13f2ee6a2117.22312548&oauth_timestamp=1276375790&oauth_version=1.0&oauth_token=48032b2d-bc8c-4744-bb84-4eab53578c11&oauth_signature=xmc3lWhXJvLSUZh4dxMtrf55VVQ%3D HTTP/1.1 User-Agent: PECL-OAuth/1.0-dev Host: api.linkedin.com Accept: */*" ["headers_recv"]=> string(148) "HTTP/1.1 401 Unauthorized Server: Apache-Coyote/1.1 Date: Sat, 12 Jun 2010 20:49:50 GMT Content-Type: text/xml;charset=UTF-8 Content-Length: 358" ["body_recv"]=> string(358) " 401 1276375790558 0000 [unauthorized]. OAU:Bhgk3fB4cs9t4oatSdv538tD2X68-1OTCBg-KKL3pFBnGgOEhJZhFOf1n9KtHMMy|48032b2d-bc8c-4744-bb84-4eab53578c11|*01|*01:1276375790:xmc3lWhXJvLSUZh4dxMtrf55VVQ= " ["info"]=> string(216) "About to connect() to api.linkedin.com port 80 (#0) Trying 64.74.98.83... connected Connected to api.linkedin.com (64.74.98.83) port 80 (#0) Connection #0 to host api.linkedin.com left intact Closing connection #0 " } } My code looks like this (based on the FireEagle example from php.net): $req_url = 'https://api.linkedin.com/uas/oauth/requestToken'; $authurl = 'https://www.linkedin.com/uas/oauth/authenticate'; $acc_url = 'https://api.linkedin.com/uas/oauth/accessToken'; $api_url = 'http://api.linkedin.com/v1/people/~'; $callback = 'http://www.pmfe.org/dev/test/linkedin.php'; $conskey = 'Bhgk3fB4cs9t4oatSdv538tD2X68-1OTCBg-KKL3pFBnGgOEhJZhFOf1n9KtHMMy'; $conssec = '####################SECRET KEY#####################'; session_start(); try { $oauth = new OAuth($conskey,$conssec,OAUTH_SIG_METHOD_HMACSHA1,OAUTH_AUTH_TYPE_URI); $oauth->enableDebug(); if(!isset($_GET['oauth_token'])) { $request_token_info = $oauth->getRequestToken($req_url); $_SESSION['secret'] = $request_token_info['oauth_token_secret']; header('Location: '.$authurl.'?oauth_token='.$request_token_info['oauth_token']); exit; } else { $oauth->setToken($_GET['oauth_token'],$_SESSION['secret']); $access_token_info = $oauth->getAccessToken($acc_url); $_SESSION['token'] = $access_token_info['oauth_token']; $_SESSION['secret'] = $access_token_info['oauth_token_secret']; } $oauth->setToken($_SESSION['token'],$_SESSION['secret']); $oauth->fetch($api_url, OAUTH_HTTP_METHOD_GET); $response = $oauth->getLastResponse(); } catch(OAuthException $E) { var_dump($E); } I've successfully set up a connection to Twitter and one to Facebook using OAuth, but LinkedIn keeps eluding me. If anyone could offer some advice or point me in the right direction, I will be extremely appreciative!

    Read the article

  • Can't send FB Notifications with new API

    - by Zak Khalique
    Really need some help with this one! I'm trying to send notifications from a canvas app using the new notifications API but I keep getting the following exception: OAuthException: (#200) Only web canvas apps can send app notifications However, the app IS loaded in the Facebook canvas -- I'm making an ajax call to my server when the user takes a particular action which triggers the notification POST request. The user has also authorized the app. This is the code I'm using: $graphUrl = $user_id . "/notifications"; $params = array( "access_token" => $admintoken, "href" => $link, "template" => "string of text < 180 chars" ); try { $result = $facebook->_graph($graphUrl, 'POST', $params); } catch (Exception $e){ echo $e; }

    Read the article

  • facebook oauth dialog doesn´t start

    - by Franz Deschler
    Hi i got the following problem: I want the user to authenticate my app, so i want to show the authorisation dialog. To do this, i tried the api function FB.api("/dialog/oauth", "get", {client_id: APP_ID, redirect_uri: URI}, function(response){ console.log(response); }); But i get this error: code: 2500 message: "Unknown path components: /oauth" type: "OAuthException" But why? The FB.api call should be the same like http://www.facebook.com/dialog/oauth?client_id=<app-id>&redirect_uri=<uri> If i put this url in the browser directly, the dialog is shown. ('window.location' also doesn´t work because of x-frame-options)

    Read the article

  • LinkedIn with Pecl OAuth: "got a 400, expected HTTP/1.1 20X or a redirect"

    - by CharlesS
    I have Pecl OAuth with PHP5 on a Debian box and I try to authenticate to LinkedIn. When calling; OAuth-getAccessToken('https://api.lin...')\n#1 I get; PHP Fatal error: Uncaught exception 'OAuthException' with message 'Invalid auth/bad request (got a 400, expected HTTP/1.1 20X or a redirect)' I have tried it from scratch and I have tried the PHP API wrappers that are available and (ofcourse, because they use OAuth Pecl ext) have all the same problem. I read somewhere it might be the timestamp on the server, but I synched that up with ntpdate; it does that quite often now, so the offset with the timeservers is almost 0. What else can it be? Thanks

    Read the article

  • How to post HTML content in facebook wall using facebook api in php

    - by Elankeeran
    How to post HTML content in facebook wall using facebook api in php I have used below codes but not working $result = $facebook->api('/me/feed/','post',array( 'message' => '<h1>This is my demo Face book application!</h1>')); And I used as below code using php concatenate the HTML string $result = $facebook->api('/me/feed/','post',array( 'message' => 'This is my demo Facebook application!' . $htmlStr)); but not working and getting below error OAuthException: (#1) An unknown error occurred Any please help me.

    Read the article

  • Facebook Error: "The client token cannot be used for this API" - works on DEV and STAGE but not on LIVE app?

    - by Studio Temp
    I've built a notification sending system that sends notifications to all users of our app, using the app access token. This system is currently running on my localhost. When I configure it with the appid and appsecret for my dev and stage environments, it works fine. But when I put in the appid and appsecret of the LIVE app, I get this error: {"message":"The client token cannot be used for this API", "type":"OAuthException", "code":190} So what's different between dev and live? Dev and Stage are in sandbox mode, Live is not. So I tried disabling sandbox mode on Dev/Stage and they continue to function fine. Dev works fine, Stage works fine, Live gives this error. All other code is the same except for the appid, appsecret, and redirect_uri (changing it to match the domain of each environment). I have checked this post, but unfortunately resetting our appsecret on a site with 1,000,000 users is not something we can do at the moment (too much other functionality relies on it).

    Read the article

  • How do I get public feed from facebook without user authentication on a native/Desktop app?

    - by KronoS
    I'm looking to get publicly available facebook feeds (i.e. Google's facebook page/posts). However instead of forcing the user to sign into their own facebook app, I want to be able to access these posts. I've looked into using "App Access Tokens" however since my application is a native/Desktop app (iOS, Android, WP8/Win 8) I'm not able to do this. Is there a way to get publicly accessible feeds from facebook without user authentication? I'm using the Facebook C# SDK to access facebook. Currently I'm doing the following: dynamic tokenInfo = fb.Get( String.Format( "/oauth/access_token?client_id={0}&client_secret={1}&grant_type=client_credentials", FbController.AppId, FbController.AppSecret)); var appAccessToken = (string) tokenInfo.access_token; fb = new FacebookClient(); dynamic response = fb.Get( String.Format( "/google/posts?access_token={0}", appAccessToken)); Problem is that this only works if my application is set to "web" instead of "native/Desktop". I get the following error when running this code and classified app as native/Desktop. (OAuthException - #15) (#15) Requires session when calling from a desktop app

    Read the article

  • Facebook Oauth 2.0 Token errors

    - by James
    The user clicks the URL that is generated via the code below. $url = 'https://graph.facebook.com/oauth/authorize?' . http_build_query(array('client_id' => FACEBOOK_APP_ID, 'redirect_uri' => 'http://fb.example.com/facebook', 'scope' => 'publish_stream,email,offline_access,user_location,user_hometown', 'display' => 'page')); Upon granting access to the application, and redirecting to http://fb.example.com/facebook I grab the following URL using cURL. $url = 'http://graph.facebook.com/oauth/access_token?' . http_build_query(array('client_id' => FACEBOOK_APP_ID, 'client_secret' => FACEBOOK_SECRET, 'redirect_uri' => 'http://fb.example.com/facebook', 'code' => $params['code'])); This returns the error below that I receive when grabbing the above URL. { "error": { "type": "OAuthException", "message": "Error validating verification code." } } Any ideas? Really getting stuck on this.

    Read the article

  • Why can't I access the facebook friends list after reopening a session in ios

    - by user1532390
    I am upgrading to the facebook 3.0 sdk for ios. Things went well, until I tried to open an existing session after relaunching the application. I am trying to access the list of friends for the facebook user. if ([[FBSession activeSession] isOpen]) { [request startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) { //do something here }]; }else{ [[self session] openWithCompletionHandler:^(FBSession *session, FBSessionState status, NSError *error) { if ([self isValid]) { [request startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) { //log this error we always get NSLog(@"%@",error); //do something else }]; } }]; } However I get this error: Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0x1d92ff40 {com.facebook.sdk:ParsedJSONResponseKey={ body = { error = { code = 2500; message = "An active access token must be used to query information about the current user."; type = OAuthException; }; }; code = 400; }, com.facebook.sdk:HTTPStatusCode=400} I've found that if I use the FBSession reauthorize method it allows me to complete the request without error, but it also means I must show UI or switch apps every time we relaunch the application which is unacceptable. Any suggestions on what I should be doing differently?

    Read the article

  • Unable to register achievements

    - by abe
    I've been unable to register any achievements. I keep getting the following: {"error":{"message":"(#3502) Object at achievement URL is not of type game.achievement","type":"OAuthException","code":3502}} When I run my URL through the linter, I get: Open Graph Warnings That Should Be Fixed Inferred Property: The 'og:url' property should be explicitly provided, even if a value can be inferred from other tags. Inferred Property: The 'og:title' property should be explicitly provided, even if a value can be inferred from other tags. Although when I load the URL myself I clearly see those set in the meta tags. My HTML looks like: <html> <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# game: http://ogp.me/ns/game#"> <meta property="fb:app_id" content="<MY_APP_ID>" /> <meta property="og:type" content="game.achievement" /> <meta property="og:url" content="http://<MY_DOMAIN>/ach10.html" /> <meta property="og:title" content="Title" /> <meta property="og:description" content="Description" /> <meta property="og:image" content="http://placekitten.com/g/200/300" /> </head> <body> Hmm.. </body> </html> Also interesting, is the graph API sees it as: { "url": "http://<MY_DOMAIN>/ach10.html", "type": "website", "title": "http://<MY_DOMAIN>/ach10.html", "updated_time": "2012-03-09T19:49:14+0000", "id": "<ID>" } And the scraped URL returns nothing ... anyone have any ideas? I've also tried adding the Game Achievement object in the Open Graph settings and every combination of Sandbox Mode/Social Discovery enabled and disabled.

    Read the article

  • facebook open graph meta property og:type of 'website'. The property 'object-name' requires an object of og:type 'object-name'

    - by chinmayahd
    in cake php 1.3 in view ctp i have follow code: $url = 'http://example.com/exmp/explus/books/view/'.$book['Book']['id']; echo $this->Html->meta(array('property' => 'fb:app_id', 'content' => '*******'),'',array('inline'=>false)); echo $this->Html->meta(array('property' => 'og:type', 'content' => 'book'),'',array('inline'=>false)); echo $this->Html->meta(array('property' => 'og:url', 'content' => $url ),'',array('inline'=>false)); echo $this->Html->meta(array('property' => 'og:title', 'content' => $book['Book']['title']),'',array('inline'=>false)); echo $this->Html->meta(array('property' => 'og:description', 'content' => $book['Book']['title']),'',array('inline'=>false)); $imgurl = '../image/'.$book['Book']['id']; echo $this->Html->meta(array('property' => 'og:image', 'content' => $imgurl ),'',array('inline'=>false)); ?> and it gives the following error when i am posting it' { "error": { "message": "(#3502) Object at URL http://example.com/exmp/explus/books/view/234' has og:type of 'website'. The property 'book' requires an object of og:type 'book'. ", "type": "OAuthException", "code": 3502 } } is any one know how to solve it?

    Read the article

  • Getting Public Info about Location in Facebook Graph API

    - by Allan Deamon
    I need to get the living city of each person in a group. Including people that are not my friends. In the browser seeing facebook profile of some unknown person, they show "lives in ...", if this is set as public information. They include the link to the city object with the city id in the link. That's all that I need. But, using a facebook app that I created to use the facebook graph api, this information is not public. I can only get the user propriety 'location' from friends of my that I have permission to see it. I gave ALL the possible permissions to my app. In the api explorer, when I use it as REST, they show few informations about someone not friend of mine. https://developers.facebook.com/tools/explorer/ Also in the api explorer, when I use the FQL, it didn't works. This query works, returning the JSON with the data: SELECT uid, name FROM user WHERE username='...'; But this other query doesn't work: SELECT uid, name, location FROM user WHERE username='...'; They return a json with a error code: { "error": { "message": "(#602) location is not a member of the user table.", "type": "OAuthException", "code": 602 } } I asked for ALL the permissions options in the token. And I can get this info in the browser version of the facebook. But how can I get it with the API ?

    Read the article

  • Error 100 When Attempting to post from app to Facebook wall?

    - by IMAPC
    I'm playing around with the Facebook API, and have gotten far enough to get the access token into my app, but when I go to actually send a post to my Facebook wall I get the error message, {"error":{"message":"(#100) You can't post this because it has a blocked link.","type":"OAuthException","code":100}}1 I'm not attempting to send any kind of link, just "Hello, World!" so this seems pretty weird to me :\ Here's my code so far: $content = urlencode("Hello, World!"); $accesstoken = urlencode($row['fbid']); $result = getPageWithPOST("https://graph.facebook.com/me/feed", "access_token=" . $accesstoken . "&message=" . $content); echo $result; where getPageWithPOST is, function getPageWithPOST($url, $posts) { $c = curl_init(); curl_setopt($c, CURLOPT_URL, $url); curl_setopt($c, CURLOPT_POST, true); curl_setopt($c, CURLOPT_POSTFIELDS, $posts); $content = curl_exec ($c); curl_close ($c); return $content; } thanks!

    Read the article

  • Getting list of Facebook friends with latest API

    - by Eric
    I'm using the most recent version of the Facebook SDK (which lets to connect to something called the 'graph API' though I'm not sure). I've adapted Facebook's example code to let me connect to Facebook and that works... but I can't get a list of my friends. $friends = $facebook->api('friends.get'); This produces the error message: "Fatal error: Uncaught OAuthException: (#803) Some of the aliases you requested do not exist: friends.get thrown in /mycode/facebook.php on line 543" No clue why that is or what that means. Can someone tell me the right syntax (for the latest Facebook API) to get a list of friends? (I tried "$friends = $facebook-api-friends_get();" and get a different error, "Fatal error: Call to a member function friends_get() on a non-object in /mycode/example.php on line 129".) I can confirm that BEFORE this point in my code, things are fine: I'm connected to Facebook with a valid session and I can get my info and dump it to the screen just... i.e. this code executes perfectly before the failed friends.get call: $session = $facebook->getSession(); if ($session) { $uid = $facebook->getUser(); $me = $facebook->api('/me'); } print_r($me);

    Read the article

1 2  | Next Page >