Requires any of the roles: | bookingsupplier-administrator-write, bookingsupplier-administrator-read, superadmin |
GET | /companies/{CompanyId}/incentives | It gets either incentives which are not read or engaged by the current company/administrator. |
---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BokaMera.API.ServiceModel.Dtos
Imports BokaMera.API.ServiceModel.Db.Incentive
Imports BokaMera.API.ServiceModel.Db
Namespace Global
Namespace BokaMera.API.ServiceModel.Db
Public Partial Class BaseModel
End Class
End Namespace
Namespace BokaMera.API.ServiceModel.Db.Incentive
Public Partial Class IncentiveAction
Inherits BaseModel
Public Overridable Property Id As Integer
Public Overridable Property ActionType As IncentiveActionType
Public Overridable Property Page As String
Public Overridable Property Segment As String
Public Overridable Property Element As String
End Class
Public Enum IncentiveActionType
Upgrade = 1
AddOn = 2
Information = 3
End Enum
End Namespace
Namespace BokaMera.API.ServiceModel.Dtos
<ValidateRequest(Validator:="IsAuthenticated")>
<ApiResponse(Description:="You were unauthorized to call this service", StatusCode:=401)>
Public Partial Class CompanyIncentiveQuery
Implements ICompany
'''<Summary>
'''The company id, if empty will use the company id for the user you are logged in with.
'''</Summary>
<ApiMember(Description:="The company id, if empty will use the company id for the user you are logged in with.", IsRequired:=true, ParameterType:="path")>
Public Overridable Property CompanyId As Nullable(Of Guid)
End Class
Public Partial Class CompanyIncentiveResponse
Public Overridable Property Id As Integer
Public Overridable Property Heading As String
Public Overridable Property StorageUrl As String
Public Overridable Property SuccessButtonText As String
Public Overridable Property ActionId As Integer
Public Overridable Property InitialDelayInSeconds As Integer
Public Overridable Property MaxDisplayCount As Nullable(Of Integer)
Public Overridable Property ValidFrom As DateTimeOffset
Public Overridable Property ValidTo As DateTimeOffset
Public Overridable Property Action As IncentiveAction
Public Overridable Property Payload As String
End Class
Public Partial Class CompanyIncentivesQueryResponse
Public Overridable Property Incentives As IList(Of CompanyIncentiveResponse)
Public Overridable Property CompanyId As Guid
End Class
End Namespace
End Namespace
VB.NET CompanyIncentiveQuery DTOs
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 /companies/{CompanyId}/incentives HTTP/1.1 Host: testapi.bokamera.se Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <CompanyIncentivesQueryResponse 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> <Incentives i:nil="true" /> </CompanyIncentivesQueryResponse>