Member API guide
Flaviu Porutiu
Table of contents |
---|
Before using this, please refer to Account API functions for login and API explanations.
Get member subscription history
Gets the members' subscription history
GET /user/history/subscriptions
Account privilege restriction:
- Root
- Club manager
- Administrator / Reception
- Member
Request
Request | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Endpoint: /user/history/subscriptions | ||||||||||||||||||||||||||||||||||
Method: GET | ||||||||||||||||||||||||||||||||||
Only logged in: YES | ||||||||||||||||||||||||||||||||||
Account privilege restriction:
| ||||||||||||||||||||||||||||||||||
Headers: Click here to expand...
| ||||||||||||||||||||||||||||||||||
Parameters: Click here to expand...
|
Response
Response | ||||||||||||||||||||||||||||||||||||||||
Http Code | Response | Description | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200 | Click here to expand... Success response { "rows": [ { "id": 6, "cell": { "actions": 6, "name": "Test subscription", "type": "Corporate", "access": "Best club (Toate)", "access_time": "07:00 - 23:59", "access_type": "Full access", "checkins": "0 (0)", "entrances": "0 (0)", "invites": "0 (0)", "availability": "05/01/2018 - 06/01/2018", "is_active": 0 } }, { "id": 10, "cell": { "actions": 10, "name": "Test", "type": "Personal", "access": "Best club (Toate)", "access_time": "07:00 - 23:59", "access_type": "Full access", "checkins": "0 (0)", "entrances": "0 (0)", "invites": "0 (0)", "availability": "02/01/2018 - 04/02/2018", "is_active": 1 } } ], "records": 2, "page": 1, "total": 1 } | Success response Base object
Row object
Cell object
| ||||||||||||||||||||||||||||||||||||||
422 | Click here to expand... Error response { "success": 0 } | Error |
Get member booking history
Gets the members' booking history
GET /user/history/bookings
Account privilege restriction:
- Root
- Club manager
- Administrator / Reception
- Member
Request
Request | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Endpoint: /user/history/bookings | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Method: GET | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Only logged in: YES | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Account privilege restriction:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Headers: Click here to expand...
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Parameters: Click here to expand...
|
Response
Response | ||||||||||||||||||||||||||||||||||||||
Http Code | Response | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200 | Click here to expand... Success response { "rows": [ { "id": 9, "cell": { "actions": 9, "name": "Pilates", "date": "16/01/2018 20:00", "club_studio": "Best club / Studio X", "trainer": "John Deux", "place": "-", "status": "Neprezentare", "status_code": 4, "cancel_code": "928ebbcc-0ad8-4bea-b4c2-35a04191bd16" } }, { "id": 22, "cell": { "actions": 22, "name": "Aerobic", "date": "25/02/2018 18:00", "club_studio": "Best club / Studio X", "trainer": "John Deux", "place": "-", "status": "Activa", "status_code": 1, "cancel_code": "f25390be-fd3b-40a8-9cbf-9dc0e19b774d" } }, { "id": 24, "cell": { "actions": 24, "name": "Kickboxing", "date": "24/02/2018 15:00", "club_studio": "Best club / Studio X", "trainer": "John Deux", "place": "-", "status": "Prezentare", "status_code": 2, "cancel_code": "edefdc23-004a-49e6-a7aa-30ac7ddf0da2" } } ], "records": 3, "page": 1, "total": 1 } | Success response Base object
Row object
Cell object
| ||||||||||||||||||||||||||||||||||||
422 | Click here to expand... Error response { "success": 0 } | Error |
Getting group class info for booking
Gets the group class info along with the available places and subscriptions
GET /group_class/book/{class_id}
Account privilege restriction:
- Club manager
- Administrator / Reception
- Member
Request
Request | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Endpoint: /group_class/book/{class_id} | ||||||||||||||
Method: GET | ||||||||||||||
Only logged in: YES | ||||||||||||||
Account privilege restriction:
| ||||||||||||||
Headers: Click here to expand...
| ||||||||||||||
Parameters: Click here to expand...
|
Response
Response | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Http Code | Response | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200 | Click here to expand... Success response { "class_data": { "class_id": 48, "name": "Cycling", "trainer": "John Deux", "date": "17/05/2018 23:00:00", "studio": "new studio", "studio_pic": null, "club": "Best Club", "type": 2, "restrictions": "Full access / intrari", "can_book": true, "reason_book": "" }, "subscriptions": [ { "id": 6570, "subscription_id": 1, "user_id": 4, "start_date": "2018-05-16 00:00:00", "end_date": "2018-06-15 19:30:29", "initial_entrances": 0, "initial_invites": 0, "entrances": 0, "invites": 0, "created_at": "2018-05-17 19:30:29", "updated_at": "2018-05-17 19:30:29", "initial_checkins": 0, "checkins": 0, "corporate_id": null, "was_frozen": null, "reward_id": null, "status": 1, "type": 1, "club_id": 1, "studio_id": null, "min_hour": "07:00", "max_hour": "23:59", "name": "Test", "display": "Test (16/05/2018 - 15/06/2018)" } ], "places": { "1": "Bicicleta nr 1" } } | Success response Base object
class_data object
subscriptions object
places object
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
422 | Click here to expand... Error response { "success": 0 } | Error |
Booking a class
Saves a booking for the member
POST /group_class/book
Account privilege restriction:
- Club manager
- Administrator / Reception
- Member
Request
Request | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Endpoint: /group_class/book | ||||||||||||||||||
Method: POST | ||||||||||||||||||
Only logged in: YES | ||||||||||||||||||
Account privilege restriction:
| ||||||||||||||||||
Headers: Click here to expand...
| ||||||||||||||||||
Parameters: Click here to expand...
|
Response
Response | ||||||||
Http Code | Response | Description | ||||||
---|---|---|---|---|---|---|---|---|
200 | Click here to expand... Success response { "success":1, "message":1 } | Success response Base object
| ||||||
422 | Click here to expand... Error response { "success": 0 } | Error |
Canceling a class booking via API
Deletes a booking via API call (no redirect)
GET /book/cancel/{cancel_code}?ajax=true
Request
Request | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Endpoint: /book/cancel/{cancel_code}?ajax=true | ||||||||||
Method: GET | ||||||||||
Only logged in: NO | ||||||||||
Account privilege restriction: none | ||||||||||
Headers: Click here to expand...
| ||||||||||
Parameters: Click here to expand...
|
Response
Response | ||||||||
Http Code | Response | Description | ||||||
---|---|---|---|---|---|---|---|---|
200 | Click here to expand... Success response { "success":1, "message":"Rezervarea a fost anulata cu succes!" } | Success response Base object
| ||||||
422 | Click here to expand... Error response { "success": 0 } | Error |