[Python] Problem: (100) No permission to publish the video when uploading to Facebook Page via...

Discussão em 'Python' iniciado por Stack, Julho 3, 2025.

  1. Stack

    Stack Membro Participativo

    I was trying to upload a video to a Facebook Page using the Graph API and kept encountering the error:

    (#100) No permission to publish the video Despite having the app in Live mode, proper permissions granted (pages_manage_posts, pages_read_engagement, etc.), and using a valid access token, the upload failed.

    Root Cause

    Facebook requires a Page Access Token to publish content on a Page, not a User Access Token. Even if your user is an admin, using a user token alone won’t work for publishing videos on a page.

    Solution

    Here’s how to fix it:

    Step 1: Generate a Long-Lived User Access Token

    Use Graph API Explorer or your app flow to get a short-lived user token with these permissions:

    • pages_manage_posts
    • pages_show_list
    • pages_read_engagement

    Then exchange it for a long-lived token:

    GET https://graph.facebook.com/v18.0/oauth/access_token?
    grant_type=fb_exchange_token&
    client_id={app-id}&
    client_secret={app-secret}&
    fb_exchange_token={short-lived-user-token}


    Step 2: Fetch the Page Access Token

    Use the long-lived user token to get the token for your Page:

    GET https://graph.facebook.com/v18.0/me/accounts?access_token={long-lived-user-token}


    This returns all Pages the user has access to, along with each Page’s:

    • id
    • name
    • access_token (use this for video upload!)

    Step 3: Use Page Token for Uploads Replace your access_token in the API calls with the Page Access Token retrieved above.

    Example in code:

    ACCESS_TOKEN = os.getenv("FB_PAGE_ACCESS_TOKEN")


    Result

    After switching from a User Token to the correct Page Access Token, the Graph API video upload to Facebook Page worked successfully.

    Continue reading...

Compartilhe esta Página