Page tree
Skip to end of metadata
Go to start of metadata

Book

Book a class, requires Basic HTTP-Auth.

Request

Parameters

Name

Required

Value

Description

Data type

Type

Yes

type=ordinary

Filter by type of booking

ordinary, waitinglist

Activityid

Yes

activityid=34

Class ID

 

Note: type=waitinglist is not allowed on debitable activities that are debitable. 

Example:

POST:APIURL/activitybookings.xml
apikey=338934897438
type=ordinary
activityid=34

Response

The same responses as in GET, see below

Lista bokningar tillhörande autentiserad person

Hämta bokningar tillhörande den inloggade användaren. Detta anrop kräver Basic HTTP-autentisering

Anrop

HTTP GET till /activitybookings

Filter

Name

Value

Description

Date type

Default

type

type=ordinary

Filter by type of booking

ordinary or waitinglist

ordinary

startdate

startdate=2015-02-02

Will only return bookings that start after the specified date

Date

today

enddate

enddate=2015-02-02

Will only return bookings that start before the specified date

Date

Om 14 dagar

Example:

GET:APIURL/activitybookings.xml?apikey=338934897438&type=ordinary

Response

Tag

Format

Example

Description

activitybookings

 

<activitybookings>

activitynbookings tag encloses the bookings

startdate

Date

<startdate>2015-12-24</startdate>

Specifies the day the first booking starts

enddate

date

<enddate>2015-12-24</enddate>

Specifies the day the last booking starts

activitybooking

 

 

Represents a booking

id

ID

<id>12</id>

Unique ID

activityid

ID

<activityid>16083</activityid>

The ID of the class that a booking is booked in

activity <activity># see groupactivities</activity>The bookings class. See classes for more details.

type

 

Type of booking

businessunit

 

<businessunit><id>11</id><name>Main Street Gym</name></businessunit>

The facility/business unit that owns the booking

start

Time

<start><timepoint><timestamp>1332442800</timestamp><datetime>2015-03-22 20:00</datetime><date>2015-03-22</date><time>20:00</time></timepoint></start>

Start time for the booking

end

Time

<end><timepoint><timestamp>1332446400</timestamp><datetime>2015-03-22 21:00</datetime><date>2015-03-22</date><time>21:00</time></timepoint></end>

End time for the booking

resources

 

<resources>

Connected resources

resource

 

<resource>

Resource

id

ID

<id>6</id>

Resource ID

name

String

<name>Marge Simpson</name>

Resource name

type

String

<type>Staff</type>

Resource type

employee

 

<employee><id>3851</id><name>Marge Simpson</name></employee>

If a staff member is connected to the resource

issubstituteBoolean

<issubstitute>true</issubstitute>

If the staff resource is a subsitute

product

 

<product>#see products#</product>

The product used for the booking. For more details see products.

personidID<personid>7567</personid>The ID of the booked customer
orderidID<orderid>555</orderid>The order ID for that the booking belongs to

waitinglistsize

Integer

<waitinglistsize>3</waitinglistsize>

The number of people on the waiting list, no size limit.

waitinglistpositionInteger

<waitinglistposition>2</waitinglistposition>

A specific place in the waiting list
<activitybookings>
   <startdate>2015-12-24</startdate>
   <enddate>2015-12-24</enddate>
   <activitybooking>
      <id>24353</id>
      <activityid>16083</activityid>
      <activity>#see groupactivities#</activity>
      <businessunit>
          <id>11</id>
          <name>Main Street Gym</name>
      </businessunit>
      <type>ordinary</type>
      <start>
      <timepoint>
        <timestamp>1332442800</timestamp>
        <datetime>2015-03-22 20:00</datetime>
        <date>2015-03-22</date>
        <time>20:00</time>
      </timepoint>
    </start>
    <end>
      <timepoint>
        <timestamp>1332446400</timestamp>
        <datetime>2015-03-22 21:00</datetime>
        <date>2015-03-22</date>
        <time>21:00</time>
      </timepoint>
    </end>
    <resources>
      <resource>
        <id>6</id>
        <name>Marge Simpson</name>
        <type>Staff</type>
        <employee>
          <id>3851</id>
          <name>Marge Simpson</name>
        </employee>
		<issubstitute>true</issubstitute>
      </resource>
    </resources>
    <product>#see products#</product>
    <personid>7567</personid>
    <waitinglistsize>3</waitinglistsize>
    <waitinglistposition>2</waitinglistposition>
  </activitybooking>
   ...
