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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:16:24+00:00 2026-06-08T06:16:24+00:00

To solve a problem detailed in a question on Stack Exchange Web Applications ,

  • 0

To solve a problem detailed in a question on Stack Exchange Web Applications, I’ve written a little PHP script that given a page name and a proper access_token spits out the events created by that page as an iCal calendar file. Obviously this file is not supposed to be accessed by humans, but by for example Google Calendar for subscribing.

I created the access_token through the Facebook Graph Explorer and only later realized that it expires. So the question is: can I get a page access_token that does not expire? Failing that, can I get one with a really long expiration that?

If that is not possible – does anyone have a clue what to do? Manually providing an access_token once an hour doesn’t feel very feasible.

  • 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-08T06:16:26+00:00Added an answer on June 8, 2026 at 6:16 am

    @CBroe put me on the right track, and @MPaulo helped me further. Here’s how I explain the process in the beginning of the script file I’ve created to solve the problem described in the question I linked to at the beginning of my question above.


    To begin with, you will need an access token. This is complicated stuff – getting a regular one is easy, but we want one that lasts permanently. As described in Scenario 5 here: https://developers.facebook.com/roadmap/offline-access-removal/ , we need to:

    1. Get a regular short-lived access token
    2. Exchange it for a long-lived access token
    3. Using our new access token, get a permanent page access token.

    First, create a new Facebook app at https://developers.facebook.com/apps/ . It can be named whatever, it’s not going to be really used. Fill in a domain – it doesn’t matter which, just take one that shows simple HTML and doesn’t do any redirects: I used my own static web page, http://jobjorn.se/ , but http://example.org/ may work too.

    As instructed by MPaulo on Stack Overflow here: https://stackoverflow.com/a/11238327/564628 , use the app id – from your newly created app – and visit this page:
    https://www.facebook.com/dialog/oauth?client_id=MY_APP_ID&redirect_uri=MY_SITE_URL&scope=manage_pages&response_type=token
    Be sure to replace “MY_APP_ID” and “MY_SITE_URL”.

    Then, exchange your short-lived access token for a long-lived access token by visiting this page:
    https://graph.facebook.com/oauth/access_token?client_id=MY_APP_ID&client_secret=MY_APP_SECRET&grant_type=fb_exchange_token&fb_exchange_token=YOUR_ACCESS_TOKEN
    Be sure to replace “MY_APP_ID”, “MY_APP_SECRET”, and “YOUR_ACCESS_TOKEN” (the last being the access token you received from the first page)

    Finally, get your page access token here:
    https://graph.facebook.com/me/accounts?access_token=YOUR_NEW_ACCESS_TOKEN
    Be sure to replace “YOUR_NEW_ACCESS_TOKEN” (the access token you recieved from the second page)

    Paste it below. It should be permanent, but due to a bug it might only last two months – see https://developers.facebook.com/bugs/151056591697025 for details. It seems to have been fixed however. You can test it here: https://developers.facebook.com/tools/debug/access_token

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

Sidebar

Related Questions

I have written a web application that posts a file via http to a
Recently, I tried to solve Problem 23 of Project Euler . For that I
I'm trying to solve Problem 13 of project euler, which involves the sum of
To solve some problem I need to compute a variant of the pascal's triangle
How can I solve this problem Cannot Create Forms. No MDI forms are currently
Please help me solve this problem with capybara I have a button like this
I need to solve a problem within job booking software and am hoping to
I would like solve the problem (now hypothetical but propably real in future) of
How to solve the problem with duplication in Binary Search Tree?
Trying to solve a problem with templatetags. I have two templatetags: @register.inclusion_tag('directory/_alphabet.html') def alphabet_list(names):

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.