| 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 .xml suffix or ?format=xml
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: application/xml
Content-Type: application/xml
Content-Length: length
<CreateUserAuth xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Security.ServiceModel">
<authRequests>
<AuthRequest>
<posCode>String</posCode>
<roles xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:guid>00000000-0000-0000-0000-000000000000</d4p1:guid>
</roles>
</AuthRequest>
</authRequests>
<brand>String</brand>
<userId>String</userId>
</CreateUserAuth>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <CreateUserAuthResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Security.ServiceModel" />