• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support Troubleshooting API update user

     
    • 0 Vote(s) - 0 Average

    API update user

    tmsrxzar
    Offline

    Senior Member

    Posts: 755
    Threads: 6
    Joined: 2023 Nov
    Reputation: 20
    #10
    2023-11-22, 06:20 AM (This post was last modified: 2023-11-22, 06:45 AM by tmsrxzar. Edited 1 time in total.)
    started looking into this, not sure where you are reading documentation but i logged it in my browser's dev panel

    the jellyfin web sends different parameters, specifically the headers and the auth to be more specific


    edit

    this code works for me

    Code:
    import requests

    ADMIN_API_KEY = '...'
    JELLYFIN_SERVER_URL = '...'
    JELLYFIN_USER_ID = '...'

    headers = {
        "X-Emby-Authorization": f'MediaBrowser Token="{ADMIN_API_KEY}"',
        "Content-Type": "application/json"
    }

    data = {"EnableContentDownloading":False,
            "AuthenticationProviderId":"Jellyfin.Server.Implementations.Users.DefaultAuthenticationProvider",
            "PasswordResetProviderId":"Jellyfin.Server.Implementations.Users.DefaultPasswordResetProvider"}

    response = requests.post(f'{JELLYFIN_SERVER_URL}/Users/{JELLYFIN_USER_ID}/Policy', headers=headers, json=data)
    print(response.status_code)


    where ADMIN_API_KEY is an api key generated from the dashboard -> api keys
    SERVER_URL is my server
    JELLYFIN_USER_ID is the user id in the address bar when viewing a user (not a username)
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    Messages In This Thread
    API update user - by Damien - 2023-11-16, 06:58 PM
    RE: API update user - by qwerty12 - 2023-11-18, 02:37 AM
    RE: API update user - by Damien - 2023-11-18, 07:14 AM
    RE: API update user - by qwerty12 - 2023-11-18, 04:25 PM
    RE: API update user - by Damien - 2023-11-21, 03:48 AM
    RE: API update user - by qwerty12 - 2023-11-21, 04:06 PM
    RE: API update user - by Damien - 2023-11-21, 05:46 PM
    RE: API update user - by tmsrxzar - 2023-11-21, 05:55 PM
    RE: API update user - by Damien - 2023-11-22, 05:42 AM
    RE: API update user - by tmsrxzar - 2023-11-22, 06:20 AM
    RE: API update user - by Damien - 2023-11-22, 09:30 AM
    RE: API update user - by niels - 2023-11-22, 10:18 AM

    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode