BokaMera.API.Host

<back to all web services

TagQuery

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
GET/tagsGet tags for the companyReturns tags for the current company, optionally filtered by scope and active status.
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
import com.google.gson.annotations.*;
import com.google.gson.reflect.*;

public class dtos
{

    @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
    @ValidateRequest(Validator="IsAuthenticated")
    public static class TagQuery
    {
        /**
        * 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.")
        public UUID CompanyId = null;

        /**
        * Filter by tag scope. 0 = Booking, 1 = Customer.
        */
        @ApiMember(Description="Filter by tag scope. 0 = Booking, 1 = Customer.")
        public TagScope Scope = null;

        /**
        * Filter by active status. If not provided, only active tags are returned.
        */
        @ApiMember(Description="Filter by active status. If not provided, only active tags are returned.")
        public Boolean Active = null;

        /**
        * Number of records to skip
        */
        @ApiMember(Description="Number of records to skip")
        public Integer Skip = null;

        /**
        * Number of records to take
        */
        @ApiMember(Description="Number of records to take")
        public Integer Take = null;

        /**
        * Sort field
        */
        @ApiMember(Description="Sort field")
        public String OrderBy = null;
        
        public UUID getCompanyId() { return CompanyId; }
        public TagQuery setCompanyId(UUID value) { this.CompanyId = value; return this; }
        public TagScope getScope() { return Scope; }
        public TagQuery setScope(TagScope value) { this.Scope = value; return this; }
        public Boolean isActive() { return Active; }
        public TagQuery setActive(Boolean value) { this.Active = value; return this; }
        public Integer getSkip() { return Skip; }
        public TagQuery setSkip(Integer value) { this.Skip = value; return this; }
        public Integer getTake() { return Take; }
        public TagQuery setTake(Integer value) { this.Take = value; return this; }
        public String getOrderBy() { return OrderBy; }
        public TagQuery setOrderBy(String value) { this.OrderBy = value; return this; }
    }

    public static enum TagScope
    {
        Booking,
        Customer;
    }

    @DataContract
    public static class QueryResponse<T>
    {
        @DataMember(Order=1)
        public Integer Offset = null;

        @DataMember(Order=2)
        public Integer Total = null;

        @DataMember(Order=3)
        public ArrayList<AccessKeyTypeResponse> Results = new ArrayList<AccessKeyTypeResponse>();

        @DataMember(Order=4)
        public HashMap<String,String> Meta = null;

        @DataMember(Order=5)
        public ResponseStatus ResponseStatus = null;
        
        public Integer getOffset() { return Offset; }
        public QueryResponse<T> setOffset(Integer value) { this.Offset = value; return this; }
        public Integer getTotal() { return Total; }
        public QueryResponse<T> setTotal(Integer value) { this.Total = value; return this; }
        public ArrayList<AccessKeyTypeResponse> getResults() { return Results; }
        public QueryResponse<T> setResults(ArrayList<AccessKeyTypeResponse> value) { this.Results = value; return this; }
        public HashMap<String,String> getMeta() { return Meta; }
        public QueryResponse<T> setMeta(HashMap<String,String> value) { this.Meta = value; return this; }
        public ResponseStatus getResponseStatus() { return ResponseStatus; }
        public QueryResponse<T> setResponseStatus(ResponseStatus value) { this.ResponseStatus = value; return this; }
    }

    public static class AccessKeyTypeResponse
    {
        public Integer Id = null;
        public String KeyType = null;
        public String Description = null;
        
        public Integer getId() { return Id; }
        public AccessKeyTypeResponse setId(Integer value) { this.Id = value; return this; }
        public String getKeyType() { return KeyType; }
        public AccessKeyTypeResponse setKeyType(String value) { this.KeyType = value; return this; }
        public String getDescription() { return Description; }
        public AccessKeyTypeResponse setDescription(String value) { this.Description = value; return this; }
    }

}

Java TagQuery DTOs

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

HTTP + 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"}}}