BokaMera.API.Host

<back to all web services

CompanyIncentiveQuery

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, bookingsupplier-administrator-read, superadmin
The following routes are available for this service:
GET/companies/{CompanyId}/incentivesIt gets either incentives which are not read or engaged by the current company/administrator.
import java.math.*
import java.util.*
import net.servicestack.client.*


@ValidateRequest(Validator="IsAuthenticated")
@ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
open class CompanyIncentiveQuery : ICompany
{
    /**
    * The company id, if empty will use the company id for the user you are logged in with.
    */
    @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.", IsRequired=true, ParameterType="path")
    var CompanyId:UUID? = null
}

open class CompanyIncentivesQueryResponse
{
    var Incentives:IList<CompanyIncentiveResponse>? = null
    var CompanyId:UUID? = null
}

open class CompanyIncentiveResponse
{
    var Id:Int? = null
    var Heading:String? = null
    var StorageUrl:String? = null
    var SuccessButtonText:String? = null
    var ActionId:Int? = null
    var InitialDelayInSeconds:Int? = null
    var MaxDisplayCount:Int? = null
    var ValidFrom:Date? = null
    var ValidTo:Date? = null
    var Action:IncentiveActionResponse? = null
    var Payload:String? = null
    @ApiMember()
    var Body:String? = null

    @ApiMember(IsRequired=true)
    var Frequency:IncentiveRecurrenceFrequency? = null

    @ApiMember(IsRequired=true)
    var InitialDeferredDays:Int? = null

    @ApiMember()
    var RecurrenceInterval:Long? = null

    @ApiMember()
    var Active:Boolean? = null

    var CompanyIds:ArrayList<UUID> = ArrayList<UUID>()
    var Criteria:ArrayList<IncentiveCriteriaDto> = ArrayList<IncentiveCriteriaDto>()
}

open class IncentiveActionResponse
{
    var Id:Int? = null
    var Description:String? = null
    var ActionType:IncentiveActionType? = null
    var Page:String? = null
    var Segment:String? = null
    var Element:String? = null
    var LicenseTypeId:Int? = null
    var SuggestedLicenseToUpgrade:LicenseTypeQueryResponse? = null
}

enum class IncentiveActionType(val value:Int)
{
    Upgrade(1),
    AddOn(2),
    Information(3),
}

open class LicenseTypeQueryResponse
{
    /**
    * The license type id
    */
    @ApiMember(Description="The license type id")
    var Id:Int? = null

    /**
    * The license type name
    */
    @ApiMember(Description="The license type name")
    var Name:String? = null

    /**
    * The license type description
    */
    @ApiMember(Description="The license type description")
    var Description:String? = null

    /**
    * If the license type is not a standard license but instead an extra license option. An example would be sending new letter license.
    */
    @ApiMember(Description="If the license type is not a standard license but instead an extra license option. An example would be sending new letter license.")
    var IsExtraLicenseOption:Boolean? = null

    /**
    * The period of notice for the license in days.
    */
    @ApiMember(Description="The period of notice for the license in days.")
    var PeriodOfNoticeDays:Int? = null

    /**
    * The license items for the license type
    */
    @ApiMember(Description="The license items for the license type")
    var Items:ArrayList<LicenseItemsResponse> = ArrayList<LicenseItemsResponse>()

    /**
    * The license prices in each country for the license type
    */
    @ApiMember(Description="The license prices in each country for the license type")
    var Prices:ArrayList<LicensePrice> = ArrayList<LicensePrice>()
}

open class LicenseItemsResponse
{
    var Id:Int? = null
    var Name:String? = null
    var AllowedItems:Int? = null
}

open class LicensePrice : BaseModel()
{
    @Ignore()
    var Country:Country? = null

    @Ignore()
    var MonthlyPayment:Boolean? = null

    @Required()
    var LicenseTypeId:Int? = null

    @Required()
    var CountryId:String? = null

    @Required()
    var Price:Int? = null

    var ModifiedDate:Date? = null
}

open class BaseModel
{
}

open class Country : BaseModel()
{
    @References(Currency.class)
    var CurrencyId:String? = null

    var CurrencyInfo:Currency? = null
    @Required()
    var Name:String? = null

    var Culture:String? = null
    var TimeZone:String? = null
    var ModifiedDate:Date? = null
    @Required()
    var Id:String? = null
}

open class Currency : BaseModel()
{
    @Required()
    var Name:String? = null

    @Required()
    var CurrencySign:String? = null

    @Required()
    var Active:Boolean? = null

    var ModifiedDate:Date? = null
    @Required()
    var Id:String? = null
}

enum class IncentiveRecurrenceFrequency(val value:Int)
{
    OneTime(1),
    Weekly(2),
    Monthly(3),
}

open class IncentiveCriteriaDto
{
    var CriteriaType:CriteriaType? = null
    var Value:String? = null
    var InvertCondition:Boolean? = null
}

enum class CriteriaType
{
    LicenseAvailability,
    SmsActivation,
    EAccountingActivation,
    CodeLockActivation,
    SocialActivation,
    OnlinePaymentActivation,
    FollowUpMessageActivation,
    RatingActivation,
}

Kotlin CompanyIncentiveQuery DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + 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: api.bookmore.com 
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>