Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Table of contents

Table of Contents



Info

Before using this, please refer to Account API functions for login and API explanations.




Get member subscription history

Changes the logged in users' email address

Info
iconfalse

Status
colourYellow
titleGET
 /user/history/subscriptions


Warning

Account privilege restriction:

  • Root
  • Club manager
  • Administrator / Reception
  • Member


Request

Expand


Request

Endpoint: /user/history/subscriptions

Method:

Status
colourYellow
titleGET

Only logged in:

Status
colourGreen
titleYES

Account privilege restriction:
  • Root
  • Club manager
  • Administrator / Reception
  • Member

Headers:

Expand


Header nameValue
X-Requested-With
XMLHttpRequest
X-Auth-TokenToken obtained from Login endpoint



Parameters:

Expand


ParameterRequiredTypeDescription
user_id
Status
subtletrue
colourRed
titleNO
String

User id for which to get the information

Ignored if privilege is member and will only return data for current logged in member

sidx

Status
subtletrue
colourRed
titleNO

Default: name

String

Sort index for which to sort the records:

  • name - Name of the subscription
  • start_date - Subscription start date
  • end_date - Subscription end date
  • price - Subscription price
  • type - Subscription type
  • checkins - Subscription check-ins number
  • entrances - Subscription group class entrances number
  • invites - Subscription invites number
  • min_hour - Subscription minimum access hour
  • max_hour - Subscription maximum access hour
  • limited_stock - Subscription limited stock
  • availability - Subscription availability
sord

Status
subtletrue
colourRed
titleNO

Default: asc

String

Sort order:

  • asc- Ascending
  • desc - Descending
limit

Status
subtletrue
colourRed
titleNO

Default: 10

IntegerNumber of records to fetch
page

Status
subtletrue
colourRed
titleNO

Default: 1

IntegerPage number
subscription_state
Status
subtletrue
colourRed
titleNO
Integer

State of the subscription:

  • 0 - Expired
  • 1 - Available
  • 2 - Not started yet
no_limit

Status
subtletrue
colourRed
titleNO

Default: false

BooleanIf set, it will ignore limit and page parameters and will fetch ALL records




Response

Expand


Response

Http Code

Response

Description

Status
colourBlue
title200


Expand


Code Block
titleSuccess response
linenumberstrue
 {
    "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

Expand
titleBase object


Object propertyDescription
rowsEach club is a row
recordsNumber of total records
pageCurrent page
totalTotal number of pages



Expand
titleRow object


Object propertyDescription
idThe ID of the subscription
cellContains the subscription data



Expand
titleCell object


Object propertyDescription
actionsThe ID of the subscriptions. Used for front end rendering in some cases
nameSubscription name
type

Type of the subscription:

  • Personal
  • Corporate
access

Where access is allowed:

<club name> (<studio>)

access_time

Time span when the subscription can be used:

<start time> - <end time>

access_type

Access type of the subscription:

  • Full access
  • Entrances
checkins

How many check-ins are left:

<left> (<initial>)

entrances

How many group class entrances are left:

<left> (<initial>)

invites

How many invites are left:

<left> (<initial>)

is_active

Shows the status of the subscription:

  • 0 - expired
  • 1 - active
  • 2 - Not started



Status
colourRed
title422


Expand


Code Block
titleError response
linenumberstrue
{
  "success": 0
}



Error