BokaMera.API.Host

<back to all web services

CreateBookingLogItem

The following routes are available for this service:
POST/bookinglogAdd a new event to booking logAdd a new event to the booking of the company of the currently logged in user, only administrators are allowed to add items to event log.
import java.math.*;
import java.util.*;
import net.servicestack.client.*;

public class dtos
{

    @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
    // @ApiResponse(Description="You have too low privilegies to call this service", StatusCode=403)
    public static class CreateBookingLogItem implements ICompany
    {
        /**
        * 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;

        /**
        * The booking id
        */
        @ApiMember(Description="The booking id", IsRequired=true)
        public Integer BookingId = null;

        /**
        * The type of event
        */
        @ApiMember(Description="The type of event", IsRequired=true)
        public Integer EventTypeId = null;

        /**
        * Comments that could be added to the event log item
        */
        @ApiMember(Description="Comments that could be added to the event log item", IsRequired=true)
        public String Comments = null;

        /**
        * Then date when the event occured, leave blank if current datetime
        */
        @ApiMember(Description="Then date when the event occured, leave blank if current datetime", IsRequired=true)
        public Date Created = null;
        
        public UUID getCompanyId() { return CompanyId; }
        public CreateBookingLogItem setCompanyId(UUID value) { this.CompanyId = value; return this; }
        public Integer getBookingId() { return BookingId; }
        public CreateBookingLogItem setBookingId(Integer value) { this.BookingId = value; return this; }
        public Integer getEventTypeId() { return EventTypeId; }
        public CreateBookingLogItem setEventTypeId(Integer value) { this.EventTypeId = value; return this; }
        public String getComments() { return Comments; }
        public CreateBookingLogItem setComments(String value) { this.Comments = value; return this; }
        public Date getCreated() { return Created; }
        public CreateBookingLogItem setCreated(Date value) { this.Created = value; return this; }
    }

    public static class BookingLogQueryResponse
    {
        /**
        * The booking log id
        */
        @ApiMember(Description="The booking log id")
        public Integer Id = null;

        /**
        * The booking id
        */
        @ApiMember(Description="The booking id")
        public Integer BookingId = null;

        /**
        * The type of event
        */
        @ApiMember(Description="The type of event")
        public Integer EventTypeId = null;

        /**
        * The type of event
        */
        @ApiMember(Description="The type of event")
        public BookingLogEventTypeResponse EventType = null;

        /**
        * Comments that could be added to the event log item
        */
        @ApiMember(Description="Comments that could be added to the event log item")
        public String Comments = null;

        /**
        * The user created the event
        */
        @ApiMember(Description="The user created the event")
        public String UserName = null;

        /**
        * Then date when the event occured
        */
        @ApiMember(Description="Then date when the event occured")
        public Date Created = null;
        
        public Integer getId() { return Id; }
        public BookingLogQueryResponse setId(Integer value) { this.Id = value; return this; }
        public Integer getBookingId() { return BookingId; }
        public BookingLogQueryResponse setBookingId(Integer value) { this.BookingId = value; return this; }
        public Integer getEventTypeId() { return EventTypeId; }
        public BookingLogQueryResponse setEventTypeId(Integer value) { this.EventTypeId = value; return this; }
        public BookingLogEventTypeResponse getEventType() { return EventType; }
        public BookingLogQueryResponse setEventType(BookingLogEventTypeResponse value) { this.EventType = value; return this; }
        public String getComments() { return Comments; }
        public BookingLogQueryResponse setComments(String value) { this.Comments = value; return this; }
        public String getUserName() { return UserName; }
        public BookingLogQueryResponse setUserName(String value) { this.UserName = value; return this; }
        public Date getCreated() { return Created; }
        public BookingLogQueryResponse setCreated(Date value) { this.Created = value; return this; }
    }

    public static class BookingLogEventTypeResponse
    {
        /**
        * The event type id
        */
        @ApiMember(Description="The event type id")
        public Integer Id = null;

        /**
        * The event type name
        */
        @ApiMember(Description="The event type name")
        public String Name = null;

        /**
        * The event type description
        */
        @ApiMember(Description="The event type description")
        public String Description = null;
        
        public Integer getId() { return Id; }
        public BookingLogEventTypeResponse setId(Integer value) { this.Id = value; return this; }
        public String getName() { return Name; }
        public BookingLogEventTypeResponse setName(String value) { this.Name = value; return this; }
        public String getDescription() { return Description; }
        public BookingLogEventTypeResponse setDescription(String value) { this.Description = value; return this; }
    }

}

Java CreateBookingLogItem 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.

POST /bookinglog HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"CompanyId":"00000000-0000-0000-0000-000000000000","BookingId":0,"EventTypeId":0,"Comments":"String","Created":"0001-01-01T00:00:00"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Id":0,"BookingId":0,"EventTypeId":0,"EventType":{"Id":0,"Name":"String","Description":"String"},"Comments":"String","UserName":"String"}