| Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
| GET | /tags | Get tags for the company | Returns tags for the current company, optionally filtered by scope and active status. |
|---|
using System;
using System.IO;
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.Enums;
namespace BokaMera.API.ServiceModel.Dtos
{
public partial class AccessKeyTypeResponse
{
public virtual int Id { get; set; }
public virtual string KeyType { get; set; }
public virtual string Description { get; set; }
}
[ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)]
[ValidateRequest("IsAuthenticated")]
public partial class TagQuery
{
///<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.")]
public virtual Guid? CompanyId { get; set; }
///<summary>
///Filter by tag scope. 0 = Booking, 1 = Customer.
///</summary>
[ApiMember(Description="Filter by tag scope. 0 = Booking, 1 = Customer.")]
public virtual TagScope? Scope { get; set; }
///<summary>
///Filter by active status. If not provided, only active tags are returned.
///</summary>
[ApiMember(Description="Filter by active status. If not provided, only active tags are returned.")]
public virtual bool? Active { get; set; }
///<summary>
///Number of records to skip
///</summary>
[ApiMember(Description="Number of records to skip")]
public virtual int? Skip { get; set; }
///<summary>
///Number of records to take
///</summary>
[ApiMember(Description="Number of records to take")]
public virtual int? Take { get; set; }
///<summary>
///Sort field
///</summary>
[ApiMember(Description="Sort field")]
public virtual string OrderBy { get; set; }
}
}
namespace BokaMera.API.ServiceModel.Enums
{
public enum TagScope
{
Booking,
Customer,
}
}
namespace ServiceStack
{
[DataContract]
public partial class QueryResponse<T>
{
[DataMember(Order=1)]
public virtual int Offset { get; set; }
[DataMember(Order=2)]
public virtual int Total { get; set; }
[DataMember(Order=3)]
public virtual List<AccessKeyTypeResponse> Results { get; set; } = [];
[DataMember(Order=4)]
public virtual Dictionary<string, string>? Meta { get; set; }
[DataMember(Order=5)]
public virtual ResponseStatus? ResponseStatus { get; set; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /tags HTTP/1.1 Host: api.bookmore.com Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"Offset":0,"Total":0,"Results":[{"Id":0,"Name":"String","Scope":0,"Color":"String","SortOrder":0,"Active":false,"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}],"Meta":{"String":"String"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}