POST | /scheduling/class-booking | Create a Class Booking | |
---|---|---|---|
POST | /v2/{ApiKey}/club/{StoreId}/booking | (obsolete) Create a Class Booking | |
POST | /v2/{ApiKey}/club/{StoreId}/class-booking | (obsolete) Create a Class Booking |
namespace ClubReady.Core.Api.Models
open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations
[<AllowNullLiteral>]
type ApiDtoBase() =
member val ApiKey:String = null with get,set
member val StoreId:Nullable<Int32> = new Nullable<Int32>() with get,set
member val ChainId:Nullable<Int32> = new Nullable<Int32>() with get,set
[<AllowNullLiteral>]
type CreateClassBookingRequestDto() =
inherit ApiDtoBase()
member val UserId:Int32 = new Int32() with get,set
member val ScheduleId:Int32 = new Int32() with get,set
member val AllowWaitList:Boolean = new Boolean() with get,set
type RestrictedResourceType =
| Store = 0
| Chain = 1
| User = 2
| Undefined = 3
[<AllowNullLiteral>]
type CreateClassBookingRequest() =
inherit CreateClassBookingRequestDto()
///<summary>
///Api Key - grants access to resources
///</summary>
[<ApiMember(DataType="string", Description="Api Key - grants access to resources", IsRequired=true, Name="ApiKey", ParameterType="query")>]
member val ApiKey:String = null with get,set
///<summary>
///UserID
///</summary>
[<ApiMember(DataType="string", Description="UserID", IsRequired=true, Name="UserId", ParameterType="query")>]
member val UserId:Int32 = new Int32() with get,set
///<summary>
///Store ID
///</summary>
[<ApiMember(DataType="integer", Description="Store ID", IsRequired=true, Name="StoreId", ParameterType="query")>]
member val StoreId:Nullable<Int32> = new Nullable<Int32>() with get,set
///<summary>
///Class Schedule ID
///</summary>
[<ApiMember(DataType="integer", Description="Class Schedule ID", IsRequired=true, Name="ScheduleId", ParameterType="query")>]
member val ScheduleId:Int32 = new Int32() with get,set
///<summary>
///Put user in wait list when possible
///</summary>
[<ApiMember(DataType="bool", Description="Put user in wait list when possible", Name="AllowWaitList", ParameterType="query")>]
member val AllowWaitList:Boolean = new Boolean() with get,set
member val RestrictedId:Nullable<Int32> = new Nullable<Int32>() with get,set
member val RestrictedResourceType:RestrictedResourceType = new RestrictedResourceType() with get,set
[<AllowNullLiteral>]
type CreateClassBookingResponseDto() =
member val BookingId:Nullable<Int32> = new Nullable<Int32>() with get,set
member val Message:String = null with get,set
[<AllowNullLiteral>]
type CreateClassBookingResponse() =
inherit CreateClassBookingResponseDto()
member val BookingId:Nullable<Int32> = new Nullable<Int32>() with get,set
member val Message:String = null with get,set
F# CreateClassBookingRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /scheduling/class-booking HTTP/1.1
Host: clubready.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CreateClassBookingRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api.Scheduling.Model">
<ApiKey xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</ApiKey>
<ChainId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</ChainId>
<StoreId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</StoreId>
<AllowWaitList xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Scheduling.Models.Dto.Requests">false</AllowWaitList>
<ScheduleId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Scheduling.Models.Dto.Requests">0</ScheduleId>
<UserId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Scheduling.Models.Dto.Requests">0</UserId>
</CreateClassBookingRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <CreateClassBookingResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api.Scheduling.Model"> <BookingId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</BookingId> <Message xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</Message> </CreateClassBookingResponse>