I try to add users to custom audiences with this code:
{
import requests
import json
payload = {'data': ['33f6fc8e08b0804555feeed0e0e81251bc408c7db58c7a030a8252731668afd0'],
'schema': 'EMAIL_SHA256'}
params = {'access_token': 'ACCESSTOKEN'}
response = requests.post('https://graph.facebook.com/audience_id/users',
params=params, data=json.dumps(payload))
response.json()
}
The response is:
{
{u'error': {u'code': 1,
u'message': u'An unknown error has occurred.',
u'type': u'OAuthException'}}
}
It's interesting that even the original example with curl returns the same result however the access token is valid and I can get data about audiences or create a new one with Python code.
Why I get this error?