GraphAPIError: An active access token must be used to query information about the current user
<p>On Facebook GraphAPI, with the Python SDK, I am trying to send a notification to a user. I receive the error:</p>

<pre><code>GraphAPIError: An active access token must be used to query information about the current user  
</code></pre>

<p>My Python code is:</p>

<pre><code>graph = facebook.GraphAPI(access_token=TOKENS["app_token"])
graph.put_object(parent_object='me', connection_name='notifications', template='Tell us how you like the app!', href='https://www.google.com')
</code></pre>

<p>Solution:</p>

<pre><code>graph = facebook.GraphAPI(access_token=TOKENS["user_token"]) 
user_info= graph.get_object(id='me', fields='id')  
graph = facebook.GraphAPI(access_token=TOKENS["app_token"])
graph.put_object(parent_object= user_info['id'], connection_name='notifications', template='Tell us how you like the app!', href='https://www.google.com')
</code></pre>

python facebook facebook-graph-api