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. |
---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using BokaMera.API.ServiceModel.Dtos;
using BokaMera.API.ServiceModel.Db.Incentive;
using BokaMera.API.ServiceModel.Db;
namespace BokaMera.API.ServiceModel.Db
{
public partial class BaseModel
{
}
}
namespace BokaMera.API.ServiceModel.Db.Incentive
{
public partial class IncentiveAction
: BaseModel
{
public virtual int Id { get; set; }
public virtual IncentiveActionType ActionType { get; set; }
public virtual string Page { get; set; }
public virtual string Segment { get; set; }
public virtual string Element { get; set; }
}
public enum IncentiveActionType
{
Upgrade = 1,
AddOn = 2,
Information = 3,
}
}
namespace BokaMera.API.ServiceModel.Dtos
{
[ValidateRequest("IsAuthenticated")]
[ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)]
public partial class CompanyIncentiveQuery
: 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 virtual Guid? CompanyId { get; set; }
}
public partial class CompanyIncentiveResponse
{
public virtual int Id { get; set; }
public virtual string Heading { get; set; }
public virtual string StorageUrl { get; set; }
public virtual string SuccessButtonText { get; set; }
public virtual int ActionId { get; set; }
public virtual int InitialDelayInSeconds { get; set; }
public virtual int? MaxDisplayCount { get; set; }
public virtual DateTimeOffset ValidFrom { get; set; }
public virtual DateTimeOffset ValidTo { get; set; }
public virtual IncentiveAction Action { get; set; }
public virtual string Payload { get; set; }
}
public partial class CompanyIncentivesQueryResponse
{
public virtual IList<CompanyIncentiveResponse> Incentives { get; set; }
public virtual Guid CompanyId { get; set; }
}
}
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>