Programmatically getting an access token for using the Facebook Graph API

前端 未结 8 1018
我在风中等你
我在风中等你 2020-12-04 09:06

I am trying to put together a bash or python script to play with the facebook graph API. Using the API looks simple, but I\'m having trouble setting up curl in my bash scrip

8条回答
  •  没有蜡笔的小新
    2020-12-04 09:46

    Easy! Just use facebook-sdk.

    import facebook
    
    app_id = 'YOUR_APP_ID'
    app_secret = 'YOUR_APP_SECRET'
    
    graph = facebook.GraphAPI()
    
    # exactly what you're after ;-)
    access_token = graph.get_app_access_token(app_id, app_secret) 
    

提交回复
热议问题