BokaMera.API.Host

<back to all web services

NextFreeTimeQuery

The following routes are available for this service:
GET/services/{ServiceId}/nextfreetimeGet the next available time for the serviceGet the next available time for the service
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 AvailableTimesResourceTypeResource
            '''<Summary>
            '''The resourcetype id
            '''</Summary>
            <ApiMember(Description:="The resourcetype id")>
            Public Overridable Property ResourceTypeId As Integer

            '''<Summary>
            '''The resource id
            '''</Summary>
            <ApiMember(Description:="The resource id")>
            Public Overridable Property ResourceId As Integer
        End Class

        Public Partial Class AvailableTimesResponse
            Public Sub New()
                Times = New List(Of AvailableTimesSum)
            End Sub

            Public Overridable Property CompanyId As Guid
            Public Overridable Property ServiceId As Integer
            Public Overridable Property TimesFreeTextSingle As String
            Public Overridable Property TimesFreeTextMultiple As String
            Public Overridable Property Times As List(Of AvailableTimesSum)
        End Class

        Public Partial Class AvailableTimesSum
            Implements IAvailableTime
            Public Overridable Property From As Date
            Public Overridable Property To As Date
            Public Overridable Property Free As Integer
            Public Overridable Property FreeSpots As Integer
            Public Overridable Property ExceptionTexts As IEnumerable(Of ExceptionText)
        End Class

        Public Partial Class ExceptionText
            Public Overridable Property Reason As String
            Public Overridable Property ReasonPublic As String
        End Class

        Public Partial Class NextFreeTimeQuery
            Implements IInterval
            Public Sub New()
                Resources = New List(Of AvailableTimesResourceTypeResource)
            End Sub

            '''<Summary>
            '''Company to show available time for
            '''</Summary>
            <ApiMember(Description:="Company to show available time for", ParameterType:="query")>
            Public Overridable Property CompanyId As Nullable(Of Guid)

            '''<Summary>
            '''Service id
            '''</Summary>
            <ApiMember(Description:="Service id", IsRequired:=true, ParameterType:="path")>
            Public Overridable Property ServiceId As Integer

            '''<Summary>
            '''From what datetime to search available times
            '''</Summary>
            <ApiMember(DataType:="dateTime", Description:="From what datetime to search available times", IsRequired:=true, ParameterType:="query")>
            Public Overridable Property From As Date

            '''<Summary>
            '''To what datetime to show available times. Optional, if no datetime is set it will search one year
            '''</Summary>
            <ApiMember(DataType:="dateTime", Description:="To what datetime to show available times. Optional, if no datetime is set it will search one year", IsRequired:=true, ParameterType:="query")>
            Public Overridable Property To As Date

            '''<Summary>
            '''Here you can select one of the resource in each resource type connected to the service, if none is selected it will show available times for all
            '''</Summary>
            <ApiMember(Description:="Here you can select one of the resource in each resource type connected to the service, if none is selected it will show available times for all", ParameterType:="query")>
            Public Overridable Property Resources As List(Of AvailableTimesResourceTypeResource)

            '''<Summary>
            '''Here you select number of resources to book (in each resource type). Default is 1.
            '''</Summary>
            <ApiMember(Description:="Here you select number of resources to book (in each resource type). Default is 1.", ParameterType:="query")>
            Public Overridable Property NumberOfResources As Integer

            '''<Summary>
            '''The duration you want to book. Needs to withing the service Min and Max. If not set it will use the service duration
            '''</Summary>
            <ApiMember(DataType:="bool", Description:="The duration you want to book. Needs to withing the service Min and Max. If not set it will use the service duration", ParameterType:="query")>
            Public Overridable Property Duration As Nullable(Of Integer)

            '''<Summary>
            '''If you want to include the connected resource types and resources
            '''</Summary>
            <ApiMember(Description:="If you want to include the connected resource types and resources", ParameterType:="query")>
            Public Overridable Property ShowPerResource As Boolean
        End Class
    End Namespace
End Namespace

VB.NET NextFreeTimeQuery 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 /services/{ServiceId}/nextfreetime HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"ServiceId":0,"TimesFreeTextSingle":"String","TimesFreeTextMultiple":"String","Times":[{"Free":0,"FreeSpots":0}]}