2023-11-16, 06:58 PM
Hi everybody,
I can't find how I can update policies by admin API key and request. Server always respond with an 400 error.
But I read the doc and I cannot find it out.
Here simple python code that fails :
import requests
ADMIN_API_KEY = 'myadminapikey'
JELLYFIN_SERVER_URL = 'myjellyfinserverurl'
JELLYFIN_USER_ID = 'ajellyfinuserid'
headers = {
"Authorization": f'MediaBrowser Token="{ADMIN_API_KEY}"',
"Content-Type": "application/json"
}
data = {
'EnableAllChannels': False,
'EnableAllFolders': False,
'EnableContentDownloading': False,
'EnableLiveTvAccess': False,
'EnableLiveTvManagement': False,
'EnableSharedDeviceControl': False,
'SyncPlayAccess': None,
}
response = requests.post(f'{JELLYFIN_SERVER_URL}/Users/{JELLYFIN_USER_ID}/Policy', headers=headers, json=data)
print(response.status_code)
Thank you for your help !
Best regards
Damien
I can't find how I can update policies by admin API key and request. Server always respond with an 400 error.
But I read the doc and I cannot find it out.
Here simple python code that fails :
import requests
ADMIN_API_KEY = 'myadminapikey'
JELLYFIN_SERVER_URL = 'myjellyfinserverurl'
JELLYFIN_USER_ID = 'ajellyfinuserid'
headers = {
"Authorization": f'MediaBrowser Token="{ADMIN_API_KEY}"',
"Content-Type": "application/json"
}
data = {
'EnableAllChannels': False,
'EnableAllFolders': False,
'EnableContentDownloading': False,
'EnableLiveTvAccess': False,
'EnableLiveTvManagement': False,
'EnableSharedDeviceControl': False,
'SyncPlayAccess': None,
}
response = requests.post(f'{JELLYFIN_SERVER_URL}/Users/{JELLYFIN_USER_ID}/Policy', headers=headers, json=data)
print(response.status_code)
Thank you for your help !
Best regards
Damien