I have successfully used the following Python code, running on a Google App Engine server on localhost, to send Facebook notifications to myself. I use the template feature of Facebook notifications to expand a Facebook user ID into a bolded name in the text of the notification:
url = 'https://graph.facebook.com/'+myOwnID+'/notifications'
values = {'access_token' : 426547656256546|4fhe34FJdeV3WvfF6SNfehs7GfW
'href' : 'http://localhost:8080/',
'template' : '@['+myOwnID+'] says hi.'}
req = urllib2.Request(url, urllib.urlencode(values))
urllib2.urlopen(req)
Note that the app access token is made-up, but has the same format as a real token.
When I change the template's ID to the ID of one of my friends:
url = 'https://graph.facebook.com/'+myOwnID+'/notifications'
values = {'access_token' : 426547656256546|4fhe34FJdeV3WvfF6SNfehs7GfW
'href' : 'http://localhost:8080/',
'template' : '@['+myFriendID+'] says hi.'}
req = urllib2.Request(url, urllib.urlencode(values))
urllib2.urlopen(req)
I get the error
HTTP Error 403: Forbidden
It works the same even if I hard-code the IDs into the template, so it's not an issue of incorrect variable values.
Why does the second case not work? How can I fix it?