New API available - faster and more powerful!

Check it out!
Perfect Gym api
Deprecated - API v1 will be switched off on 01.07.2022. Please upgrade to API v2

Agreements

This API lets you store information that user has agreed to marketing and terms and conditions agreements.

Save user agreements alt text

POST Users/Agreements

Request saves information that user has agreed to marketing and terms and conditions agreements.

Parameters

Name Type Description
userId long Required. User identifier.

Body parameters

Name Type Description
agreementIds array Required. An array of long values, each representing agreement identifier .

Response

User details.

Example request

In this example we store information that user has with id = 236 has agreed to service terms and conditions.


curl -X POST 
     -H "Authorization: Bearer $ACCESS_TOKEN" 
     -H "Content-Type: application/json" 
     -d '{
       "agreementIds" : [3]    
    }' 
    http://yoursubdomain.perfectgym.com/Api/Users/Agreements?userId=236

Example response

Status: 200 OK
{
  "elements": [
    {
      "id": 236,
      "timestamp": 448035,
      "personalId": "80010101234",
      "number": "2b7b02df-08ae-4720-a3ce-a594bfc46d47",
      "cardNumber": "",
      "firstName": "John",
      "lastName": "Fibo",
      "email": "john.fibo@perfectgym.pl",
      "emailAddressIsConfirmed": false,
      "phoneNumber": "0048123456789",
      "idCardName": "Passport",
      "idCardNumber": "ABC 123456",
      "legalGuardian": "",
      "photoUrl": "http://yoursubdomain.perfectgym.com/Api/Files/Photo?photoId=78",
      "coverPhotoUrl": "",
      "birthDate": "1978-06-01T00:00:00",
      "isForeigner": false,
      "sex": "Male",
      "newsletterAgreement": false,
      "termsAndConditionsAgreement": true,
      "address": {
        "country": "Poland",
        "city": "Warszawa",
        "postalCode": "02-962",
        "line1": "ul. Przyczolkowa 334",
        "line2": ""
      },
      "directDebit": {
        "accountNumber": "61 1090 1014 0000 0712 1981 2874",
        "ownerName": "John Fibo",
        "street": "Przyczółkowa 334",
        "cityAndPostalCode": "02-962 Warszawa",
        "documentUrl": "http://yoursubdomain.perfectgym.com/Api/Files/Files?fileId=123"
      },
      "homeClubId": 12,
      "registeredAtClubId": "",
      "isActive": true,
      "isDeleted": false,
      "contracts": [
        {
          "id": 10358,
          "timestamp": 350287,
          "signUpDate": "2016-01-26T00:00:00",
          "startDate": "2016-01-26T00:00:00",
          "cancelDate": "",
          "endDate": "",
          "isCurrent": true,
          "membership": {
            "id": 1,
            "timestamp": 349423,
            "name": "Open",
            "isActive": true,
            "isDeleted": false
          },
          "paymentPlan": {
            "id": 44,
            "timestamp": 447623,
            "name": "Open 24m",
            "isActive": true,
            "isAddOnPaymentPlan": false,
            "isDeleted": false
          },
          "discounts": [
            {
              "id": 10,
              "isActive": true,
              "name": "50%",
              "administartionFeeDiscountType": "ValueDiscount",
              "joiningFeeDiscountType": "None",
              "membershipFeeDiscountType": "PercentDiscount",
              "administartionFeeDiscountValue": 0,
              "joiningFeeDiscountValue": "",
              "membershipFeeDiscountValue": 50
            }
          ],
          "documentUrl": "http://yoursubdomain.perfectgym.com/Api/Files/Files?fileId=120",
          "isActive": true,
          "isDeleted": false
        }
      ]
    }
  ]
}

Get agreements type

GET Users/AgreementType

Get available types of agreements.

Response

Agreement types.

Example request

In this example we get information about types of agreements.


curl -X POST 
     -H "Authorization: Bearer $ACCESS_TOKEN" 
     -H "Content-Type: application/json"
     
    http://yoursubdomain.perfectgym.com/Api/Users/AgreementType

Example response

Status: 200 OK
{
  "elements": [
    {
      "id": 2,
      "name": "Newsletter",
      "description": "Newsletter"
    }
  ]
}
Perfect Gym api