| GET | /user/{userId}/authorize | Get user if exists and is not disabled |
|---|
import Foundation
import ServiceStack
public class GetUserAuth : Codable
{
/**
* User's UserID
*/
// @ApiMember(Description="User's UserID", IsRequired=true)
public var userId:String
required public init(){}
}
public class GetUserAuthResponse : List<Auth>
{
required public init(){ super.init() }
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
}
}
public class Auth : Codable
{
/**
* Brand Trigram
*/
// @ApiMember(Description="Brand Trigram", IsRequired=true)
public var brand:String
/**
* List of Pos Group - in case of internal user
*/
// @ApiMember(Description="List of Pos Group - in case of internal user")
public var posGroups:[Int] = []
/**
* Pos Code - in case of external users
*/
// @ApiMember(Description="Pos Code - in case of external users")
public var posCode:String
/**
* List of user roles
*/
// @ApiMember(Description="List of user roles", IsRequired=true)
public var roles:[String] = []
required public init(){}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /user/{userId}/authorize HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <ArrayOfAuth xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Security.ServiceModel" />