Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8608383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:35:53+00:00 2026-06-12T03:35:53+00:00

I want to use Facebook SDK on Android to send Like statuses using Open

  • 0

I want to use Facebook SDK on Android to send Like statuses using Open Graph API. Described here: https://developers.facebook.com/docs/opengraph/actions/builtin/likes/
From SDK I got access_token (with publish_actions permission) using SSO. I already registred my app on Facebook Dev Account so I have my app_id.
Now I want to use Open Graph API to send Like status on my wall. So I call https://graph.facebook.com/MY_USER_ID/og.likes with access_token, app_id and object header (using setRequestProperty()) with HttpURLConnection and setRequestMethod to POST.

HttpURLConnection conn;
conn.setRequestMethod("POST");
conn.setDoOutput(true);
conn.setRequestProperty("object", "someURL");
conn.setRequestProperty("app_id", "myID");
conn.setRequestProperty("access_token", "myToken");
conn.setRequestProperty("Content-Length", "" + postMessageInBytes.length);

I always get response 400 Bad Request

  {"error":{"message":"An access token is required to request this resource.","type":"OAuthException","code":104}} 

When I’m using Graph API Explorer (developers.facebook.com/tools/explorer/) everything works fine and there is no problem with access token.
When I debug my access token everything looks fine (translated from another language):

ID app: my app ID/name
ID user: user which I used to login
Issued: 1348929549 (yesterday)
Valid until: 1354113549 (in about 2 months)
Valid:  True
Origin: Mobile Web Faceweb
Permission: publish_actions user_status

So the question is, where is the problem with access token?
Thanks for help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T03:35:54+00:00Added an answer on June 12, 2026 at 3:35 am

    I don’t know where exactly was problem, but I started to use AsyncFacebookRunner which is part of Facebook SDK and everything now works fine. As I can see from source code of AsyncFacebookRunner same things are done little bit different.

    EDIT:
    Simple request for Like action

    Bundle msgParams = new Bundle();
    msgParams.putString("object", mUrl);
    Request request = new Request(Session.getActiveSession(), "me/og.likes", msgParams, HttpMethod.POST,
                    likeCallback);
    RequestAsyncTask task = new RequestAsyncTask(request);
    task.execute();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use an observer to send stuff to Facebook Open Graph. Roughly,
I am trying to use the node-facebook-sdk to make FB graph API calls using
Why would I want to use Facebook's JS SDK for making API calls....meaning use
I have a problem that I want to use Facebook SDK in Android but
I am using the Facebook C# SDK to get data. I want to use
I want to use Facebook SDK on XCode 4.5 for integration with iOS6. I
I am pretty new to the Facebook API and am using the Javascript SDK
I'm using Facebook SDK and I want to post message on my wall. It's
I'm using the Facebook PHP SDK (2.1.2). All I want to do is what
i want to use facebook's fb:dialog tag to display a simple pop-up form for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.