When building a server-side application that automatically posts to a Facebook Page, the recommended approach is to obtain a long-lived Page Access Token instead of relying on short-lived User Access Tokens.
Why Use a Long-Lived Page Token?
Complete Process

Get your App ID
  • Step 1 - From https://developers.facebook.com/« click on [My Apps] in top Right corner.
  • Step 2 - Choose your app by clicking its icon.
  • Step 3 - Left side menu, Expand [App settings], and choose [Basic].
  • Step 4 - [App ID] = Copy | [App Secret]: Show then Copy
  • Step 5 - Top [Menu], Expand [Tools] and choose [Graph API Explorer]
  • Step 6 - Page loads, on the [User or Page] click dropdown and choose your Page. (Normally located at the bottom of the list)
  • Step 7 - Copy the [Access Token] that was Generated for your page.
  • Step 8 - Replace the sections in this URL string, with your information.
    YOUR-APP-ID
    Copy
    Search Site
    Search Google
    | YOUR-SECRET-KEY
    Copy
    Search Site
    Search Google
    | GENERATED-ACCESS-TOKEN
    Copy
    Search Site
    Search Google

    [HTML - Facebook Graph URL]
    CFFCS | CarrzSynEdit: | HTML (Hyper Text Markup Language)
    https://graph.facebook.com/v23.0/oauth/access_token?grant_type=fb_exchange_token&client_id=YOUR-APP-ID&client_secret=YOUR-SECRET-KEY&fb_exchange_token=GENERATED-ACCESS-TOKEN

  • Step 9 - After you have added your information in place of the place holders, paste the URL into your Browser and click enter.
    You should now receive a new [Access Token].
    Copy the new Access Token.
  • Step 10 - Go to this url https://developers.facebook.com/tools/debug/accesstoken and paste in the new Access Token and click Debug.
    You should get something like this.

    Access Token Info

    App ID: YOUR-APP-ID : My-App
    Type: Page
    Page ID: YOUR-PAGE-ID : My Awesome App
    App-Scoped User ID: 0000000000000 : Your Name
    Learn More

    User last installed this app via API N/A
    Issued: 000000000 (about a minute ago)
    Expires: Never
    Data Access: Expires 000000000 (in about 3 months)
    Valid: True
    Origin: Web
    Scopes: pages_show_list, pages_read_engagement, pages_manage_posts, public_profile

    Granular Scopes
    pages_show_list YOUR-PAGE-ID : My Awesome App
    pages_read_engagement YOUR-PAGE-ID : My Awesome App
    pages_manage_posts YOUR-PAGE-ID : My Awesome App

    Important
    Wrong Token If the "Type" field (2nd line) does not say "Page", you generated the wrong token. Go back to Graph API Explorer and make sure you selected your Facebook Page instead of your user account before generating the token.
  • Step 11 - Paste the new long-lived Page Access Token into your App and test.
    In using an ASP.NET App, then place it in your web.config file.

    [ASP.NET - web.config]
    CFFCS | CarrzSynEdit: | ASP.NET (VB/C#)
    <?xml version="1.0"?>
    <configuration>
    <appSettings>
    <add key="FacebookGraphVersion" value="v24.0" />
    <add key="FacebookPageID" value="YOUR-PAGE-ID" />
    <add key="FacebookPageAccessToken" value="LONG-LIVED-PAGE-ACCESS-TOKEN" />
    </appSettings>
    </configuration>


    Then call it from your app.
    Example
    [ASP.NET - DIM Variables]
    CFFCS | CarrzSynEdit: | ASP.NET (VB/C#)
    Dim graphVersion As String = GetRequiredSetting("FacebookGraphVersion")
    Dim pageID As String = GetRequiredSetting("FacebookPageID")
    Dim pageToken As String = GetRequiredSetting("FacebookPageAccessToken")

    Important
    Keep Secret Do not add these values to any social media site, or forums. Do not hard code it in your script, placing it where you have easy access is the best place.
    you can also place it in a database and call it from there.
[Congratulations!]

Your application can now publish directly to your Facebook Page without requiring you to manually generate a new access token every 60 days. As long as your Page permissions remain valid and Facebook does not revoke the token, the Page Access Token can continue to be used for automated posting.
[Errors you may encounter.]
(THEWRONGTOKEN)
Does not resolve to a valid user
{"success":false,"message":"System.InvalidOperationException: Facebook post failed: {\"error\":{\"message\":\"(#100) 0 does not resolve to a valid user ID\",\"type\":\"OAuthException\",\"code\":100,\"fbtrace_id\":\"THEWRONGTOKEN\"}} ---\u003e System.Net.WebException: The remote server returned an error: (400) Bad Request.\r\n
Make sure your token is the correct token.
If you use a User Token instead of a Page Token, you will get this error.
The permission(s) publish_actions are not available
{"success":false,"message":"System.InvalidOperationException: Facebook post failed: {\"error\":{\"message\":\"(#200) The permission(s) publish_actions are not available. It has been deprecated. If you want to provide a way for your app users to share content to Facebook, we encourage you to use our Sharing products instead.