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 6126635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:24:01+00:00 2026-05-23T16:24:01+00:00

FIXED NOW! But I can’t answer my own question yet. See my comment below.

  • 0

FIXED NOW! But I can’t answer my own question yet. See my comment below. And thanks for helping.


I’ve searched and searched and read the docs and still can’t figure this out.

I have a web page about an event. There’s also a public Facebook “event” for my event. I’m trying to use the FB Javascript SDK to get the number of attendees for the Facebook event and add it to the number of people who’ve registered through the website.

I’ve created an app and I have an appID and secret string. I can get an access token from:

https://graph.facebook.com/oauth/access_token?client_id=XXXX&client_secret=XXXXX&grant_type=client_credentials

and I can then use that access token to get the attendees for a public event:

https://graph.facebook.com/331218348435/attending?access_token=XXXXXXXXX

That’s all fine.

I’m now trying to do this same thing using the Javascript SDK.

I’ve loaded the SDK and done an init:

FB.init({
  appId  : 'XXXXXXXX',
  status : true, // check login status
  cookie : true, // enable cookies to allow the server to access the session
  xfbml  : true  // parse XFBML
});

and I know the SDK is working because I can get an object with the data that doesn’t need an access token:

FB.api( '/331218348435', function (response) { console.log ( response ) } );

but when I try to get the attendee data that needs the access token:

FB.api( '/331218348435/attending', function (response) { console.log ( response ) } );

I get an OAuthException: “An access token is required to request this resource.”

All the tutorials and information I can find all refers to using the .login method, but I don’t want a user to login, I want to login using my app ID without any user interaction.

I’d assumed that the API took the SDK’s init request and granted me an access token when I called the .init method, the authentication being done against my website’s address (the HTTP referrer – yes I have set my website URL in the Facebook app settings).

Any ideas what might be causing this to not work? How can I get the access token using the Javascript SDK without doing a .login? Am I missing a step? Is this even possible?

Thanks

  • 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-05-23T16:24:01+00:00Added an answer on May 23, 2026 at 4:24 pm

    Oh. OK.

    Well, for whatever reason, I went away and had my dinner and when I come back it’s working fine.

    When I updated the settings for my app Facebook said it might take a few minutes for the change to get around the servers. Turned out to take over an hour!

    My code was fine.

    Thanks for your help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: I have fixed all but two warnings now, so thank you all for
I had a problem (which is now fixed) but I've no idea why... I
I've searched and read (not just on SO) but can't seem to find a
This is not technically a programming question but perhaps someone can help me. Yes,
In ruby, I'm able to do File.dirname(/home/gumby/bigproject/now_with_bugs_fixed/32/FOO_BAR_2096.results) and get /home/gumby/bigproject/now_with_bugs_fixed/32 but now I'd like
I have my current location fixed via CoreLocation. Now I want to get those
I have background image for a site header with fixed width. Now I am
Fixed: See notes at bottom I am implementing a generic class that supports two
How can a fixed character limit be imposed on a text field in Cocos2d?
Xcode is doing something bizzare which I at one point in time fixed but

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.