How to fix privacy must contain a valid privacy 'value' and set privacy value correctly using graph api?
1

import requests st_title = "xxxxxxx" st_description = "xxxxxxx" params = { 'status': 'LIVE_NOW', 'access_token': "xxxxxxx", 'appsecret_proof': "xxxxx", 'title': st_title, 'description': st_description, "privacy": { "value": "everyone" } } response = requests.post('https://graph.facebook.com/v20.0/me/live_videos', params=params) get_r = eval(response.content.decode())

Gives this error; {'error': {'message': "(#100) privacy must contain a valid privacy 'value'", 'type': 'OAuthException', 'code': 100, 'fbtrace_id': 'AaliCk4WnbUR9fF2-uSJErh'}}

RatTeil
Asked about a week ago
Selected Answer
1

This fixed the error and set privacy to 'EVERYONE' in Python.

import requests, json st_title = "test" st_description = "testing privacy"

params = { 'status': 'LIVE_NOW', 'access_token': xxxxxxxxx, 'appsecret_proof': xxxxxx, 'title': st_title, 'description': st_description, 'privacy': json.dumps({ 'description': 'Everyone', 'value': 'EVERYONE' }) } fb_graph_url = "https://graph.facebook.com/v20.0/me/live_videos"

response = requests.post(fb_graph_url, params)

June 19 at 12:25 AM
RatTeil
Selected Answer
1

Try using an uppercased value, if you are trying to publish a user live video

June 16 at 2:56 AM
Lars
RatTeil

I tried that but didn't work

here what i tried: EVERYONE, FRIENDS, PUBLIC, EVERYBODY, friends everybody, everyone, public,

all of them gives thisberror

June 16 at 7:03 AM
1

Just append the privacy parameter to the endpoint itself:

/live_videos?privacy={'value':'EVERYONE'}

June 16 at 7:32 AM
Lars
RatTeil

This fix the error but live video privacy still set to only me

June 16 at 10:35 AM