| POST | /user/{brand}/{userId}/authorize | Create the authorization for the given external user and for the given POS Codes | The 'CreateUserAuth' API is not implemented for internal users |
|---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Richemont.Booster2.PublicApi.Security.ServiceModel
Namespace Global
Namespace Richemont.Booster2.PublicApi.Security.ServiceModel
Public Partial Class AuthRequest
Public Sub New()
roles = New List(Of Guid)
End Sub
'''<Summary>
'''POS Code (only for external users)
'''</Summary>
<ApiMember(Description:="POS Code (only for external users)", IsRequired:=true)>
Public Overridable Property posCode As String
'''<Summary>
'''Roles for users (GUIDs). E.g. '731cd7f3-a781-48bf-b43d-310273895ce2'
'''</Summary>
<ApiMember(Description:="Roles for users (GUIDs). E.g. '731cd7f3-a781-48bf-b43d-310273895ce2'", IsRequired:=true)>
Public Overridable Property roles As List(Of Guid)
End Class
Public Partial Class CreateUserAuth
Public Sub New()
authRequests = New List(Of AuthRequest)
End Sub
'''<Summary>
'''User's UserID (GUID). E.g. '731cd7f3-a781-48bf-b43d-310273895ce2'
'''</Summary>
<ApiMember(Description:="User's UserID (GUID). E.g. '731cd7f3-a781-48bf-b43d-310273895ce2'", IsRequired:=true)>
Public Overridable Property userId As String
'''<Summary>
'''Brand Trigram, e.g. CAR, IWC, VAC
'''</Summary>
<ApiMember(Description:="Brand Trigram, e.g. CAR, IWC, VAC", IsRequired:=true)>
Public Overridable Property brand As String
'''<Summary>
'''Authorization requests for the provided user
'''</Summary>
<ApiMember(Description:="Authorization requests for the provided user", IsRequired:=true)>
Public Overridable Property authRequests As List(Of AuthRequest)
End Class
Public Partial Class CreateUserAuthResponse
End Class
End Namespace
End Namespace
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.
POST /user/{brand}/{userId}/authorize HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
userId: String,
brand: String,
authRequests:
[
{
posCode: String,
roles:
[
00000000000000000000000000000000
]
}
]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
}