Requires any of the roles: | bookingsupplier-administrator-write, bookingsupplier-administrator-read |
POST | /company/{companyId}/incentives/{incentiveId} | Logs a user interaction with an incentive. |
---|
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;
namespace BokaMera.API.ServiceModel.Db.Incentive
{
public enum EngagementType
{
Read = 1,
Success = 2,
Cancelled = 3,
CheckLater = 4,
}
}
namespace BokaMera.API.ServiceModel.Dtos
{
[ValidateRequest("IsAuthenticated")]
[ApiResponse(Description="You were unauthorized to call this service.", StatusCode=401)]
public partial class LogIncentiveEngage
{
///<summary>
///The id of the company. If not provided, the company associated with the authenticated user will be used.
///</summary>
[ApiMember(Description="The id of the company. If not provided, the company associated with the authenticated user will be used.", IsRequired=true, ParameterType="path")]
public virtual Guid CompanyId { get; set; }
///<summary>
///The id of the incentive.
///</summary>
[ApiMember(Description="The id of the incentive.", IsRequired=true, ParameterType="path")]
public virtual int IncentiveId { get; set; }
///<summary>
///Specifies the type of engagement (e.g., Read, Engaged) performed by the user on the incentive.
///</summary>
[ApiMember(Description="Specifies the type of engagement (e.g., Read, Engaged) performed by the user on the incentive.", IsRequired=true)]
public virtual EngagementType EngagementType { get; set; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /company/{companyId}/incentives/{incentiveId} HTTP/1.1
Host: testapi.bokamera.se
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
IncentiveId: 0,
EngagementType: Read
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { }