BokaMera.API.Host

<back to all web services

TestDateSchedule

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
POST/schedules/date/testTest date scheduleTest date schedule, only administrators are allowed to test schedules.
namespace BokaMera.API.ServiceModel.Dtos

open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations

    [<AllowNullLiteral>]
    type ExceptionText() = 
        member val Reason:String = null with get,set
        member val ReasonPublic:String = null with get,set

    [<AllowNullLiteral>]
    type AvailableTimesSum() = 
        member val From:DateTime = new DateTime() with get,set
        member val To:DateTime = new DateTime() with get,set
        member val Free:Int32 = new Int32() with get,set
        member val FreeSpots:Int32 = new Int32() with get,set
        member val ExceptionTexts:IEnumerable<ExceptionText> = null with get,set

    [<AllowNullLiteral>]
    type AvailableTimesResponse() = 
        member val CompanyId:Guid = new Guid() with get,set
        member val ServiceId:Int32 = new Int32() with get,set
        member val TimesFreeTextSingle:String = null with get,set
        member val TimesFreeTextMultiple:String = null with get,set
        member val Times:ResizeArray<AvailableTimesSum> = new ResizeArray<AvailableTimesSum>() with get,set

    [<AllowNullLiteral>]
    type AddDateScheduleDate() = 
        ///<summary>
        ///The from date for the timeslot
        ///</summary>
        [<ApiMember(Description="The from date for the timeslot", IsRequired=true)>]
        member val From:DateTime = new DateTime() with get,set

        ///<summary>
        ///The to date for the timeslot
        ///</summary>
        [<ApiMember(Description="The to date for the timeslot", IsRequired=true)>]
        member val To:DateTime = new DateTime() with get,set

    [<ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)>]
    [<ValidateRequest(Validator="IsAuthenticated")>]
    [<AllowNullLiteral>]
    type TestDateSchedule() = 
        ///<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.")>]
        member val CompanyId:Nullable<Guid> = new Nullable<Guid>() with get,set

        ///<summary>
        ///The dates for the schedule. This is the actual timeslots.
        ///</summary>
        [<ApiMember(Description="The dates for the schedule. This is the actual timeslots.", IsRequired=true)>]
        member val ScheduleDates:ResizeArray<AddDateScheduleDate> = new ResizeArray<AddDateScheduleDate>() with get,set

        ///<summary>
        ///From what datetime to show available times
        ///</summary>
        [<ApiMember(DataType="dateTime", Description="From what datetime to show available times", IsRequired=true, ParameterType="query")>]
        member val From:DateTime = new DateTime() with get,set

        ///<summary>
        ///To what datetime to show available times
        ///</summary>
        [<ApiMember(DataType="dateTime", Description="To what datetime to show available times", IsRequired=true, ParameterType="query")>]
        member val To:DateTime = new DateTime() with get,set

        ///<summary>
        ///The Service Duration
        ///</summary>
        [<ApiMember(Description="The Service Duration")>]
        member val ServiceId:Nullable<Int32> = new Nullable<Int32>() with get,set

F# TestDateSchedule 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.

POST /schedules/date/test HTTP/1.1 
Host: testapi.bokamera.se 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<TestDateSchedule 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>
  <From>0001-01-01T00:00:00</From>
  <ScheduleDates>
    <AddDateScheduleDate>
      <From>0001-01-01T00:00:00</From>
      <To>0001-01-01T00:00:00</To>
    </AddDateScheduleDate>
  </ScheduleDates>
  <ServiceId>0</ServiceId>
  <To>0001-01-01T00:00:00</To>
</TestDateSchedule>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<AvailableTimesResponse 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>
  <ServiceId>0</ServiceId>
  <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>
  <TimesFreeTextMultiple>String</TimesFreeTextMultiple>
  <TimesFreeTextSingle>String</TimesFreeTextSingle>
</AvailableTimesResponse>