BokaMera.API.Host

<back to all web services

AvaiableTimesGroupedQuery

The following routes are available for this service:
GET/services/{ServiceId}/availabletimes/groupedGet availabletimes for the serviceGet availabletimes for the service and it's connected schedules
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 AvaiableTimesGroupedQuery
            Implements IInterval
            Public Sub New()
                Resources = New List(Of AvailableTimesResourceTypeResource)
            End Sub

            '''<Summary>
            '''Company to show services for
            '''</Summary>
            <ApiMember(Description:="Company to show services 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 show available times
            '''</Summary>
            <ApiMember(DataType:="dateTime", Description:="From what datetime to show available times", IsRequired:=true, ParameterType:="query")>
            Public Overridable Property From As Date

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

            '''<Summary>
            '''Here you can select one of the resource in each resourcetype 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 resourcetype 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 resourcetype). Default is 1.
            '''</Summary>
            <ApiMember(Description:="Here you select number of resources to book (in each resourcetype). Default is 1.", ParameterType:="query")>
            Public Overridable Property NumberOfResources As Integer

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

            '''<Summary>
            '''Both start and time time should be inside test interval. Default is false which means only start time needs to be inside.
            '''</Summary>
            <ApiMember(DataType:="bool", Description:="Both start and time time should be inside test interval. Default is false which means only start time needs to be inside.", ParameterType:="query")>
            Public Overridable Property InsideSearchInterval As Boolean

            '''<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)

            Public Overridable Property ResponseStatus As ResponseStatus
        End Class

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

            Public Overridable Property Group As Date
            Public Overridable Property Times As List(Of AvailableTimesSum)
        End Class

        Public Partial Class AvailableTimesGroupedDatesResponse
            Public Sub New()
                Items = New List(Of AvailableTimesGroupedDates)
            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 Items As List(Of AvailableTimesGroupedDates)
        End Class

        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 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
    End Namespace
End Namespace

VB.NET AvaiableTimesGroupedQuery DTOs

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

HTTP + XML

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

GET /services/{ServiceId}/availabletimes/grouped HTTP/1.1 
Host: api.bokamera.se 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<AvailableTimesGroupedDatesResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <Items>
    <AvailableTimesGroupedDates>
      <Group>0001-01-01T00:00:00</Group>
      <Times>
        <AvailableTimesSum>
          <ExceptionTexts i:nil="true" />
          <Free>0</Free>
          <FreeSpots>0</FreeSpots>
          <From>0001-01-01T00:00:00</From>
          <To>0001-01-01T00:00:00</To>
        </AvailableTimesSum>
      </Times>
    </AvailableTimesGroupedDates>
  </Items>
  <ServiceId>0</ServiceId>
  <TimesFreeTextMultiple>String</TimesFreeTextMultiple>
  <TimesFreeTextSingle>String</TimesFreeTextSingle>
</AvailableTimesGroupedDatesResponse>