Requires any of the roles: | SystemAdministrator, Manager |
PATCH | /users/{userId} |
---|
import Foundation
import ServiceStack
/**
* Update the specified login
*/
// @Api(Description="Update the specified login")
public class PatchUser : IPatch, Codable
{
/**
* The account IDs that this user has access to
*/
// @ApiMember(Description="The account IDs that this user has access to")
public var accountIds:[String] = []
/**
* The ID of the user
*/
// @ApiMember(Description="The ID of the user")
public var userId:String?
/**
* The user's first name
*/
// @ApiMember(Description="The user's first name")
public var firstName:String?
/**
* The user's last name
*/
// @ApiMember(Description="The user's last name")
public var lastName:String?
/**
* The new password for the user (leave null to not change)
*/
// @ApiMember(Description="The new password for the user (leave null to not change)")
public var newPassword:String?
/**
* The roles to associate with the login. Can only specify if system admin
*/
// @ApiMember(Description="The roles to associate with the login. Can only specify if system admin")
public var roles:[String] = []
required public init(){}
}
public class UserInfo : Codable
{
public var id:String?
public var isAuthenticated:Bool?
public var firstName:String?
public var lastName:String?
public var name:String?
public var avatarUrl:String?
public var emailAddress:String?
public var roles:[String] = []
public var accountIds:[String] = []
public var accountNames:[String] = []
public var dashboardPermissions:[DashboardPermissions] = []
required public init(){}
}
public enum DashboardPermissions : String, Codable
{
case ViewFiles
case ViewNotifications
case ViewSessions
case ViewEndpoints
case ViewReports
case ViewCustomers
case ViewFlows
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
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: application/json
Content-Type: application/json
Content-Length: length
{"accountIds":["String"],"userId":"String","firstName":"String","lastName":"String","newPassword":"String","roles":["String"]}
HTTP/1.1 200 OK Content-Type: application/json 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"]}