slove 0 Posted April 3, 2024 Posted April 3, 2024 "I want to use the Emby API to create a new user and copy configurations from a specified user. Does the official API support this?"
hthgihwaymonk 34 Posted April 3, 2024 Posted April 3, 2024 (edited) you'll want to look at the `emby/Users/New` endpoint and in the payload include at least - "CopyFromUserId": "{specified user}", "UserCopyOptions": [ "UserPolicy" ] Edited April 3, 2024 by hthgihwaymonk 1
slove 0 Posted April 3, 2024 Author Posted April 3, 2024 1 hour ago, hthgihwaymonk said: you'll want to look at the `emby/Users/New` endpoint and in the payload include at least - "CopyFromUserId": "{specified user}", "UserCopyOptions": [ "UserPolicy" ] Thank you very much for your response. I know how to create users, open-source specified copying of specified user policies, but there is no copying of user configurations.
hthgihwaymonk 34 Posted April 3, 2024 Posted April 3, 2024 what type of configurations are you wanting to copy ?
Happy2Play 9780 Posted April 3, 2024 Posted April 3, 2024 I will guess the example is just not showing you both options. So add "UserConfiguration" Enum UserCopyOptions (emby.media) 1
slove 0 Posted April 3, 2024 Author Posted April 3, 2024 22 minutes ago, Happy2Play said: I will guess the example is just not showing you both options. So add "UserConfiguration" Enum UserCopyOptions (emby.media) { "Name": "string", "CopyFromUserId": "d6394c9ad8b14e77b458bff6df92176c", "UserCopyOptions": [ "UserPolicy" ],[ "UserConfiguration" ] } I don't know what the format of UserConfiguration is.
bakes82 167 Posted April 3, 2024 Posted April 3, 2024 So use the UI and look at the post call it pretty much tells you what you need to do: { "Name": "string", "CopyFromUserId": "string", "UserCopyOptions": [ "UserPolicy", "UserConfiguration" ] }
Happy2Play 9780 Posted April 3, 2024 Posted April 3, 2024 8 minutes ago, slove said: { "Name": "string", "CopyFromUserId": "d6394c9ad8b14e77b458bff6df92176c", "UserCopyOptions": [ "UserPolicy" ],[ "UserConfiguration" ] } I don't know what the format of UserConfiguration is. I just tested this { "Name": "NEW", "CopyFromUserId": "{myuserid}", "UserCopyOptions": [ "UserConfiguration", "UserPolicy" ] }
slove 0 Posted April 3, 2024 Author Posted April 3, 2024 3 minutes ago, Happy2Play said: I just tested this { "Name": "NEW", "CopyFromUserId": "{myuserid}", "UserCopyOptions": [ "UserConfiguration", "UserPolicy" ] } { "Name": "NEW", "CopyFromUserId": "d6394c9ad8b14e77b458bff6df92176c", "UserCopyOptions": [ "UserConfiguration", "UserPolicy" ] }This error message translates to: "Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."
slove 0 Posted April 3, 2024 Author Posted April 3, 2024 3 minutes ago, slove said: Emby Server 4.8.0.56
Happy2Play 9780 Posted April 3, 2024 Posted April 3, 2024 21 minutes ago, slove said: Emby Server 4.8.0.56 Is there a reason you are on what I believe is an obsolete beta version?
slove 0 Posted April 5, 2024 Author Posted April 5, 2024 On 4/4/2024 at 2:40 AM, hthgihwaymonk said: what type of configurations are you wanting to copy ? Thank you very much for your response
slove 0 Posted April 5, 2024 Author Posted April 5, 2024 On 4/4/2024 at 3:49 AM, Happy2Play said: Is there a reason you are on what I believe is an obsolete beta version? thanks for you help
slove 0 Posted April 6, 2024 Author Posted April 6, 2024 8 hours ago, Luke said: Hi, have you updated to the latest build? There is a question, create a new user, copy the user policy and configuration from the specified user, what is the minimum version supported, what is the format? { "Name": "NEW", "CopyFromUserId": "d6394c9ad8b14e77b458bff6df92176c", "UserCopyOptions": [ "UserConfiguration", "UserPolicy" ] } or { "Name": "NEW", "CopyFromUserId": "d6394c9ad8-b14e-77b4-58bf-f6df92176c", "UserCopyOptions": [ "UserConfiguration", "UserPolicy" ] } Which is correct
Happy2Play 9780 Posted April 6, 2024 Posted April 6, 2024 Did you update to current release/current beta? Or are you still on old beta 4.8.0.56? But I would say what does the userid look like via the api when you query that user?
slove 0 Posted April 6, 2024 Author Posted April 6, 2024 (edited) My server is Arm64 (aarch64), I chose docker and installed the version is 4.8.0.56, not sure the latest version supports arm64, so, I didn't upgrade Edited April 6, 2024 by slove
slove 0 Posted April 6, 2024 Author Posted April 6, 2024 16 minutes ago, Happy2Play said: Did you update to current release/current beta? Or are you still on old beta 4.8.0.56? But I would say what does the userid look like via the api when you query that user? My server is Arm64 (aarch64), I chose docker and installed the version is 4.8.0.56, not sure the latest version supports arm64, so, I didn't upgrade
Happy2Play 9780 Posted April 6, 2024 Posted April 6, 2024 3 minutes ago, slove said: My server is Arm64 (aarch64), I chose docker and installed the version is 4.8.0.56, not sure the latest version supports arm64, so, I didn't upgrade Don't really know these platforms Emby Server for Docker Release 4.8.3.0 · MediaBrowser/Emby.Releases (github.com)
Luke 42077 Posted April 6, 2024 Posted April 6, 2024 57 minutes ago, slove said: My server is Arm64 (aarch64), I chose docker and installed the version is 4.8.0.56, not sure the latest version supports arm64, so, I didn't upgrade HI, the latest version does support aarch64.
slove 0 Posted April 6, 2024 Author Posted April 6, 2024 22 minutes ago, Luke said: HI, the latest version does support aarch64. create a new user using the API, copy the user policy and configuration from the specified user, what is the minimum version supported
Luke 42077 Posted April 6, 2024 Posted April 6, 2024 50 minutes ago, slove said: create a new user using the API, copy the user policy and configuration from the specified user, what is the minimum version supported That was added during 4.7 development. I don't remember exactly which 4.7.X version it was. Probably around 4.7.9.
slove 0 Posted April 10, 2024 Author Posted April 10, 2024 On 4/6/2024 at 2:03 PM, Luke said: That was added during 4.7 development. I don't remember exactly which 4.7.X version it was. Probably around 4.7.9. thanks
Wane2506 1 Posted November 18, 2024 Posted November 18, 2024 hii, i want to create user emby via api , The user has been successfully created, but cannot apply the password. does the api not support enforcing passwords? is there any error in my configuration. # Step 1: Create the user in Emby response = requests.post( f"{EMBY_URL}/emby/Users/New", headers=EMBY_HEADER, json={ "Name": username, "IsAdministrator": False, "IsHidden": True } ) logging.info(f"Emby API response status code (User Creation): {response.status_code}") logging.info(f"Emby API response body (User Creation): {response.text}") if response.status_code == 200: user_id = get_user_id(username) if user_id: # Step 2: Set the user's password try: password_response = requests.post( f"{EMBY_URL}/emby/Users/{user_id}/Password", headers=EMBY_HEADER, json={"CurrentPassword": "", "NewPassword": password} ) password_response.raise_for_status() logging.info(f"Password set successfully for user '{username}'.") except Exception as e: logging.error(f"Error setting password for '{username}': {e}") await update.message.reply_text(f"Failed to set password for '{username}'.") return # Step 3: Update user configuration if password was successfully set try: config_response = requests.post( f"{EMBY_URL}/emby/Users/{user_id}/Policy", headers=EMBY_HEADER, json={ "IsAdministrator": False, "IsHidden": False, "IsHiddenRemotely": True, "IsHiddenFromUnusedDevices": False, "IsDisabled": False, "LockedOutDate": 0, "AllowTagOrRating": False, "BlockedTags": [], "IsTagBlockingModeInclusive": False, "IncludeTags": [], "EnableUserPreferenceAccess": True, "AccessSchedules": [], "BlockUnratedItems": [], "EnableRemoteControlOfOtherUsers": False, "EnableSharedDeviceControl": True, "EnableRemoteAccess": True, "EnableLiveTvManagement": True, "EnableLiveTvAccess": True, "EnableMediaPlayback": True, "EnableAudioPlaybackTranscoding": True, "EnableVideoPlaybackTranscoding": True, "EnablePlaybackRemuxing": True, "EnableContentDeletion": False, "RestrictedFeatures": [], "EnableContentDeletionFromFolders": [], "EnableContentDownloading": True, "EnableSubtitleDownloading": True, "EnableSubtitleManagement": False, "EnableSyncTranscoding": True, "EnableMediaConversion": True, "EnabledChannels": [], "EnableAllChannels": True, "EnabledFolders": [], "EnableAllFolders": True, "InvalidLoginAttemptCount": 0, "EnablePublicSharing": True, "RemoteClientBitrateLimit": 0, "ExcludedSubFolders": [], "SimultaneousStreamLimit": 0, "EnabledDevices": [], "EnableAllDevices": True, "AllowCameraUpload": True, "AllowSharingPersonalItems": False } ) config_response.raise_for_status() logging.info(f"Configuration updated successfully for user '{username}'.") except Exception as e: logging.error(f"Error updating configuration for '{username}': {e}") await update.message.reply_text(f"Failed to update configuration for '{username}'.") return
Wane2506 1 Posted November 18, 2024 Posted November 18, 2024 Respon api {"Name":"aaa12","ServerId":"187e8c799f59462ebeb0f4d84b9b6a0e","Prefix":"A","DateCreated":"2024-11-18T06:54:14.1435392Z","Id":"f354199ebd394f428da69fcceeea22a2","HasPassword":false,"HasConfiguredPassword":false,"Configuration":{"PlayDefaultAudioTrack":true,"DisplayMissingEpisodes":false,"SubtitleMode":"Smart","OrderedViews":[],"LatestItemsExcludes":[],"MyMediaExcludes":[],"HidePlayedInLatest":true,"HidePlayedInMoreLikeThis":false,"HidePlayedInSuggestions":false,"RememberAudioSelections":true,"RememberSubtitleSelections":true,"EnableNextEpisodeAutoPlay":true,"ResumeRewindSeconds":0,"IntroSkipMode":"ShowButton","EnableLocalPassword":false},"Policy":{"IsAdministrator":false,"IsHidden":false,"IsHiddenRemotely":true,"IsHiddenFromUnusedDevices":false,"IsDisabled":false,"LockedOutDate":0,"AllowTagOrRating":false,"BlockedTags":[],"IsTagBlockingModeInclusive":false,"IncludeTags":[],"EnableUserPreferenceAccess":true,"AccessSchedules":[],"BlockUnratedItems":[],"EnableRemoteControlOfOtherUsers":false,"EnableSharedDeviceControl":true,"EnableRemoteAccess":true,"EnableLiveTvManagement":true,"EnableLiveTvAccess":true,"EnableMediaPlayback":true,"EnableAudioPlaybackTranscoding":true,"EnableVideoPlaybackTranscoding":true,"EnablePlaybackRemuxing":true,"EnableContentDeletion":false,"RestrictedFeatures":[],"EnableContentDeletionFromFolders":[],"EnableContentDownloading":true,"EnableSubtitleDownloading":true,"EnableSubtitleManagement":false,"EnableSyncTranscoding":true,"EnableMediaConversion":true,"EnabledChannels":[],"EnableAllChannels":true,"EnabledFolders":[],"EnableAllFolders":true,"InvalidLoginAttemptCount":0,"EnablePublicSharing":true,"RemoteClientBitrateLimit":0,"ExcludedSubFolders":[],"SimultaneousStreamLimit":0,"EnabledDevices":[],"EnableAllDevices":true,"AllowCameraUpload":true,"AllowSharingPersonalItems":false},"HasConfiguredEasyPassword":false}
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now