| 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. |
|---|
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; }
}
}
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 /tags HTTP/1.1 Host: api.bookmore.com Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<QueryResponseOfTagResponseWg5EthtI xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
<Offset>0</Offset>
<Total>0</Total>
<Results xmlns:d2p1="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<d2p1:TagResponse>
<d2p1:Active>false</d2p1:Active>
<d2p1:Color>String</d2p1:Color>
<d2p1:CompanyId>00000000-0000-0000-0000-000000000000</d2p1:CompanyId>
<d2p1:CreatedDate>0001-01-01T00:00:00</d2p1:CreatedDate>
<d2p1:Id>0</d2p1:Id>
<d2p1:Name>String</d2p1:Name>
<d2p1:ResponseStatus>
<ErrorCode>String</ErrorCode>
<Message>String</Message>
<StackTrace>String</StackTrace>
<Errors>
<ResponseError>
<ErrorCode>String</ErrorCode>
<FieldName>String</FieldName>
<Message>String</Message>
<Meta xmlns:d7p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d7p1:KeyValueOfstringstring>
<d7p1:Key>String</d7p1:Key>
<d7p1:Value>String</d7p1:Value>
</d7p1:KeyValueOfstringstring>
</Meta>
</ResponseError>
</Errors>
<Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</Meta>
</d2p1:ResponseStatus>
<d2p1:Scope>0</d2p1:Scope>
<d2p1:SortOrder>0</d2p1:SortOrder>
</d2p1:TagResponse>
</Results>
<Meta xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:KeyValueOfstringstring>
<d2p1:Key>String</d2p1:Key>
<d2p1:Value>String</d2p1:Value>
</d2p1:KeyValueOfstringstring>
</Meta>
<ResponseStatus>
<ErrorCode>String</ErrorCode>
<Message>String</Message>
<StackTrace>String</StackTrace>
<Errors>
<ResponseError>
<ErrorCode>String</ErrorCode>
<FieldName>String</FieldName>
<Message>String</Message>
<Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</Meta>
</ResponseError>
</Errors>
<Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</Meta>
</ResponseStatus>
</QueryResponseOfTagResponseWg5EthtI>