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.
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BokaMera.API.ServiceModel.Dtos

Namespace Global

    Namespace BokaMera.API.ServiceModel.Dtos

        Public Partial Class BookingLogEventTypeResponse
            '''<Summary>
            '''The event type id
            '''</Summary>
            <ApiMember(Description:="The event type id")>
            Public Overridable Property Id As Integer

            '''<Summary>
            '''The event type name
            '''</Summary>
            <ApiMember(Description:="The event type name")>
            Public Overridable Property Name As String

            '''<Summary>
            '''The event type description
            '''</Summary>
            <ApiMember(Description:="The event type description")>
            Public Overridable Property Description As String
        End Class

        Public Partial Class BookingLogQueryResponse
            '''<Summary>
            '''The booking log id
            '''</Summary>
            <ApiMember(Description:="The booking log id")>
            Public Overridable Property Id As Integer

            '''<Summary>
            '''The booking id
            '''</Summary>
            <ApiMember(Description:="The booking id")>
            Public Overridable Property BookingId As Integer

            '''<Summary>
            '''The type of event
            '''</Summary>
            <ApiMember(Description:="The type of event")>
            Public Overridable Property EventTypeId As Integer

            '''<Summary>
            '''The type of event
            '''</Summary>
            <ApiMember(Description:="The type of event")>
            Public Overridable Property EventType As BookingLogEventTypeResponse

            '''<Summary>
            '''Comments that could be added to the event log item
            '''</Summary>
            <ApiMember(Description:="Comments that could be added to the event log item")>
            Public Overridable Property Comments As String

            '''<Summary>
            '''The user created the event
            '''</Summary>
            <ApiMember(Description:="The user created the event")>
            Public Overridable Property UserName As String

            '''<Summary>
            '''Then date when the event occured
            '''</Summary>
            <ApiMember(Description:="Then date when the event occured")>
            Public Overridable Property Created As Date
        End Class

        <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 Partial Class CreateBookingLogItem
            Implements ICompany
            '''<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 Overridable Property CompanyId As Nullable(Of Guid)

            '''<Summary>
            '''The booking id
            '''</Summary>
            <ApiMember(Description:="The booking id", IsRequired:=true)>
            Public Overridable Property BookingId As Integer

            '''<Summary>
            '''The type of event
            '''</Summary>
            <ApiMember(Description:="The type of event", IsRequired:=true)>
            Public Overridable Property EventTypeId As Integer

            '''<Summary>
            '''Comments that could be added to the event log item
            '''</Summary>
            <ApiMember(Description:="Comments that could be added to the event log item", IsRequired:=true)>
            Public Overridable Property Comments As String

            '''<Summary>
            '''Then date when the event occured, leave blank if current datetime
            '''</Summary>
            <ApiMember(Description:="Then date when the event occured, leave blank if current datetime", IsRequired:=true)>
            Public Overridable Property Created As Nullable(Of Date)
        End Class
    End Namespace
End Namespace

VB.NET CreateBookingLogItem DTOs

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

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /bookinglog HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsv
Content-Type: text/jsv
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/jsv
Content-Length: length

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