| 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;
using Voice.Api.Endpoints;
namespace Voice.Api.Authentication
{
public enum DashboardPermissions
{
ViewFiles,
ViewNotifications,
ViewSessions,
ViewEndpoints,
ViewReports,
ViewCustomers,
ViewFlows,
ViewCallCenter,
}
///<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 UserManagerAccess ManagerAccess { get; set; }
public virtual List<DashboardPermissions> DashboardPermissions { get; set; }
}
}
namespace Voice.Api.Endpoints
{
public enum UserManagerAccess
{
ReadOnly,
ReadWrite,
ReadWriteDelete,
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
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: evovoice.io
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
accountIds:
[
String
],
userId: String,
firstName: String,
lastName: String,
newPassword: String,
roles:
[
String
]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
id: String,
isAuthenticated: False,
firstName: String,
lastName: String,
name: String,
avatarUrl: String,
emailAddress: String,
roles:
[
String
],
accountIds:
[
String
],
accountNames:
[
String
],
managerAccess: ReadOnly,
dashboardPermissions:
[
ViewFiles
]
}