Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
PUT | /administrators/{Id} | Update administrator on your company | If you want to update a administrator to your company. |
---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BokaMera.API.ServiceModel.Dtos
Namespace Global
Namespace BokaMera.API.ServiceModel.Dtos
Public Partial Class AddCompanyUserRolesResponse
Public Overridable Property RoleId As Guid
End Class
Public Partial Class CompanyUserQueryResponse
Public Sub New()
Roles = New List(Of CompanyUserRolesQueryResponse)
End Sub
Public Overridable Property Id As Guid
Public Overridable Property CompanyId As Guid
Public Overridable Property Firstname As String
Public Overridable Property Lastname As String
Public Overridable Property Email As String
Public Overridable Property Phone As String
Public Overridable Property WorkerId As String
Public Overridable Property ResourceId As Nullable(Of Integer)
'''<Summary>
'''The resource information connected to the administrator.
'''</Summary>
<ApiMember(Description:="The resource information connected to the administrator.")>
Public Overridable Property Resource As CompanyUserResource
'''<Summary>
'''The roles that are connected to the administrator.
'''</Summary>
<ApiMember(Description:="The roles that are connected to the administrator.")>
Public Overridable Property Roles As List(Of CompanyUserRolesQueryResponse)
Public Overridable Property Active As Boolean
Public Overridable Property Created As Date
Public Overridable Property Updated As Date
End Class
Public Partial Class CompanyUserResource
'''<Summary>
'''The resource id
'''</Summary>
<ApiMember(Description:="The resource id")>
Public Overridable Property Id As Integer
'''<Summary>
'''The resource name
'''</Summary>
<ApiMember(Description:="The resource name")>
Public Overridable Property Name As String
'''<Summary>
'''The resource status
'''</Summary>
<ApiMember(Description:="The resource status")>
Public Overridable Property Active As Boolean
'''<Summary>
'''The resource description
'''</Summary>
<ApiMember(Description:="The resource description")>
Public Overridable Property Description As String
'''<Summary>
'''The resource email
'''</Summary>
<ApiMember(Description:="The resource email")>
Public Overridable Property Email As String
'''<Summary>
'''The resource phone
'''</Summary>
<ApiMember(Description:="The resource phone")>
Public Overridable Property Phone As String
'''<Summary>
'''The resource color
'''</Summary>
<ApiMember(Description:="The resource color")>
Public Overridable Property Color As String
'''<Summary>
'''The resource image
'''</Summary>
<ApiMember(Description:="The resource image")>
Public Overridable Property ImageUrl As Uri
'''<Summary>
'''If the resource want to receive email notifications
'''</Summary>
<ApiMember(Description:="If the resource want to receive email notifications")>
Public Overridable Property EmailNotification As Boolean
'''<Summary>
'''If the resource want to receive sms notifications
'''</Summary>
<ApiMember(Description:="If the resource want to receive sms notifications")>
Public Overridable Property SMSNotification As Boolean
'''<Summary>
'''If the resource want to receive email reminders
'''</Summary>
<ApiMember(Description:="If the resource want to receive email reminders")>
Public Overridable Property EmailReminder As Boolean
'''<Summary>
'''If the resource want to receive sms reminders
'''</Summary>
<ApiMember(Description:="If the resource want to receive sms reminders")>
Public Overridable Property SMSReminder As Boolean
End Class
Public Partial Class CompanyUserRolesQueryResponse
Public Overridable Property RoleId As Guid
Public Overridable Property Name As String
Public Overridable Property Description As String
End Class
<ApiResponse(Description:="Returned if there is a validation error on the input parameters", StatusCode:=400)>
<ApiResponse(Description:="Returned if the current user is not allowed to perform the action", StatusCode:=401)>
<ValidateRequest(Validator:="IsAuthenticated")>
Public Partial Class UpdateCompanyUser
Implements ICompany
Public Sub New()
Roles = New List(Of AddCompanyUserRolesResponse)
End Sub
'''<Summary>
'''Enter the company and id for the application user, if blank company id and you are an admin, your company id will be used.
'''</Summary>
<ApiMember(Description:="Enter the company and id for the application user, if blank company id and you are an admin, your company id will be used.", ParameterType:="query")>
Public Overridable Property CompanyId As Nullable(Of Guid)
'''<Summary>
'''Enter the user id for the administrator.
'''</Summary>
<ApiMember(Description:="Enter the user id for the administrator.", IsRequired:=true, ParameterType:="path")>
Public Overridable Property Id As Guid
<ApiMember>
Public Overridable Property Firstname As String
<ApiMember>
Public Overridable Property Lastname As String
<ApiMember>
Public Overridable Property Phone As String
<ApiMember>
Public Overridable Property Email As String
<ApiMember>
Public Overridable Property ResourceId As Nullable(Of Integer)
<ApiMember>
Public Overridable Property Roles As List(Of AddCompanyUserRolesResponse)
<ApiMember>
Public Overridable Property WorkerId As Nullable(Of Integer)
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.
PUT /administrators/{Id} HTTP/1.1
Host: api.bokamera.se
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<UpdateCompanyUser xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
<Email>String</Email>
<Firstname>String</Firstname>
<Id>00000000-0000-0000-0000-000000000000</Id>
<Lastname>String</Lastname>
<Phone>String</Phone>
<ResourceId>0</ResourceId>
<Roles>
<AddCompanyUserRolesResponse>
<RoleId>00000000-0000-0000-0000-000000000000</RoleId>
</AddCompanyUserRolesResponse>
</Roles>
<WorkerId>0</WorkerId>
</UpdateCompanyUser>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <CompanyUserQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <Active>false</Active> <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId> <Created>0001-01-01T00:00:00</Created> <Email>String</Email> <Firstname>String</Firstname> <Id>00000000-0000-0000-0000-000000000000</Id> <Lastname>String</Lastname> <Phone>String</Phone> <Resource> <Active>false</Active> <Color>String</Color> <Description>String</Description> <Email>String</Email> <EmailNotification>false</EmailNotification> <EmailReminder>false</EmailReminder> <Id>0</Id> <ImageUrl i:nil="true" /> <Name>String</Name> <Phone>String</Phone> <SMSNotification>false</SMSNotification> <SMSReminder>false</SMSReminder> </Resource> <ResourceId>0</ResourceId> <Roles> <CompanyUserRolesQueryResponse> <Description>String</Description> <Name>String</Name> <RoleId>00000000-0000-0000-0000-000000000000</RoleId> </CompanyUserRolesQueryResponse> </Roles> <Updated>0001-01-01T00:00:00</Updated> <WorkerId>String</WorkerId> </CompanyUserQueryResponse>