</activitybookings>

List bookings for multiple people

Retrieve bookings for several people simultaneously. This request requires API level 3. Please note that the response contains less information than a similar response for a logged on user.

Request

HTTP GET to /activitybookings

Filter

Name

Value

Description

Data type

Default

type

type=ordinary

Filter by type of booking

ordinary or waitinglist

ordinary

startdate

startdate=2015-02-02

Returns only bookings that start after a specified date. A maximum of 14 days before the end date.

Date

today

enddate

enddate=2015-02-02

Returns only bookings that start prior to a specified date. No more than 14 days after start date.

Date

In 14 days

personidspersonids=1,2,3Return bookings for the specified peopleID-list 

Example:

GET:APIURL/activitybookings.xml?apikey=338934897438&type=ordinary&personids=1,2,3

Response

Tag

Format

Example

Description

activitybookings

 

<activitybookings>

Bookings tag encloses the bookings

startdate

Date

<startdate>2015-12-24</startdate>

Specifies the date that the first booking in the list starts on

enddate

Date

<enddate>2015-12-24</enddate>

Specifies the date the last booking in the list starts on

activitybooking

 

 

Represents a booking

id

ID

<id>12</id>

Unique ID

activityid

ID

<activityid>16083</activityid>

The ID of the class that the person is booked in

type

 

Type of booking

businessunit

 

<businessunit><id>11</id><name>Main Street Gym</name></businessunit>

The facility/business unit that the booking belongs to

start

Time

<start><timepoint><timestamp>1332442800</timestamp><datetime>2015-03-22 20:00</datetime><date>2015-03-22</date><time>20:00</time></timepoint></start>

The start time of the booking

end

Tidpunkt

<end><timepoint><timestamp>1332446400</timestamp><datetime>2015-03-22 21:00</datetime><date>2015-03-22</date><time>21:00</time></timepoint></end>

The end time of the booking

personidID<personid>7567</personid>The ID of the customer
orderidID<orderid>555</orderid>The ID of the order that the booking belongs to

waitinglistsize

Integer

<waitinglistsize>3</waitinglistsize>

The number of people on the waiting list, no size limit.

waitinglistpositionHeltal

<waitinglistposition>2</waitinglistposition>

A specific place in the waiting list
<activitybookings>
   <startdate>2015-12-24</startdate>
   <enddate>2015-12-24</enddate>
   <activitybooking>
      <id>24353</id>
      <activityid>16083</activityid>
      <businessunit>
          <id>11</id>
          <name>Main Street Gym</name>
      </businessunit>
      <type>ordinary</type>
      <start>
      <timepoint>
        <timestamp>1332442800</timestamp>
        <datetime>2015-03-22 20:00</datetime>
        <date>2015-03-22</date>
        <time>20:00</time>
      </timepoint>
    </start>
    <end>
      <timepoint>
        <timestamp>1332446400</timestamp>
        <datetime>2015-03-22 21:00</datetime>
        <date>2015-03-22</date>
        <time>21:00</time>
      </timepoint>
    </end>
    <personid>7567</personid>
    <waitinglistsize>3</waitinglistsize>
    <waitinglistposition>2</waitinglistposition>
  </activitybooking>
   ...
</activitybookings>

Cancel

Request, requires HTTP-auth

HTTP DELETE to /activitybookings/{id}

Parameters

Name

Required

Value

Description

Data type

type

Yes

type=ordinary

The type of booking to be cancelled.

ordinary, waitinglist

Example:

DELETE:APIURL/activitybookings/25345.xml?apikey=338934897438&type=ordinary

Response

HTTP 204
No content.

Side effects

If the current class from which a cancellation is made has a active waiting list, customers from the waiting list will automatically be booked on the class until the class is full again, or the waiting list is empty. These customers are automatically notified by e-mail and/or SMS pending current configuration.

  • No labels