Requires any of the roles: | SystemAdministrator, Manager |
PATCH | /users/{userId} |
---|
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using Voice.Api.Authentication;
namespace Voice.Api.Authentication
{
public enum DashboardPermissions
{
ViewFiles,
ViewNotifications,
ViewSessions,
ViewEndpoints,
ViewReports,
ViewCustomers,
ViewFlows,
}
///<summary>
///Update the specified login
///</summary>
[Api(Description="Update the specified login")]
public partial class PatchUser
: IPatch
{
///<summary>
///The account IDs that this user has access to
///</summary>
[ApiMember(Description="The account IDs that this user has access to")]
public virtual List<string> AccountIds { get; set; }
///<summary>
///The ID of the user
///</summary>
[ApiMember(Description="The ID of the user")]
public virtual string UserId { get; set; }
///<summary>
///The user's first name
///</summary>
[ApiMember(Description="The user's first name")]
public virtual string FirstName { get; set; }
///<summary>
///The user's last name
///</summary>
[ApiMember(Description="The user's last name")]
public virtual string LastName { get; set; }
///<summary>
///The new password for the user (leave null to not change)
///</summary>
[ApiMember(Description="The new password for the user (leave null to not change)")]
public virtual string NewPassword { get; set; }
///<summary>
///The roles to associate with the login. Can only specify if system admin
///</summary>
[ApiMember(Description="The roles to associate with the login. Can only specify if system admin")]
public virtual List<string> Roles { get; set; }
}
public partial class UserInfo
{
public virtual string Id { get; set; }
public virtual bool IsAuthenticated { get; set; }
public virtual string FirstName { get; set; }
public virtual string LastName { get; set; }
public virtual string Name { get; set; }
public virtual string AvatarUrl { get; set; }
public virtual string EmailAddress { get; set; }
public virtual List<string> Roles { get; set; }
public virtual List<string> AccountIds { get; set; }
public virtual List<string> AccountNames { get; set; }
public virtual List<DashboardPermissions> DashboardPermissions { get; set; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PATCH /users/{userId} HTTP/1.1
Host: team.evovoice.io
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"accountIds":["String"],"userId":"String","firstName":"String","lastName":"String","newPassword":"String","roles":["String"]}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"id":"String","isAuthenticated":false,"firstName":"String","lastName":"String","name":"String","avatarUrl":"String","emailAddress":"String","roles":["String"],"accountIds":["String"],"accountNames":["String"],"dashboardPermissions":["ViewFiles"]}