Welcome to Wiztr

Wiztr is where students (parents) and coaches connect for all coaching matters.

Current API version

  • Version: 1
  • Last updated: December 22, 2016

Conventions followed

APIs generally follow the REST model and return JSON responses over HTTPS. Refer to this Wiztr blog post to get a view into our thinking behind these RESTful APIs.

Some non-REST convenience method routes have been offered where appropriate. For example, auth/send_code to send the One Time Password (OTP) to the mobile phone number provided by a user.

Version number is included in the REST route. For example, v1 in /api/v1/auth/send_code denotes Version 1.

To get started

  1. :smile: Grab a cup of coffee (or your favorite coding beverage)
  2. Check Authentication section first to learn how to on-board new users and obtain authentication_token
  3. For all other API end points requiring authentication, the authentication_token value needs to be passed as a token via the Authorization Header
  4. That’s it! (for now)

For any questions, feel free to send a mail to bala [at] wiztr [dot] com.

GUIDELINES

Pagination - Return 15 items by default as the 1st page

Endpoint

GET /api/v1/businesses/:business_id/classes

Request

Route

GET /api/v1/businesses/1/classes

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/businesses/1/classes" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Link: <http://example.org/api/v1/businesses/1/classes?page=3>; rel="last", <http://example.org/api/v1/businesses/1/classes?page=2>; rel="next"
X-Per-Page: 15
X-Page: 1
X-Total: 40
Content-Type: application/json; charset=utf-8

Body

{
  "group_classes": [
    {
      "id": 40,
      "name": "Watsica-Blanda",
      "active": true,
      "session_duration": 30,
      "total_num_sessions": 4,
      "max_students_per_session": 10,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 40,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-25T17:38:35Z",
      "subcategory": {
        "id": 40,
        "name": "retro40",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 1,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 39,
      "name": "McLaughlin-Beier",
      "active": true,
      "session_duration": 90,
      "total_num_sessions": 4,
      "max_students_per_session": 0,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 39,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-25T17:38:35Z",
      "subcategory": {
        "id": 39,
        "name": "kickstarter39",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 1,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 38,
      "name": "Collier, Zboncak and Treutel",
      "active": true,
      "session_duration": 60,
      "total_num_sessions": 5,
      "max_students_per_session": 5,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 38,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-26T17:38:35Z",
      "subcategory": {
        "id": 38,
        "name": "heirloom38",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 1,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 37,
      "name": "Bahringer Group",
      "active": true,
      "session_duration": 90,
      "total_num_sessions": 4,
      "max_students_per_session": 3,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 37,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-25T17:38:35Z",
      "subcategory": {
        "id": 37,
        "name": "iPhone37",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 1,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 36,
      "name": "Greenholt Group",
      "active": true,
      "session_duration": 30,
      "total_num_sessions": 4,
      "max_students_per_session": 2,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 36,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-25T17:38:35Z",
      "subcategory": {
        "id": 36,
        "name": "cronut36",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 1,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 35,
      "name": "Christiansen and Sons",
      "active": true,
      "session_duration": 45,
      "total_num_sessions": 2,
      "max_students_per_session": 6,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 35,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-23T17:38:35Z",
      "subcategory": {
        "id": 35,
        "name": "typewriter35",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 1,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 34,
      "name": "Carter-Flatley",
      "active": true,
      "session_duration": 90,
      "total_num_sessions": 3,
      "max_students_per_session": 5,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 34,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-24T17:38:35Z",
      "subcategory": {
        "id": 34,
        "name": "+134",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 1,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 33,
      "name": "Adams and Sons",
      "active": true,
      "session_duration": 30,
      "total_num_sessions": 5,
      "max_students_per_session": 8,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 33,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-26T17:38:35Z",
      "subcategory": {
        "id": 33,
        "name": "chicharrones33",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 1,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 32,
      "name": "Gusikowski Group",
      "active": true,
      "session_duration": 90,
      "total_num_sessions": 2,
      "max_students_per_session": 4,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 32,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-23T17:38:35Z",
      "subcategory": {
        "id": 32,
        "name": "cred32",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 1,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 31,
      "name": "Stiedemann-Dach",
      "active": true,
      "session_duration": 90,
      "total_num_sessions": 1,
      "max_students_per_session": 12,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 31,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-22T17:38:35Z",
      "subcategory": {
        "id": 31,
        "name": "shoreditch31",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 1,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 30,
      "name": "Mohr Group",
      "active": true,
      "session_duration": 30,
      "total_num_sessions": 5,
      "max_students_per_session": 13,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 30,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-26T17:38:35Z",
      "subcategory": {
        "id": 30,
        "name": "stumptown30",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 1,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 29,
      "name": "Schneider, Morissette and Schulist",
      "active": true,
      "session_duration": 90,
      "total_num_sessions": 4,
      "max_students_per_session": 9,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 29,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-25T17:38:35Z",
      "subcategory": {
        "id": 29,
        "name": "park29",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 1,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 28,
      "name": "Casper, Shanahan and Lind",
      "active": true,
      "session_duration": 30,
      "total_num_sessions": 3,
      "max_students_per_session": 5,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 28,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-24T17:38:35Z",
      "subcategory": {
        "id": 28,
        "name": "normcore28",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 1,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 27,
      "name": "Koss, Crist and Smith",
      "active": true,
      "session_duration": 90,
      "total_num_sessions": 3,
      "max_students_per_session": 8,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 27,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-24T17:38:35Z",
      "subcategory": {
        "id": 27,
        "name": "bitters27",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 1,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 26,
      "name": "Kautzer and Sons",
      "active": true,
      "session_duration": 45,
      "total_num_sessions": 5,
      "max_students_per_session": 3,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 26,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-26T17:38:35Z",
      "subcategory": {
        "id": 26,
        "name": "kinfolk26",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 1,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    }
  ]
}

Pagination - Return 15 items by default as the 2nd page

Endpoint

GET /api/v1/businesses/:business_id/classes

Parameters

Name Description
page required Page to return

Request

Route

GET /api/v1/businesses/2/classes?page=2

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Query Parameters

page=2

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/businesses/2/classes?page=2" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Link: <http://example.org/api/v1/businesses/2/classes?page=1>; rel="first", <http://example.org/api/v1/businesses/2/classes?page=1>; rel="prev", <http://example.org/api/v1/businesses/2/classes?page=3>; rel="last", <http://example.org/api/v1/businesses/2/classes?page=3>; rel="next"
X-Per-Page: 15
X-Page: 2
X-Total: 40
Content-Type: application/json; charset=utf-8

Body

{
  "group_classes": [
    {
      "id": 65,
      "name": "Quigley-Trantow",
      "active": true,
      "session_duration": 30,
      "total_num_sessions": 4,
      "max_students_per_session": 13,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 65,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-25T17:38:35Z",
      "subcategory": {
        "id": 65,
        "name": "chambray65",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 2,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 64,
      "name": "Stokes, Cummings and Jerde",
      "active": true,
      "session_duration": 45,
      "total_num_sessions": 5,
      "max_students_per_session": 12,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 64,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-26T17:38:35Z",
      "subcategory": {
        "id": 64,
        "name": "vinegar64",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 2,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 63,
      "name": "Reichel LLC",
      "active": true,
      "session_duration": 60,
      "total_num_sessions": 5,
      "max_students_per_session": 10,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 63,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-26T17:38:35Z",
      "subcategory": {
        "id": 63,
        "name": "chartreuse63",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 2,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 62,
      "name": "Becker Group",
      "active": true,
      "session_duration": 45,
      "total_num_sessions": 2,
      "max_students_per_session": 13,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 62,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-23T17:38:35Z",
      "subcategory": {
        "id": 62,
        "name": "bushwick62",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 2,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 61,
      "name": "Hessel, Schulist and Simonis",
      "active": true,
      "session_duration": 60,
      "total_num_sessions": 4,
      "max_students_per_session": 12,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 61,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-25T17:38:35Z",
      "subcategory": {
        "id": 61,
        "name": "actually61",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 2,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 60,
      "name": "Weber-Grimes",
      "active": true,
      "session_duration": 30,
      "total_num_sessions": 4,
      "max_students_per_session": 10,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 60,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-25T17:38:35Z",
      "subcategory": {
        "id": 60,
        "name": "narwhal60",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 2,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 59,
      "name": "Cronin-Denesik",
      "active": true,
      "session_duration": 45,
      "total_num_sessions": 1,
      "max_students_per_session": 2,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 59,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-22T17:38:35Z",
      "subcategory": {
        "id": 59,
        "name": "kickstarter59",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 2,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 58,
      "name": "Hills Group",
      "active": true,
      "session_duration": 60,
      "total_num_sessions": 5,
      "max_students_per_session": 0,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 58,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-26T17:38:35Z",
      "subcategory": {
        "id": 58,
        "name": "bitters58",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 2,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 57,
      "name": "Gleason-Emmerich",
      "active": true,
      "session_duration": 30,
      "total_num_sessions": 5,
      "max_students_per_session": 7,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 57,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-26T17:38:35Z",
      "subcategory": {
        "id": 57,
        "name": "mumblecore57",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 2,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 56,
      "name": "Wiegand Group",
      "active": true,
      "session_duration": 120,
      "total_num_sessions": 2,
      "max_students_per_session": 6,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 56,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-23T17:38:35Z",
      "subcategory": {
        "id": 56,
        "name": "actually56",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 2,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 55,
      "name": "King-Dickinson",
      "active": true,
      "session_duration": 45,
      "total_num_sessions": 1,
      "max_students_per_session": 2,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 55,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-22T17:38:35Z",
      "subcategory": {
        "id": 55,
        "name": "goth55",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 2,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 54,
      "name": "Kunze Inc",
      "active": true,
      "session_duration": 120,
      "total_num_sessions": 4,
      "max_students_per_session": 3,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 54,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-25T17:38:35Z",
      "subcategory": {
        "id": 54,
        "name": "bespoke54",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 2,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 53,
      "name": "Hirthe-Cruickshank",
      "active": true,
      "session_duration": 120,
      "total_num_sessions": 1,
      "max_students_per_session": 9,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 53,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-22T17:38:35Z",
      "subcategory": {
        "id": 53,
        "name": "street53",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 2,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 52,
      "name": "Kilback LLC",
      "active": true,
      "session_duration": 90,
      "total_num_sessions": 1,
      "max_students_per_session": 0,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 52,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-22T17:38:35Z",
      "subcategory": {
        "id": 52,
        "name": "literally52",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 2,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 51,
      "name": "Ward and Sons",
      "active": true,
      "session_duration": 60,
      "total_num_sessions": 2,
      "max_students_per_session": 1,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 51,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:35Z",
      "last_session": "2016-12-23T17:38:35Z",
      "subcategory": {
        "id": 51,
        "name": "distillery51",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 2,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    }
  ]
}

Pagination - Return 5 items as the 1st page

Endpoint

GET /api/v1/businesses/:business_id/classes

Parameters

Name Description
per_page required Items per page to return

Request

Route

GET /api/v1/businesses/3/classes?per_page=5

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Query Parameters

per_page=5

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/businesses/3/classes?per_page=5" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Link: <http://example.org/api/v1/businesses/3/classes?page=8&per_page=5>; rel="last", <http://example.org/api/v1/businesses/3/classes?page=2&per_page=5>; rel="next"
X-Per-Page: 5
X-Page: 1
X-Total: 40
Content-Type: application/json; charset=utf-8

Body

{
  "group_classes": [
    {
      "id": 120,
      "name": "Stamm and Sons",
      "active": true,
      "session_duration": 60,
      "total_num_sessions": 5,
      "max_students_per_session": 6,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 120,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:36Z",
      "last_session": "2016-12-26T17:38:36Z",
      "subcategory": {
        "id": 120,
        "name": "semiotics120",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 3,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 119,
      "name": "Grimes-Tillman",
      "active": true,
      "session_duration": 30,
      "total_num_sessions": 1,
      "max_students_per_session": 1,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 119,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:36Z",
      "last_session": "2016-12-22T17:38:36Z",
      "subcategory": {
        "id": 119,
        "name": "PBR&B119",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 3,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 118,
      "name": "Rosenbaum Group",
      "active": true,
      "session_duration": 120,
      "total_num_sessions": 5,
      "max_students_per_session": 2,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 118,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:36Z",
      "last_session": "2016-12-26T17:38:36Z",
      "subcategory": {
        "id": 118,
        "name": "iPhone118",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 3,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 117,
      "name": "Leuschke, Torphy and Schumm",
      "active": true,
      "session_duration": 30,
      "total_num_sessions": 4,
      "max_students_per_session": 9,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 117,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:36Z",
      "last_session": "2016-12-25T17:38:36Z",
      "subcategory": {
        "id": 117,
        "name": "skateboard117",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 3,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 116,
      "name": "Kuvalis Inc",
      "active": true,
      "session_duration": 120,
      "total_num_sessions": 3,
      "max_students_per_session": 8,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 116,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:36Z",
      "last_session": "2016-12-24T17:38:36Z",
      "subcategory": {
        "id": 116,
        "name": "chartreuse116",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 3,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    }
  ]
}

Pagination - Return 10 items as the 3rd page

Endpoint

GET /api/v1/businesses/:business_id/classes

Parameters

Name Description
per_page required Items per page to return
page required Page to return

Request

Route

GET /api/v1/businesses/4/classes?per_page=10&page=3

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Query Parameters

per_page=10
page=3

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/businesses/4/classes?per_page=10&page=3" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Link: <http://example.org/api/v1/businesses/4/classes?page=1&per_page=10>; rel="first", <http://example.org/api/v1/businesses/4/classes?page=2&per_page=10>; rel="prev", <http://example.org/api/v1/businesses/4/classes?page=4&per_page=10>; rel="last", <http://example.org/api/v1/businesses/4/classes?page=4&per_page=10>; rel="next"
X-Per-Page: 10
X-Page: 3
X-Total: 40
Content-Type: application/json; charset=utf-8

Body

{
  "group_classes": [
    {
      "id": 140,
      "name": "Heller and Sons",
      "active": true,
      "session_duration": 45,
      "total_num_sessions": 3,
      "max_students_per_session": 7,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 140,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:36Z",
      "last_session": "2016-12-24T17:38:36Z",
      "subcategory": {
        "id": 140,
        "name": "readymade140",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 4,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 139,
      "name": "Okuneva-Terry",
      "active": true,
      "session_duration": 45,
      "total_num_sessions": 1,
      "max_students_per_session": 5,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 139,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:36Z",
      "last_session": "2016-12-22T17:38:36Z",
      "subcategory": {
        "id": 139,
        "name": "banjo139",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 4,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 138,
      "name": "Boyle and Sons",
      "active": true,
      "session_duration": 45,
      "total_num_sessions": 4,
      "max_students_per_session": 4,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 138,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:36Z",
      "last_session": "2016-12-25T17:38:36Z",
      "subcategory": {
        "id": 138,
        "name": "fap138",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 4,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 137,
      "name": "Heathcote-Gaylord",
      "active": true,
      "session_duration": 30,
      "total_num_sessions": 4,
      "max_students_per_session": 14,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 137,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:36Z",
      "last_session": "2016-12-25T17:38:36Z",
      "subcategory": {
        "id": 137,
        "name": "chicharrones137",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 4,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 136,
      "name": "Bosco, Gerhold and Von",
      "active": true,
      "session_duration": 90,
      "total_num_sessions": 1,
      "max_students_per_session": 1,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 136,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:36Z",
      "last_session": "2016-12-22T17:38:36Z",
      "subcategory": {
        "id": 136,
        "name": "park136",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 4,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 135,
      "name": "Powlowski Group",
      "active": true,
      "session_duration": 45,
      "total_num_sessions": 3,
      "max_students_per_session": 2,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 135,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:36Z",
      "last_session": "2016-12-24T17:38:36Z",
      "subcategory": {
        "id": 135,
        "name": "celiac135",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 4,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 134,
      "name": "Ziemann-Weber",
      "active": true,
      "session_duration": 60,
      "total_num_sessions": 2,
      "max_students_per_session": 0,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 134,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:36Z",
      "last_session": "2016-12-23T17:38:36Z",
      "subcategory": {
        "id": 134,
        "name": "chia134",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 4,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 133,
      "name": "Torp Inc",
      "active": true,
      "session_duration": 60,
      "total_num_sessions": 2,
      "max_students_per_session": 4,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 133,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:36Z",
      "last_session": "2016-12-23T17:38:36Z",
      "subcategory": {
        "id": 133,
        "name": "squid133",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 4,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 132,
      "name": "Parisian-Keeling",
      "active": true,
      "session_duration": 30,
      "total_num_sessions": 1,
      "max_students_per_session": 6,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 132,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:36Z",
      "last_session": "2016-12-22T17:38:36Z",
      "subcategory": {
        "id": 132,
        "name": "twee132",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 4,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    {
      "id": 131,
      "name": "Greenfelder and Sons",
      "active": true,
      "session_duration": 45,
      "total_num_sessions": 2,
      "max_students_per_session": 5,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 131,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:36Z",
      "last_session": "2016-12-23T17:38:36Z",
      "subcategory": {
        "id": 131,
        "name": "gentrify131",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 4,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    }
  ]
}

Utilities

Get information about last build

Endpoint

GET /build_info

Request

Route

GET /build_info

Headers

Accept: application/json
Content-Type: application/json

cURL

curl "https://wiztr-staging.herokuapp.com/build_info" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "number": "129",
  "version": "c781cae",
  "updated_at": "2016-05-23T14:31:20+00:00"
}

Authentication

Request OTP for new user

This method creates a new user based on a phone number parameter that is not currently in the Wiztr platform and returns a OTP code for new user to sign into Wiztr.

Endpoint

POST /api/v1/auth/send_code

Parameters

Name Description Type
phone_number required Fully qualified phone number with + String

Request

Route

POST /api/v1/auth/send_code

Headers

Accept: application/json
Content-Type: application/json

Body

{
  "phone_number": "+14084622252"
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/auth/send_code" -d '{"phone_number":"+14084622252"}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "user": {
    "id": 5,
    "settings": {
      "notifications": {
        "sms": {
          "invites": false,
          "bookings": false,
          "appointments": false
        },
        "push": {
          "invites": false,
          "bookings": false,
          "appointments": false
        }
      },
      "activities": [

      ]
    },
    "verified": false,
    "phone_numbers": [
      {
        "number": "+14084622252",
        "verified": false
      }
    ],
    "student_profiles": {
      "self": [

      ],
      "child": [

      ]
    },
    "coach_profiles": [

    ]
  },
  "meta": {
    "code": 3953
  }
}

Request OTP for existing user

This method identifies an existing user based on the phone number parameter and returns a OTP code for signing into Wiztr

Endpoint

POST /api/v1/auth/send_code

Parameters

Name Description Type
phone_number required Fully qualified phone number with + String

Request

Route

POST /api/v1/auth/send_code

Headers

Accept: application/json
Content-Type: application/json

Body

{
  "phone_number": "+375253821653"
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/auth/send_code" -d '{"phone_number":"+375253821653"}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "user": {
    "id": 6,
    "settings": {
      "notifications": {
        "sms": {
          "invites": true,
          "bookings": true,
          "appointments": true
        },
        "push": {
          "invites": true,
          "bookings": true,
          "appointments": true
        }
      },
      "activities": [

      ]
    },
    "verified": false,
    "phone_numbers": [
      {
        "number": "+375252429506",
        "verified": false
      },
      {
        "number": "+375253821653",
        "verified": false
      }
    ],
    "student_profiles": {
      "self": [
        {
          "id": 1,
          "first_name": "Davon",
          "last_name": "Gulgowski",
          "gender": "male",
          "dob": null,
          "pic_url": null,
          "bio": null,
          "user_id": 6,
          "verified": false
        }
      ],
      "child": [

      ]
    },
    "coach_profiles": [

    ]
  },
  "meta": {
    "code": 7842
  }
}

Sign in a user with code as coach

This method signs in a new or existing user based on the entered OTP code and returns an authentication_token for making subsequent requests to protected API endpoints.

Endpoint

POST /api/v1/auth/signin

Parameters

Name Description Type
phone_number required Fully qualified phone number with + String
code required One Time Password code sent via SMS Integer
user_type required Type of the user: coach/student String

Request

Route

POST /api/v1/auth/signin

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=BlankOrBadAuthToken

Body

{
  "phone_number": "+375255021232",
  "code": 1111,
  "user_type": "coach"
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/auth/signin" -d '{"phone_number":"+375255021232","code":1111,"user_type":"coach"}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=BlankOrBadAuthToken"

Response

Response Fields

Name Description Type
authentication_token Authentication Token for use with other requests that require authentication String
user User object of the successful signed in user User Object

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "authentication_token": "WzNcVQyaJkxRBxwR+SoRtQgTULJsTewUikAsPO1UlsOtoBLOu99AV1wTojP7NgjG2XUpt4SZb45npmHrP4jfrQ==",
  "user": {
    "id": 7,
    "settings": {
      "notifications": {
        "sms": {
          "invites": true,
          "bookings": true,
          "appointments": true
        },
        "push": {
          "invites": true,
          "bookings": true,
          "appointments": true
        }
      },
      "activities": [

      ]
    },
    "verified": true,
    "phone_numbers": [
      {
        "number": "+375258610293",
        "verified": false
      },
      {
        "number": "+375255021232",
        "verified": true
      }
    ],
    "student_profiles": {
      "self": [

      ],
      "child": [

      ]
    },
    "coach_profiles": [
      {
        "id": 2,
        "first_name": "",
        "last_name": "",
        "gender": null,
        "dob": null,
        "pic_url": null,
        "profile_description": null,
        "business_id": null,
        "user_id": 7,
        "verified": true
      }
    ]
  }
}

Sign in a coach user with code as student

Endpoint

POST /api/v1/auth/signin

Parameters

Name Description Type
phone_number required Fully qualified phone number with + String
code required One Time Password code sent via SMS Integer
user_type required Type of the user: coach/student String

Request

Route

POST /api/v1/auth/signin

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=BlankOrBadAuthToken

Body

{
  "phone_number": "+375254807078",
  "code": 1111,
  "user_type": "student"
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/auth/signin" -d '{"phone_number":"+375254807078","code":1111,"user_type":"student"}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=BlankOrBadAuthToken"

Response

Response Fields

Name Description Type
authentication_token Authentication Token for use with other requests that require authentication String
user User object of the successful signed in user User Object

Status

403

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "errors": [
    {
      "status": 403,
      "title": "You have already set up your account as a Coach. Please sign in as a Coach."
    }
  ]
}

Sign in a user with booking request token

This method allows to authenticate user who was invited by booking request.

Endpoint

POST /api/v1/auth/signin

Parameters

Name Description Type
phone_number required Fully qualified phone number with + String
booking_request_token required Booking request token (can be used INSTEAD OF code) String

Request

Route

POST /api/v1/auth/signin

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=BlankOrBadAuthToken

Body

{
  "phone_number": "+375252319260",
  "booking_request_token": "pmnFK7754LHKqdMEhaozDGgx"
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/auth/signin" -d '{"phone_number":"+375252319260","booking_request_token":"pmnFK7754LHKqdMEhaozDGgx"}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=BlankOrBadAuthToken"

Response

Response Fields

Name Description Type
authentication_token Authentication Token for use with other requests that require authentication String
user User object of the successful signed in user User Object

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "authentication_token": "wOPO5rggYV8yXoNJRKAdAs6gMvy8QEGMJGWHgcR1KRk6cPtcZPi4z1nobgU2h3Jz1LDg+P3icz3HX6/Zmc/UzA==",
  "user": {
    "id": 13,
    "settings": {
      "notifications": {
        "sms": {
          "invites": true,
          "bookings": true,
          "appointments": true
        },
        "push": {
          "invites": true,
          "bookings": true,
          "appointments": true
        }
      },
      "activities": [

      ]
    },
    "verified": true,
    "phone_numbers": [
      {
        "number": "+375257949875",
        "verified": false
      },
      {
        "number": "+375252319260",
        "verified": true
      }
    ],
    "student_profiles": {
      "self": [

      ],
      "child": [

      ]
    },
    "coach_profiles": [

    ]
  }
}

Sign out a user

This method signs out a User

Endpoint

POST /api/v1/auth/signout

Request

Route

POST /api/v1/auth/signout

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/auth/signout" -d '' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
}

Businesses

List associated businesses

Get a list of businesses (and roles) that the user is associated with. Needs authentication token.

Endpoint

GET /api/v1/businesses

Request

Route

GET /api/v1/businesses

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/businesses" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 2
Content-Type: application/json; charset=utf-8

Body

{
  "businesses": [
    {
      "id": 10,
      "name": "Piano Man",
      "description": "disintermediate revolutionary interfaces",
      "url": "http://bins.co/edwardo.hagenes",
      "state": "new",
      "settings": {
        "categories": [

        ],
        "subcategories": [

        ]
      },
      "owner": {
        "id": 17,
        "settings": {
          "notifications": {
            "sms": {
              "invites": true,
              "bookings": true,
              "appointments": true
            },
            "push": {
              "invites": true,
              "bookings": true,
              "appointments": true
            }
          },
          "activities": [

          ]
        },
        "verified": false,
        "phone_numbers": [
          {
            "number": "+375255319859",
            "verified": false
          }
        ],
        "student_profiles": {
          "self": [

          ],
          "child": [

          ]
        },
        "coach_profiles": [
          {
            "id": 7,
            "first_name": "Susie",
            "last_name": "Marks",
            "gender": "female",
            "dob": null,
            "pic_url": null,
            "profile_description": null,
            "business_id": 9,
            "user_id": 17,
            "verified": false
          }
        ]
      },
      "coaches": [

      ],
      "admins": [

      ]
    },
    {
      "id": 11,
      "name": "Tennis Trainer",
      "description": "engage next-generation solutions",
      "url": "http://carter.co/treie_mccullough",
      "state": "new",
      "settings": {
        "categories": [

        ],
        "subcategories": [

        ]
      },
      "owner": {
        "id": 17,
        "settings": {
          "notifications": {
            "sms": {
              "invites": true,
              "bookings": true,
              "appointments": true
            },
            "push": {
              "invites": true,
              "bookings": true,
              "appointments": true
            }
          },
          "activities": [

          ]
        },
        "verified": false,
        "phone_numbers": [
          {
            "number": "+375255319859",
            "verified": false
          }
        ],
        "student_profiles": {
          "self": [

          ],
          "child": [

          ]
        },
        "coach_profiles": [
          {
            "id": 7,
            "first_name": "Susie",
            "last_name": "Marks",
            "gender": "female",
            "dob": null,
            "pic_url": null,
            "profile_description": null,
            "business_id": 9,
            "user_id": 17,
            "verified": false
          }
        ]
      },
      "coaches": [

      ],
      "admins": [

      ]
    }
  ]
}

Create a new business

This method allows a user to create a business with new state and become the owner.

Endpoint

POST /api/v1/businesses

Parameters

Name Description Type
business[name] Business Name String
business[description] Business Description String
business[url] Business URL String
business[categories] Categories Array

Request

Route

POST /api/v1/businesses

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=Ei5aSt//saT0TnK8u1OhKc8iq+lkxU2Qgg/AW9Rs2moDndZG4hFFr9zzW4VfWfP+fOX2EgzYtgviDYFk4fTKbw==

Body

{
  "business": {
    "name": "White-Rolfson",
    "description": "evolve one-to-one ROI",
    "url": "http://dietrichhand.name/mauricio.schaden",
    "categories": [
      165,
      167
    ]
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/businesses" -d '{"business":{"name":"White-Rolfson","description":"evolve one-to-one ROI","url":"http://dietrichhand.name/mauricio.schaden","categories":[165,167]}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=Ei5aSt//saT0TnK8u1OhKc8iq+lkxU2Qgg/AW9Rs2moDndZG4hFFr9zzW4VfWfP+fOX2EgzYtgviDYFk4fTKbw=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "business": {
    "id": 13,
    "name": "White-Rolfson",
    "description": "evolve one-to-one ROI",
    "url": "http://dietrichhand.name/mauricio.schaden",
    "state": "new",
    "settings": {
      "categories": [
        {
          "id": 2,
          "color_code": null,
          "name": "Sports",
          "pic_url": {
          },
          "sort_order": null
        }
      ],
      "subcategories": [
        {
          "id": 165,
          "name": "Tennis",
          "category_id": 2,
          "color_code": null,
          "sort_order": null,
          "pic_url": {
          }
        },
        {
          "id": 167,
          "name": "Soccer",
          "category_id": 2,
          "color_code": null,
          "sort_order": null,
          "pic_url": {
          }
        }
      ]
    },
    "owner": {
      "id": 19,
      "settings": {
        "notifications": {
          "sms": {
            "invites": true,
            "bookings": true,
            "appointments": true
          },
          "push": {
            "invites": true,
            "bookings": true,
            "appointments": true
          }
        },
        "activities": [

        ]
      },
      "verified": false,
      "phone_numbers": [
        {
          "number": "+375252761580",
          "verified": false
        }
      ],
      "student_profiles": {
        "self": [

        ],
        "child": [

        ]
      },
      "coach_profiles": [
        {
          "id": 8,
          "first_name": "Chyna",
          "last_name": "Conroy",
          "gender": "male",
          "dob": null,
          "pic_url": null,
          "profile_description": null,
          "business_id": 12,
          "user_id": 19,
          "verified": false
        }
      ]
    },
    "coaches": [
      {
        "id": 19,
        "settings": {
          "notifications": {
            "sms": {
              "invites": true,
              "bookings": true,
              "appointments": true
            },
            "push": {
              "invites": true,
              "bookings": true,
              "appointments": true
            }
          },
          "activities": [

          ]
        },
        "verified": false,
        "phone_numbers": [
          {
            "number": "+375252761580",
            "verified": false
          }
        ],
        "student_profiles": {
          "self": [

          ],
          "child": [

          ]
        },
        "coach_profiles": [
          {
            "id": 8,
            "first_name": "Chyna",
            "last_name": "Conroy",
            "gender": "male",
            "dob": null,
            "pic_url": null,
            "profile_description": null,
            "business_id": 12,
            "user_id": 19,
            "verified": false
          }
        ]
      }
    ],
    "admins": [

    ]
  }
}

Update a business

This method allows a user to update a business if he is an business owner.

Endpoint

PUT /api/v1/businesses/:id

Parameters

Name Description Type
business[name] Business Name String
business[description] Business Description String
business[url] Business URL String
business[categories] Categories Array

Request

Route

PUT /api/v1/businesses/14

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=Ei5aSt//saT0TnK8u1OhKc8iq+lkxU2Qgg/AW9Rs2moDndZG4hFFr9zzW4VfWfP+fOX2EgzYtgviDYFk4fTKbw==

Body

{
  "business": {
    "name": "Davis LLC",
    "url": "http://stroman.biz/ashly",
    "categories": [
      177,
      179
    ]
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/businesses/14" -d '{"business":{"name":"Davis LLC","url":"http://stroman.biz/ashly","categories":[177,179]}}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=Ei5aSt//saT0TnK8u1OhKc8iq+lkxU2Qgg/AW9Rs2moDndZG4hFFr9zzW4VfWfP+fOX2EgzYtgviDYFk4fTKbw=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "business": {
    "id": 14,
    "name": "Davis LLC",
    "description": "generate integrated markets",
    "url": "http://stroman.biz/ashly",
    "state": "new",
    "settings": {
      "categories": [
        {
          "id": 5,
          "color_code": null,
          "name": "Sports",
          "pic_url": {
          },
          "sort_order": null
        }
      ],
      "subcategories": [
        {
          "id": 177,
          "name": "Tennis",
          "category_id": 5,
          "color_code": null,
          "sort_order": null,
          "pic_url": {
          }
        },
        {
          "id": 179,
          "name": "Soccer",
          "category_id": 5,
          "color_code": null,
          "sort_order": null,
          "pic_url": {
          }
        }
      ]
    },
    "owner": {
      "id": 21,
      "settings": {
        "notifications": {
          "sms": {
            "invites": true,
            "bookings": true,
            "appointments": true
          },
          "push": {
            "invites": true,
            "bookings": true,
            "appointments": true
          }
        },
        "activities": [

        ]
      },
      "verified": false,
      "phone_numbers": [
        {
          "number": "+375254420935",
          "verified": false
        }
      ],
      "student_profiles": {
        "self": [

        ],
        "child": [

        ]
      },
      "coach_profiles": [

      ]
    },
    "coaches": [

    ],
    "admins": [

    ]
  }
}

Invite a user

Send an invite to a user phone number to join the business

Endpoint

POST /api/v1/businesses/:id/invite_to_biz

Parameters

Name Description Type
phone_number required Fully qualified phone number with + String
first_name User fisrt name String
last_name User last name String
role One of coach, admin, customer String

Request

Route

POST /api/v1/businesses/18/invite_to_biz

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "phone_number": "+375253217180",
  "first_name": "Ericka",
  "last_name": "Ernser",
  "role": "customer"
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/businesses/18/invite_to_biz" -d '{"phone_number":"+375253217180","first_name":"Ericka","last_name":"Ernser","role":"customer"}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "user": {
    "id": 45,
    "settings": {
      "notifications": {
        "sms": {
          "invites": true,
          "bookings": true,
          "appointments": true
        },
        "push": {
          "invites": true,
          "bookings": true,
          "appointments": true
        }
      },
      "activities": [

      ]
    },
    "verified": false,
    "phone_numbers": [
      {
        "number": "+375258662791",
        "verified": false
      },
      {
        "number": "+375253217180",
        "verified": false
      }
    ],
    "student_profiles": {
      "self": [
        {
          "id": 11,
          "first_name": "Ericka",
          "last_name": "Ernser",
          "gender": "female",
          "dob": null,
          "pic_url": null,
          "bio": null,
          "user_id": 45,
          "verified": false
        }
      ],
      "child": [

      ]
    },
    "coach_profiles": [

    ]
  },
  "meta": {
    "invite_msg": "I invite you to connect with me thru Wiztr for all our coaching matters.  If asked for a code, enter qwerty"
  }
}

Invite a user

Send an invite to a user phone number to join the business

Endpoint

POST /api/v1/businesses/:id/invite_to_biz

Parameters

Name Description Type
phone_number required Fully qualified phone number with + String
first_name User fisrt name String
last_name User last name String
role One of coach, admin, customer String

Request

Route

POST /api/v1/businesses/18/invite_to_biz

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "phone_number": "+375253217180",
  "first_name": "Ericka",
  "last_name": "Ernser",
  "role": "customer"
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/businesses/18/invite_to_biz" -d '{"phone_number":"+375253217180","first_name":"Ericka","last_name":"Ernser","role":"customer"}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "user": {
    "id": 45,
    "settings": {
      "notifications": {
        "sms": {
          "invites": true,
          "bookings": true,
          "appointments": true
        },
        "push": {
          "invites": true,
          "bookings": true,
          "appointments": true
        }
      },
      "activities": [

      ]
    },
    "verified": false,
    "phone_numbers": [
      {
        "number": "+375258662791",
        "verified": false
      },
      {
        "number": "+375253217180",
        "verified": false
      }
    ],
    "student_profiles": {
      "self": [
        {
          "id": 11,
          "first_name": "Ericka",
          "last_name": "Ernser",
          "gender": "female",
          "dob": null,
          "pic_url": null,
          "bio": null,
          "user_id": 45,
          "verified": false
        }
      ],
      "child": [

      ]
    },
    "coach_profiles": [

    ]
  },
  "meta": {
    "invite_msg": "I invite you to connect with me thru Wiztr for all our coaching matters.  If asked for a code, enter qwerty"
  }
}

Join a business

Join a business that a user has an invitation to

Endpoint

POST /api/v1/businesses/:id/join

Request

Route

POST /api/v1/businesses/19/join

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/businesses/19/join" -d '' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "roles": [
    {
      "title": "customer",
      "status": "ACCEPTED",
      "user": {
        "id": 50,
        "settings": {
          "notifications": {
            "sms": {
              "invites": true,
              "bookings": true,
              "appointments": true
            },
            "push": {
              "invites": true,
              "bookings": true,
              "appointments": true
            }
          },
          "activities": [

          ]
        },
        "verified": false,
        "phone_numbers": [
          {
            "number": "+375251403268",
            "verified": false
          }
        ],
        "student_profiles": {
          "self": [
            {
              "id": 12,
              "first_name": "Mikayla",
              "last_name": "Crist",
              "gender": "female",
              "dob": null,
              "pic_url": null,
              "bio": null,
              "user_id": 50,
              "verified": false
            }
          ],
          "child": [

          ]
        },
        "coach_profiles": [

        ]
      },
      "business": {
        "id": 19,
        "name": "Yost and Sons",
        "description": "monetize rich channels",
        "url": "http://bashirian.name/julius_walsh",
        "state": "new",
        "settings": {
          "categories": [

          ],
          "subcategories": [

          ]
        }
      }
    }
  ]
}

List customers for a business

Get the list of customers that are associated with specified business, grouped by their status: invited, revoked, active (default)

Endpoint

GET /api/v1/businesses/:id/customers

Request

Route

GET /api/v1/businesses/20/customers

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/businesses/20/customers" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "customers": {
    "active_customers": [
      {
        "id": 59,
        "settings": {
          "notifications": {
            "sms": {
              "invites": true,
              "bookings": true,
              "appointments": true
            },
            "push": {
              "invites": true,
              "bookings": true,
              "appointments": true
            }
          },
          "activities": [

          ]
        },
        "verified": false,
        "phone_numbers": [
          {
            "number": "+375251931993",
            "verified": false
          }
        ],
        "student_profiles": {
          "self": [

          ],
          "child": [

          ]
        },
        "coach_profiles": [

        ]
      },
      {
        "id": 58,
        "settings": {
          "notifications": {
            "sms": {
              "invites": true,
              "bookings": true,
              "appointments": true
            },
            "push": {
              "invites": true,
              "bookings": true,
              "appointments": true
            }
          },
          "activities": [

          ]
        },
        "verified": false,
        "phone_numbers": [
          {
            "number": "+375253907377",
            "verified": false
          }
        ],
        "student_profiles": {
          "self": [

          ],
          "child": [

          ]
        },
        "coach_profiles": [

        ]
      },
      {
        "id": 57,
        "settings": {
          "notifications": {
            "sms": {
              "invites": true,
              "bookings": true,
              "appointments": true
            },
            "push": {
              "invites": true,
              "bookings": true,
              "appointments": true
            }
          },
          "activities": [

          ]
        },
        "verified": false,
        "phone_numbers": [
          {
            "number": "+375251257113",
            "verified": false
          }
        ],
        "student_profiles": {
          "self": [

          ],
          "child": [

          ]
        },
        "coach_profiles": [

        ]
      }
    ],
    "invited_customers": [
      {
        "id": 62,
        "settings": {
          "notifications": {
            "sms": {
              "invites": true,
              "bookings": true,
              "appointments": true
            },
            "push": {
              "invites": true,
              "bookings": true,
              "appointments": true
            }
          },
          "activities": [

          ]
        },
        "verified": false,
        "phone_numbers": [
          {
            "number": "+375254297395",
            "verified": false
          }
        ],
        "student_profiles": {
          "self": [

          ],
          "child": [

          ]
        },
        "coach_profiles": [

        ]
      },
      {
        "id": 61,
        "settings": {
          "notifications": {
            "sms": {
              "invites": true,
              "bookings": true,
              "appointments": true
            },
            "push": {
              "invites": true,
              "bookings": true,
              "appointments": true
            }
          },
          "activities": [

          ]
        },
        "verified": false,
        "phone_numbers": [
          {
            "number": "+375255219330",
            "verified": false
          }
        ],
        "student_profiles": {
          "self": [

          ],
          "child": [

          ]
        },
        "coach_profiles": [

        ]
      },
      {
        "id": 60,
        "settings": {
          "notifications": {
            "sms": {
              "invites": true,
              "bookings": true,
              "appointments": true
            },
            "push": {
              "invites": true,
              "bookings": true,
              "appointments": true
            }
          },
          "activities": [

          ]
        },
        "verified": false,
        "phone_numbers": [
          {
            "number": "+375254790518",
            "verified": false
          }
        ],
        "student_profiles": {
          "self": [

          ],
          "child": [

          ]
        },
        "coach_profiles": [

        ]
      }
    ],
    "revoked_customers": [
      {
        "id": 65,
        "settings": {
          "notifications": {
            "sms": {
              "invites": true,
              "bookings": true,
              "appointments": true
            },
            "push": {
              "invites": true,
              "bookings": true,
              "appointments": true
            }
          },
          "activities": [

          ]
        },
        "verified": false,
        "phone_numbers": [
          {
            "number": "+375254585827",
            "verified": false
          }
        ],
        "student_profiles": {
          "self": [

          ],
          "child": [

          ]
        },
        "coach_profiles": [

        ]
      },
      {
        "id": 64,
        "settings": {
          "notifications": {
            "sms": {
              "invites": true,
              "bookings": true,
              "appointments": true
            },
            "push": {
              "invites": true,
              "bookings": true,
              "appointments": true
            }
          },
          "activities": [

          ]
        },
        "verified": false,
        "phone_numbers": [
          {
            "number": "+375254512143",
            "verified": false
          }
        ],
        "student_profiles": {
          "self": [

          ],
          "child": [

          ]
        },
        "coach_profiles": [

        ]
      },
      {
        "id": 63,
        "settings": {
          "notifications": {
            "sms": {
              "invites": true,
              "bookings": true,
              "appointments": true
            },
            "push": {
              "invites": true,
              "bookings": true,
              "appointments": true
            }
          },
          "activities": [

          ]
        },
        "verified": false,
        "phone_numbers": [
          {
            "number": "+375251670394",
            "verified": false
          }
        ],
        "student_profiles": {
          "self": [

          ],
          "child": [

          ]
        },
        "coach_profiles": [

        ]
      }
    ]
  }
}

Business Settings

List configuration settings for a business

Endpoint

GET /api/v1/businesses/:business_id/settings

Request

Route

GET /api/v1/businesses/21/settings

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/businesses/21/settings" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "business": {
    "id": 21,
    "name": "Daniel, Stehr and Koelpin",
    "description": "exploit wireless mindshare",
    "url": "http://roob.org/marian.ferry",
    "state": "new",
    "settings": {
      "session_durations": [
        "30_min"
      ],
      "session_offerings": [
        "group_classes",
        "private_lessons",
        "semiprivate_lessons"
      ],
      "categories": [

      ],
      "subcategories": [

      ]
    },
    "owner": {
      "id": 66,
      "settings": {
        "notifications": {
          "sms": {
            "invites": true,
            "bookings": true,
            "appointments": true
          },
          "push": {
            "invites": true,
            "bookings": true,
            "appointments": true
          }
        },
        "activities": [

        ]
      },
      "verified": false,
      "phone_numbers": [
        {
          "number": "+375251020557",
          "verified": false
        }
      ],
      "student_profiles": {
        "self": [

        ],
        "child": [

        ]
      },
      "coach_profiles": [

      ]
    },
    "coaches": [

    ],
    "admins": [

    ]
  }
}

Set or update configuration settings for a business

Endpoint

POST /api/v1/businesses/:business_id/settings

Parameters

Name Description
settings required Settings hash

Request

Route

POST /api/v1/businesses/22/settings

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "settings": {
    "session_offerings": [
      "group_classes",
      "private_lessons"
    ],
    "session_durations": [
      "30_min",
      "60_min"
    ],
    "subcategories": [
      201
    ]
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/businesses/22/settings" -d '{"settings":{"session_offerings":["group_classes","private_lessons"],"session_durations":["30_min","60_min"],"subcategories":[201]}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "business": {
    "id": 22,
    "name": "Schoen-Collins",
    "description": "reintermediate open-source mindshare",
    "url": "http://deckow.co/chyna.lakin",
    "state": "new",
    "settings": {
      "session_durations": [
        "30_min",
        "60_min"
      ],
      "session_offerings": [
        "group_classes",
        "private_lessons"
      ],
      "categories": [
        {
          "id": 11,
          "color_code": null,
          "name": "Sports",
          "pic_url": {
          },
          "sort_order": null
        }
      ],
      "subcategories": [
        {
          "id": 201,
          "name": "Tennis",
          "category_id": 11,
          "color_code": null,
          "sort_order": null,
          "pic_url": {
          }
        }
      ]
    },
    "owner": {
      "id": 67,
      "settings": {
        "notifications": {
          "sms": {
            "invites": true,
            "bookings": true,
            "appointments": true
          },
          "push": {
            "invites": true,
            "bookings": true,
            "appointments": true
          }
        },
        "activities": [

        ]
      },
      "verified": false,
      "phone_numbers": [
        {
          "number": "+375253667896",
          "verified": false
        }
      ],
      "student_profiles": {
        "self": [

        ],
        "child": [

        ]
      },
      "coach_profiles": [

      ]
    },
    "coaches": [

    ],
    "admins": [

    ]
  }
}

Categories

List categories and subcategories

Get a tree view of Wiztr defined categories and subcategories for businesses

Endpoint

GET /api/v1/categories

Request

Route

GET /api/v1/categories

Headers

Accept: application/json
Content-Type: application/json

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/categories" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "categories": [
    {
      "id": 22,
      "name": "Music",
      "color_code": null,
      "sort_order": null,
      "pic_url": {
      },
      "subcategories": [
        {
          "id": 245,
          "name": "Piano",
          "category_id": 22,
          "color_code": null,
          "sort_order": null,
          "pic_url": {
          }
        },
        {
          "id": 246,
          "name": "Vocal",
          "category_id": 22,
          "color_code": null,
          "sort_order": null,
          "pic_url": {
          }
        }
      ]
    }
  ]
}

Chat Favorites

List chat favorites for the user

Endpoint

GET /api/v1/users/:user_id/favorites

Request

Route

GET /api/v1/users/77/favorites

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/users/77/favorites" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 1
Content-Type: application/json; charset=utf-8

Body

{
  "favorites": [
    {
      "id": 1,
      "source": "Quickblox",
      "type": "Message",
      "fav_value": "{\n        \"_id\": \"53aadcc7e4b077ddd43e804d\",\n        \"attachments\": [],\n        \"read_ids\": [2792283,4374458],\n        \"delivered_ids\": [2792283,4374458],\n        \"chat_dialog_id\": \"53aadc78535c127f15009b6c\",\n        \"date_sent\": 1403706567,\n        \"message\": null,\n        \"recipient_id\": null,\n        \"sender_id\": 298,\n        \"read\": 1\n      }",
      "profile_ids": [

      ],
      "user_id": 77,
      "category_id": null,
      "subcategory_id": null
    }
  ]
}

Add favorite item in user chat favorites

Endpoint

POST /api/v1/users/:user_id/favorites

Parameters

Name Description
favorite[type] required Type of the favorite
favorite[source] required Source of the favorite
favorite[fav_value] required Chat message/dialog
favorite[profile_ids] Student profiles IDs dependent on user
favorite[category_id] Category ID
favorite[subcategory_id] Subcategory ID

Request

Route

POST /api/v1/users/78/favorites

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "favorite": {
    "type": "Message",
    "source": "Quickblox",
    "fav_value": "{\n        \"_id\": \"53aadcc7e4b077ddd43e804d\",\n        \"attachments\": [],\n        \"read_ids\": [2792283,4374458],\n        \"delivered_ids\": [2792283,4374458],\n        \"chat_dialog_id\": \"53aadc78535c127f15009b6c\",\n        \"date_sent\": 1403706567,\n        \"message\": null,\n        \"recipient_id\": null,\n        \"sender_id\": 298,\n        \"read\": 1\n      }"
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/users/78/favorites" -d '{"favorite":{"type":"Message","source":"Quickblox","fav_value":"{\n        \"_id\": \"53aadcc7e4b077ddd43e804d\",\n        \"attachments\": [],\n        \"read_ids\": [2792283,4374458],\n        \"delivered_ids\": [2792283,4374458],\n        \"chat_dialog_id\": \"53aadc78535c127f15009b6c\",\n        \"date_sent\": 1403706567,\n        \"message\": null,\n        \"recipient_id\": null,\n        \"sender_id\": 298,\n        \"read\": 1\n      }"}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "favorite": {
    "id": 3,
    "source": "Quickblox",
    "type": "Message",
    "fav_value": "{\n        \"_id\": \"53aadcc7e4b077ddd43e804d\",\n        \"attachments\": [],\n        \"read_ids\": [2792283,4374458],\n        \"delivered_ids\": [2792283,4374458],\n        \"chat_dialog_id\": \"53aadc78535c127f15009b6c\",\n        \"date_sent\": 1403706567,\n        \"message\": null,\n        \"recipient_id\": null,\n        \"sender_id\": 298,\n        \"read\": 1\n      }",
    "profile_ids": [

    ],
    "user_id": 78,
    "category_id": null,
    "subcategory_id": null
  }
}

Get chat favorite item

Endpoint

GET /api/v1/favorites/:id

Request

Route

GET /api/v1/favorites/4

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/favorites/4" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "favorite": {
    "id": 4,
    "source": "Quickblox",
    "type": "Message",
    "fav_value": "{\n        \"_id\": \"53aadcc7e4b077ddd43e804d\",\n        \"attachments\": [],\n        \"read_ids\": [2792283,4374458],\n        \"delivered_ids\": [2792283,4374458],\n        \"chat_dialog_id\": \"53aadc78535c127f15009b6c\",\n        \"date_sent\": 1403706567,\n        \"message\": null,\n        \"recipient_id\": null,\n        \"sender_id\": 298,\n        \"read\": 1\n      }",
    "profile_ids": [

    ],
    "user_id": 79,
    "category_id": null,
    "subcategory_id": null
  }
}

Update chat favorite item with profile id tags

Update chat favorite with new values. For example, with profile IDs

Endpoint

PUT /api/v1/favorites/:id

Parameters

Name Description
favorite[profile_ids] required Student profiles IDs dependent on user
favorite[type] Type of the favorite
favorite[source] Source of the favorite
favorite[fav_value] Chat message/dialog
favorite[category_id] Category ID
favorite[subcategory_id] Subcategory ID

Request

Route

PUT /api/v1/favorites/5

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "favorite": {
    "profile_ids": [
      1,
      2
    ]
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/favorites/5" -d '{"favorite":{"profile_ids":[1,2]}}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "favorite": {
    "id": 5,
    "source": "Quickblox",
    "type": "Message",
    "fav_value": "{\n        \"_id\": \"53aadcc7e4b077ddd43e804d\",\n        \"attachments\": [],\n        \"read_ids\": [2792283,4374458],\n        \"delivered_ids\": [2792283,4374458],\n        \"chat_dialog_id\": \"53aadc78535c127f15009b6c\",\n        \"date_sent\": 1403706567,\n        \"message\": null,\n        \"recipient_id\": null,\n        \"sender_id\": 298,\n        \"read\": 1\n      }",
    "profile_ids": [
      1,
      2
    ],
    "user_id": 80,
    "category_id": null,
    "subcategory_id": null
  }
}

Remove chat favorite item

Endpoint

DELETE /api/v1/favorites/:id

Request

Route

DELETE /api/v1/favorites/6

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/favorites/6" -d '' -X DELETE \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
}

Notifications

List notifications of the current user (coach)

Endpoint

GET /api/v1/notifications

Parameters

Name Description
filter_by[view] required coach or student
filter_by[archived] true or false

Request

Route

GET /api/v1/notifications?filter_by[view]=coach

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Query Parameters

filter_by={"view"=>"coach"}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/notifications?filter_by[view]=coach" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 1
Content-Type: application/json; charset=utf-8

Body

{
  "notifications": [
    {
      "id": 1,
      "acknowledged_by": null,
      "acknowledged_at": null,
      "seen_at": null,
      "delivered_at": null,
      "key": "booking.requested",
      "owner": {
        "student_profile": {
          "id": 18,
          "first_name": "Bernadine",
          "last_name": "Williamson",
          "gender": "female",
          "dob": null,
          "pic_url": null,
          "bio": null,
          "user_id": 88,
          "verified": false
        }
      },
      "trackable_type": "Booking",
      "trackable_id": 2,
      "type": "system",
      "comment": null,
      "description": null
    }
  ]
}

List archived notifications of the current user (coach)

Endpoint

GET /api/v1/notifications

Parameters

Name Description
filter_by[view] required coach or student
filter_by[archived] required true or false

Request

Route

GET /api/v1/notifications?filter_by[view]=coach&filter_by[archived]=true

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Query Parameters

filter_by={"view"=>"coach", "archived"=>"true"}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/notifications?filter_by[view]=coach&filter_by[archived]=true" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 1
Content-Type: application/json; charset=utf-8

Body

{
  "notifications": [
    {
      "id": 6,
      "acknowledged_by": 23,
      "acknowledged_at": "2016-12-22T17:38:40.330Z",
      "seen_at": null,
      "delivered_at": null,
      "key": "booking.requested",
      "owner": {
        "student_profile": {
          "id": 26,
          "first_name": "Porter",
          "last_name": "Medhurst",
          "gender": "male",
          "dob": null,
          "pic_url": null,
          "bio": null,
          "user_id": 102,
          "verified": false
        }
      },
      "trackable_type": "Booking",
      "trackable_id": 6,
      "type": "system",
      "comment": null,
      "description": null
    }
  ]
}

Okay a notification to acknowledge it

Endpoint

POST /api/v1/notifications/:notification_id/okay

Parameters

Name Description
current_user_profile_id required Used profile of the current user

Request

Route

POST /api/v1/notifications/7/okay

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "current_user_profile_id": 27
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/notifications/7/okay" -d '{"current_user_profile_id":27}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
}

Accept the request in notification

Endpoint

POST /api/v1/notifications/:notification_id/accept

Parameters

Name Description
comment Comment to notification
current_user_profile_id required Used profile of the current user

Request

Route

POST /api/v1/notifications/9/accept

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "comment": "Comment to notification",
  "current_user_profile_id": 31
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/notifications/9/accept" -d '{"comment":"Comment to notification","current_user_profile_id":31}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
}

Decline the request in notification

Endpoint

POST /api/v1/notifications/:notification_id/decline

Parameters

Name Description
comment Comment to notification
current_user_profile_id required Used profile of the current user

Request

Route

POST /api/v1/notifications/11/decline

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "comment": "Comment to notification",
  "current_user_profile_id": 35
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/notifications/11/decline" -d '{"comment":"Comment to notification","current_user_profile_id":35}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
}

Update delivered timestamp

Endpoint

POST /api/v1/notifications/:notification_id/set_delivered

Request

Route

POST /api/v1/notifications/13/set_delivered

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/notifications/13/set_delivered" -d '' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
}

Physical Locations

Add new physical location

Endpoint

POST /api/v1/physical_locations

Parameters

Name Description
physical_location[place_id] required Hash of provider and location ID on the provider's map
physical_location[lat] required Latitude of the location
physical_location[long] required Longitude of the location
physical_location[street] Street of the physical location
physical_location[district] District of the physical location

Request

Route

POST /api/v1/physical_locations

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "physical_location": {
    "place_id": {
      "google": "ChIJrTLr-GyuEmsRBfy61i59si0"
    },
    "lat": "151.199025",
    "long": "-33.870775"
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/physical_locations" -d '{"physical_location":{"place_id":{"google":"ChIJrTLr-GyuEmsRBfy61i59si0"},"lat":"151.199025","long":"-33.870775"}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "physical_location": {
    "id": 1,
    "lat": "151.199025",
    "long": "-33.870775",
    "place_id": {
      "google": "ChIJrTLr-GyuEmsRBfy61i59si0"
    },
    "street": null,
    "district": null
  }
}

List physical locations

Endpoint

GET /api/v1/physical_locations

Request

Route

GET /api/v1/physical_locations

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/physical_locations" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 1
Content-Type: application/json; charset=utf-8

Body

{
  "physical_locations": [
    {
      "id": 2,
      "lat": "46.01751290110977",
      "long": "178.58330227866168",
      "place_id": {
        "google": "ChIJrTLr-GyuEmsRBfy61i59si0"
      },
      "street": null,
      "district": null
    }
  ]
}

Get physical location

Endpoint

GET /api/v1/physical_locations/:id

Request

Route

GET /api/v1/physical_locations/3

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/physical_locations/3" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "physical_location": {
    "id": 3,
    "lat": "-26.68989085284514",
    "long": "-35.42207594091269",
    "place_id": {
      "google": "ChIJrTLr-GyuEmsRBfy61i59si0"
    },
    "street": null,
    "district": null
  }
}

Get physical locations

Endpoint

GET /api/v1/physical_locations/multiple/:ids

Request

Route

GET /api/v1/physical_locations/multiple/4,5

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/physical_locations/multiple/4,5" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "physical_locations": [
    {
      "id": 4,
      "lat": "-41.080713501790406",
      "long": "-145.92003581430092",
      "place_id": {
        "google": "ChIJrTLr-GyuEmsRBfy61i59si0"
      },
      "street": null,
      "district": null
    },
    {
      "id": 5,
      "lat": "-17.562523308234944",
      "long": "-104.10925199772991",
      "place_id": {
        "google": "ChIJrTLr-GyuEmsRBfy61i59si0"
      },
      "street": null,
      "district": null
    }
  ]
}

Update physical location with latitude and longitude

Endpoint

PUT /api/v1/physical_locations/:id

Parameters

Name Description
physical_location[place_id] required Hash of provider and location ID on the provider's map
physical_location[lat] required Latitude of the location
physical_location[long] required Longitude of the location
physical_location[street] Street of the physical location
physical_location[district] District of the physical location

Request

Route

PUT /api/v1/physical_locations/6

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "physical_location": {
    "lat": "66.9878",
    "long": "66.9878",
    "street": "631 Enid Plains"
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/physical_locations/6" -d '{"physical_location":{"lat":"66.9878","long":"66.9878","street":"631 Enid Plains"}}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "physical_location": {
    "id": 6,
    "lat": "66.9878",
    "long": "66.9878",
    "place_id": {
      "google": "ChIJrTLr-GyuEmsRBfy61i59si0"
    },
    "street": "631 Enid Plains",
    "district": null
  }
}

Remove physical location

Endpoint

DELETE /api/v1/physical_locations/:id

Request

Route

DELETE /api/v1/physical_locations/7

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/physical_locations/7" -d '' -X DELETE \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
}

Service Offering Locations

View all locations of the service offering

Endpoint

GET /api/v1/service_offerings/:service_offering_id/locations

Request

Route

GET /api/v1/service_offerings/169/locations

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/service_offerings/169/locations" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 1
Content-Type: application/json; charset=utf-8

Body

{
  "service_offering_locations": [
    {
      "id": 1,
      "is_default": true,
      "name": null,
      "notes": "meet in skype",
      "location_type": "online",
      "service_offering_id": 169,
      "physical_location": null
    }
  ]
}

Create new location for service offering

Endpoint

POST /api/v1/service_offerings/:service_offering_id/locations

Parameters

Name Description
service_offering_location[location_type] required Location type - online, physical, custom
service_offering_location[name] required Alternative nama for location
service_offering_location[notes] required Notes on location
service_offering_location[physical_location_id] required Physical location ID (in case of physical location)

Request

Route

POST /api/v1/service_offerings/172/locations

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "service_offering_location": {
    "location_type": "physical",
    "name": "Swimming pool",
    "physical_location_id": 11
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/service_offerings/172/locations" -d '{"service_offering_location":{"location_type":"physical","name":"Swimming pool","physical_location_id":11}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "service_offering_location": {
    "id": 5,
    "is_default": false,
    "name": "Swimming pool",
    "notes": null,
    "location_type": "physical",
    "service_offering_id": 172,
    "physical_location": {
      "id": 11,
      "lat": "-62.778424142843605",
      "long": "-161.35940954284843",
      "place_id": {
        "google": "ChIJrTLr-GyuEmsRBfy61i59si0"
      },
      "street": null,
      "district": null
    }
  }
}

Get service offering location

Endpoint

GET /api/v1/service_offering_locations/:id

Request

Route

GET /api/v1/service_offering_locations/6

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/service_offering_locations/6" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "service_offering_location": {
    "id": 6,
    "is_default": true,
    "name": null,
    "notes": "meet in skype",
    "location_type": "online",
    "service_offering_id": 173,
    "physical_location": null
  }
}

Get multiple service offering locations

Endpoint

GET /api/v1/service_offering_locations/multiple/:ids

Request

Route

GET /api/v1/service_offering_locations/multiple/8,9

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/service_offering_locations/multiple/8,9" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "service_offering_locations": [
    {
      "id": 8,
      "is_default": true,
      "name": null,
      "notes": "meet in skype",
      "location_type": "online",
      "service_offering_id": 175,
      "physical_location": null
    },
    {
      "id": 9,
      "is_default": true,
      "name": null,
      "notes": null,
      "location_type": "physical",
      "service_offering_id": 176,
      "physical_location": {
        "id": 14,
        "lat": "-27.665824326786392",
        "long": "-172.8395174685308",
        "place_id": {
          "google": "ChIJrTLr-GyuEmsRBfy61i59si0"
        },
        "street": null,
        "district": null
      }
    }
  ]
}

Update service offering location

Endpoint

PUT /api/v1/service_offering_locations/:id

Parameters

Name Description
service_offering_location[location_type] required Location type - online, physical, custom
service_offering_location[name] required Alternative nama for location
service_offering_location[notes] required Notes on location
service_offering_location[physical_location_id] required Physical location ID (in case of physical location)

Request

Route

PUT /api/v1/service_offering_locations/11

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "service_offering_location": {
    "name": "Alternative name"
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/service_offering_locations/11" -d '{"service_offering_location":{"name":"Alternative name"}}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "service_offering_location": {
    "id": 11,
    "is_default": true,
    "name": "Alternative name",
    "notes": null,
    "location_type": "physical",
    "service_offering_id": 178,
    "physical_location": {
      "id": 16,
      "lat": "16.879968322857422",
      "long": "43.79133767547037",
      "place_id": {
        "google": "ChIJrTLr-GyuEmsRBfy61i59si0"
      },
      "street": null,
      "district": null
    }
  }
}

Delete service offering location

Endpoint

DELETE /api/v1/service_offering_locations/:id

Request

Route

DELETE /api/v1/service_offering_locations/12

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/service_offering_locations/12" -d '' -X DELETE \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
}

Make location default

Endpoint

POST /api/v1/service_offering_locations/:id/make_default

Request

Route

POST /api/v1/service_offering_locations/16/make_default

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/service_offering_locations/16/make_default" -d '' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "service_offering_location": {
    "id": 16,
    "is_default": true,
    "name": null,
    "notes": null,
    "location_type": "physical",
    "service_offering_id": 182,
    "physical_location": {
      "id": 22,
      "lat": "-50.7719624294169",
      "long": "54.97443823516343",
      "place_id": {
        "google": "ChIJrTLr-GyuEmsRBfy61i59si0"
      },
      "street": null,
      "district": null
    }
  }
}

Profiles

Get profile

It returns student or coach user profile

Endpoint

GET /api/v1/profiles/:id

Request

Route

GET /api/v1/profiles/43

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/profiles/43" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "student_profile": {
    "id": 43,
    "first_name": "Darrick",
    "last_name": "O'Kon",
    "gender": "female",
    "dob": null,
    "pic_url": null,
    "bio": null,
    "user_id": 158,
    "verified": false
  }
}

Remove profile

Endpoint

DELETE /api/v1/profiles/:id

Request

Route

DELETE /api/v1/profiles/44

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/profiles/44" -d '' -X DELETE \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
}

Edit profile

Edit profile with new values. For example, with new first name

Endpoint

PUT /api/v1/profiles/:id

Parameters

Name Description
profile[first_name] required First name for coach user profile
profile[last_name] Last name for coach user profile
profile[gender] Gender for coach user profile
profile[dob] Date of Birth for coach user profile
profile[profile_description] Profile description for coach user profile

Request

Route

PUT /api/v1/profiles/46

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "profile": {
    "first_name": "Updated"
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/profiles/46" -d '{"profile":{"first_name":"Updated"}}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "coach_profile": {
    "id": 46,
    "first_name": "Updated",
    "last_name": "Franecki",
    "gender": "female",
    "dob": null,
    "pic_url": null,
    "profile_description": null,
    "business_id": 62,
    "user_id": 160,
    "verified": false
  }
}

DEPRECATED: Create or update profile pic via multi-part request

This method is deprecated. Use a similar one but without multi-part request.

Endpoint

POST /api/v1/profiles/:id/pic

Parameters

Name Description
image_file required Image sent via multipart request

Request

Route

POST /api/v1/profiles/48/pic

Headers

Accept: image/jpeg
Content-Type: multipart/form-data
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{"image_file":"/images/demos/galleries/abstract/7.jpg"}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/profiles/48/pic" -d '{"image_file":"/images/demos/galleries/abstract/7.jpg"}' -X POST \
	-H "Accept: image/jpeg" \
	-H "Content-Type: multipart/form-data" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "student_profile": {
    "id": 48,
    "first_name": "Erling",
    "last_name": "Funk",
    "gender": "male",
    "dob": null,
    "pic_url": "http://s3-us-west-2.amazonaws.com/wiztr/profiles/48/48_20161222203841.jpg",
    "bio": null,
    "user_id": 162,
    "verified": false
  }
}

Create or update profile pic without multipart request

Endpoint

POST /api/v1/profiles/:id/set_pic

Parameters

Name Description
uploaded_image_file required URL to uploaded image

Request

Route

POST /api/v1/profiles/50/set_pic

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "uploaded_image_file": "https://s3-us-west-2.amazonaws.com/wiztr-dev/uploads/wallpaper-646262.jpg"
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/profiles/50/set_pic" -d '{"uploaded_image_file":"https://s3-us-west-2.amazonaws.com/wiztr-dev/uploads/wallpaper-646262.jpg"}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "student_profile": {
    "id": 50,
    "first_name": "Christop",
    "last_name": "Mante",
    "gender": "male",
    "dob": null,
    "pic_url": "http://s3-us-west-2.amazonaws.com/wiztr/profiles/50/50_20161222203841.jpg",
    "bio": null,
    "user_id": 163,
    "verified": false
  }
}

Remove profile pic

Endpoint

PUT /api/v1/profiles/:id

Parameters

Name Description
profile[pic_url] required Profile pic to update

Request

Route

PUT /api/v1/profiles/52

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "profile": {
    "pic_url": ""
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/profiles/52" -d '{"profile":{"pic_url":""}}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "student_profile": {
    "id": 52,
    "first_name": "Gwen",
    "last_name": "Gottlieb",
    "gender": "male",
    "dob": null,
    "pic_url": null,
    "bio": null,
    "user_id": 164,
    "verified": false
  }
}

Profiles - Coach Users

List coach profiles for a business user

Endpoint

GET /api/v1/users/:user_id/profiles

Parameters

Name Description
type required Type of profile: `CoachProfile`

Request

Route

GET /api/v1/users/165/profiles?type=CoachProfile

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Query Parameters

type=CoachProfile

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/users/165/profiles?type=CoachProfile" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "coach_profiles": [
    {
      "id": 53,
      "first_name": "Mitchell",
      "last_name": "Cartwright",
      "gender": "male",
      "dob": null,
      "pic_url": null,
      "profile_description": null,
      "business_id": 63,
      "user_id": 165,
      "verified": false
    }
  ]
}

Add coach profile for a business user

Endpoint

POST /api/v1/users/:user_id/coach_profiles

Parameters

Name Description
profile[first_name] required First name for business user profile
profile[last_name] required Last name for business user profile
profile[gender] Gender for business user profile
profile[dob] Date of Birth for business user profile
profile[profile_description] Profile description for business user profile
profile[business_id] required Business related to business user profile
profile[user_id] required User ID

Request

Route

POST /api/v1/users/167/coach_profiles

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "profile": {
    "first_name": "Kylee",
    "last_name": "Hayes",
    "dob": "1984-01-25",
    "profile_description": "Business User Profile",
    "business_id": 64,
    "user_id": 167
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/users/167/coach_profiles" -d '{"profile":{"first_name":"Kylee","last_name":"Hayes","dob":"1984-01-25","profile_description":"Business User Profile","business_id":64,"user_id":167}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "coach_profile": {
    "id": 54,
    "first_name": "Kylee",
    "last_name": "Hayes",
    "gender": null,
    "dob": "1984-01-25",
    "pic_url": null,
    "profile_description": "Business User Profile",
    "business_id": 64,
    "user_id": 167,
    "verified": false
  }
}

Profiles - Student Users

List dependent profiles for a student/parent user

Endpoint

GET /api/v1/users/:user_id/profiles

Parameters

Name Description
type required Type of profile: `StudentProfile`
relationship required Relationship to profile: `child`

Request

Route

GET /api/v1/users/168/profiles?type=StudentProfile&relationship=child

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Query Parameters

type=StudentProfile
relationship=child

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/users/168/profiles?type=StudentProfile&relationship=child" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "student_profiles": [
    {
      "id": 55,
      "first_name": "John",
      "last_name": "Doe",
      "gender": null,
      "dob": null,
      "pic_url": null,
      "bio": null,
      "user_id": 168,
      "verified": false
    },
    {
      "id": 56,
      "first_name": "Ivan",
      "last_name": "Doe",
      "gender": null,
      "dob": null,
      "pic_url": null,
      "bio": null,
      "user_id": 168,
      "verified": false
    }
  ]
}

List own profiles for a student/parent user

Endpoint

GET /api/v1/users/:user_id/profiles

Parameters

Name Description
type required Type of profile: `StudentProfile`
relationship required Relationship to profile: `self`

Request

Route

GET /api/v1/users/169/profiles?type=StudentProfile&relationship=self

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Query Parameters

type=StudentProfile
relationship=self

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/users/169/profiles?type=StudentProfile&relationship=self" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "student_profiles": [
    {
      "id": 57,
      "first_name": "Rico",
      "last_name": "Heidenreich",
      "gender": "female",
      "dob": null,
      "pic_url": null,
      "bio": null,
      "user_id": 169,
      "verified": false
    }
  ]
}

Add own profile for a student/parent user

Endpoint

POST /api/v1/users/:user_id/student_profiles

Parameters

Name Description
profile[first_name] required First name for student profile
profile[last_name] required Last name for student profile
profile[gender] Gender for student profile
profile[dob] Date of Birth for student profile
profile[bio] Profile description for student profile
profile[user_id] required User that owns student profile as parent or herself/himself
profile[relationship] required User's relationship to student profile

Request

Route

POST /api/v1/users/170/student_profiles

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "profile": {
    "first_name": "Herminio",
    "last_name": "Torphy",
    "user_id": 170,
    "relationship": "self"
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/users/170/student_profiles" -d '{"profile":{"first_name":"Herminio","last_name":"Torphy","user_id":170,"relationship":"self"}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "student_profile": {
    "id": 58,
    "first_name": "Herminio",
    "last_name": "Torphy",
    "gender": null,
    "dob": null,
    "pic_url": null,
    "bio": null,
    "user_id": 170,
    "verified": false
  }
}

Add dependent profile for a student/parent user

Endpoint

POST /api/v1/users/:user_id/student_profiles

Parameters

Name Description
profile[first_name] required First name for student profile
profile[last_name] required Last name for student profile
profile[gender] Gender for student profile
profile[dob] Date of Birth for student profile
profile[bio] Profile description for student profile
profile[user_id] required User that owns student profile as parent or herself/himself
profile[relationship] required User's relationship to student profile

Request

Route

POST /api/v1/users/171/student_profiles

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "profile": {
    "first_name": "Harrison",
    "last_name": "Treutel",
    "user_id": 171,
    "relationship": "child"
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/users/171/student_profiles" -d '{"profile":{"first_name":"Harrison","last_name":"Treutel","user_id":171,"relationship":"child"}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "student_profile": {
    "id": 59,
    "first_name": "Harrison",
    "last_name": "Treutel",
    "gender": null,
    "dob": null,
    "pic_url": null,
    "bio": null,
    "user_id": 171,
    "verified": false
  }
}

Recurrences

Get all recurrences

Endpoint

GET /api/v1/recurrences

Request

Route

GET /api/v1/recurrences

Headers

Accept: application/json
Content-Type: application/json

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/recurrences" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "recurrences": [
    {
      "id": 168,
      "name": "Daily",
      "details": null
    },
    {
      "id": 169,
      "name": "Daily",
      "details": "Excl. Saturday and Sunday"
    },
    {
      "id": 170,
      "name": "Weekly",
      "details": null
    },
    {
      "id": 171,
      "name": "Bi-Weekly",
      "details": null
    },
    {
      "id": 172,
      "name": "Monthly",
      "details": null
    }
  ]
}

Calculate last session (depending on start date, recurrence and number of sessions)

Endpoint

POST /api/v1/recurrences/:recurrence_id/last_session

Parameters

Name Description
start_datetime required Start date and time
sessions_count required Number of sessions

Request

Route

POST /api/v1/recurrences/173/last_session

Headers

Accept: application/json
Content-Type: application/json

Body

{
  "start_datetime": "2016-12-22T17:38:42Z",
  "sessions_count": 3
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/recurrences/173/last_session" -d '{"start_datetime":"2016-12-22T17:38:42Z","sessions_count":3}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "last_session": "2017-01-05T17:38:42Z"
}

Calculate all sessions (depending on start date, recurrence and number of sessions)

Endpoint

POST /api/v1/recurrences/:recurrence_id/sessions

Parameters

Name Description
start_datetime required Start date and time
sessions_count required Number of sessions

Request

Route

POST /api/v1/recurrences/174/sessions

Headers

Accept: application/json
Content-Type: application/json

Body

{
  "start_datetime": "2016-12-22T17:38:42Z",
  "sessions_count": 5
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/recurrences/174/sessions" -d '{"start_datetime":"2016-12-22T17:38:42Z","sessions_count":5}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "sessions": {
    "1": "2016-12-22T17:38:42Z",
    "2": "2016-12-29T17:38:42Z",
    "3": "2017-01-05T17:38:42Z",
    "4": "2017-01-12T17:38:42Z",
    "5": "2017-01-19T17:38:42Z"
  }
}

Service Offerings - Group Classes

List group classes for a business

Endpoint

GET /api/v1/businesses/:business_id/classes

Request

Route

GET /api/v1/businesses/65/classes

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/businesses/65/classes" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 1
Content-Type: application/json; charset=utf-8

Body

{
  "group_classes": [
    {
      "id": 183,
      "name": "Ullrich, Jacobs and Von",
      "active": true,
      "session_duration": 60,
      "total_num_sessions": 4,
      "max_students_per_session": 11,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 175,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:42Z",
      "last_session": "2016-12-25T17:38:42Z",
      "subcategory": {
        "id": 268,
        "name": "PBR&B182",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 65,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    }
  ]
}

List group classes for coach user

Endpoint

GET /api/v1/coaches/:coach_id/classes

Request

Route

GET /api/v1/coaches/60/classes

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/coaches/60/classes" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 1
Content-Type: application/json; charset=utf-8

Body

{
  "group_classes": [
    {
      "id": 184,
      "name": "Boehm, Boyle and Schulist",
      "active": true,
      "session_duration": 45,
      "total_num_sessions": 2,
      "max_students_per_session": 10,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 176,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:42Z",
      "last_session": "2016-12-23T17:38:42Z",
      "subcategory": {
        "id": 269,
        "name": "freegan183",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 66,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    }
  ]
}

List group classes for student user

Endpoint

GET /api/v1/students/:student_id/classes

Request

Route

GET /api/v1/students/61/classes

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/students/61/classes" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 1
Content-Type: application/json; charset=utf-8

Body

{
  "group_classes": [
    {
      "id": 185,
      "name": "Jerde, Olson and Hegmann",
      "active": true,
      "session_duration": 30,
      "total_num_sessions": 2,
      "max_students_per_session": 12,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 177,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:42Z",
      "last_session": "2016-12-23T17:38:42Z",
      "subcategory": {
        "id": 270,
        "name": "VHS184",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 1,
      "business_id": 68,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [
        {
          "id": 61,
          "bio": null,
          "business_id": null,
          "created_at": "2016-12-22T17:38:42.558Z",
          "dob": null,
          "first_name": "Eveline",
          "gender": "male",
          "last_name": "Corwin",
          "pic_url": null,
          "profile_description": null,
          "updated_at": "2016-12-22T17:38:42.558Z",
          "user_id": 177
        }
      ],
      "coaches": [

      ]
    }
  ]
}

List archived group classes for coach user

Endpoint

GET /api/v1/coaches/:coach_id/classes

Parameters

Name Description
filter_by[archived] required Archived flag

Request

Route

GET /api/v1/coaches/62/classes?filter_by[archived]=true

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Query Parameters

filter_by={"archived"=>"true"}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/coaches/62/classes?filter_by[archived]=true" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 1
Content-Type: application/json; charset=utf-8

Body

{
  "group_classes": [
    {
      "id": 186,
      "name": "Larkin-Schinner",
      "active": false,
      "session_duration": 90,
      "total_num_sessions": 3,
      "max_students_per_session": 6,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 178,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:42Z",
      "last_session": "2016-12-24T17:38:42Z",
      "subcategory": {
        "id": 271,
        "name": "mlkshk185",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 69,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    }
  ]
}

List archived group classes for student user

Endpoint

GET /api/v1/students/:student_id/classes

Parameters

Name Description
filter_by[archived] required Archived flag

Request

Route

GET /api/v1/students/63/classes?filter_by[archived]=true

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Query Parameters

filter_by={"archived"=>"true"}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/students/63/classes?filter_by[archived]=true" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 1
Content-Type: application/json; charset=utf-8

Body

{
  "group_classes": [
    {
      "id": 187,
      "name": "Howell, Schimmel and Mosciski",
      "active": false,
      "session_duration": 60,
      "total_num_sessions": 3,
      "max_students_per_session": 10,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 179,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:42Z",
      "last_session": "2016-12-24T17:38:42Z",
      "subcategory": {
        "id": 272,
        "name": "chartreuse186",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 1,
      "business_id": 71,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [
        {
          "id": 63,
          "bio": null,
          "business_id": null,
          "created_at": "2016-12-22T17:38:42.767Z",
          "dob": null,
          "first_name": "Jovany",
          "gender": "male",
          "last_name": "Kuhlman",
          "pic_url": null,
          "profile_description": null,
          "updated_at": "2016-12-22T17:38:42.767Z",
          "user_id": 182
        }
      ],
      "coaches": [

      ]
    }
  ]
}

Add new group class for a business

Endpoint

POST /api/v1/businesses/:business_id/classes

Parameters

Name Description Type
service_offering[name] required Name of the class String
service_offering[business_id] required Business ID Integer
service_offering[subcategory_id] required Subcategory ID Integer
service_offering[active] required Class is active or not Boolean
service_offering[session_duration] required How long is a session in this class Integer
service_offering[total_num_sessions] required How many sessions in this class Integer
service_offering[max_students_per_session] required Upto how many student are allowed in each class session Integer
service_offering[booking_type] required Specify all the types of booking allowed for this class from [`selfservice`, `requestbooking`, `staffbooking`]. Null value indicates all three types of booking are allowed. Array
service_offering[start_datetime] required Start date and time of a class String
service_offering[recurrence_id] required Repeatedness of a class - ID Integer
service_offering[code] Any book keeping code for reasons such as integration with 3rd party point-of-sale or billing systems String
service_offering[description] Detailed description of the class String
service_offering[coach_ids] Array of coach profile IDs of coaches who are assigned to teach this class. Array
service_offering[location][location_type] Location type - custom, online, physical String
service_offering[location][name] Alterbative name for location String
service_offering[location][notes] Location notes String
service_offering[location][physical_location_id] Physical location ID if type - physical Integer

Request

Route

POST /api/v1/businesses/72/classes

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "service_offering": {
    "name": "New class",
    "business_id": 72,
    "subcategory_id": 273,
    "active": true,
    "session_duration": 60,
    "total_num_sessions": 2,
    "max_students_per_session": 5,
    "start_datetime": "2016-12-22T17:38:42Z",
    "recurrence_id": 180,
    "location": {
      "name": "New class"
    }
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/businesses/72/classes" -d '{"service_offering":{"name":"New class","business_id":72,"subcategory_id":273,"active":true,"session_duration":60,"total_num_sessions":2,"max_students_per_session":5,"start_datetime":"2016-12-22T17:38:42Z","recurrence_id":180,"location":{"name":"New class"}}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "group_class": {
    "id": 188,
    "name": "New class",
    "active": true,
    "session_duration": 60,
    "total_num_sessions": 2,
    "max_students_per_session": 5,
    "booking_type": null,
    "code": null,
    "description": null,
    "recurrence": {
      "id": 180,
      "human_name": "Every Thursday at  5:38 PM"
    },
    "start_datetime": "2016-12-22T17:38:42Z",
    "last_session": "2016-12-29T17:38:42Z",
    "subcategory": {
      "id": 273,
      "name": "tofu187",
      "category_id": null,
      "color_code": null,
      "sort_order": null,
      "pic_url": {
      }
    },
    "student_count": 0,
    "business_id": 72,
    "delivery_format": null,
    "service_offering_locations": [
      {
        "id": 17,
        "is_default": true,
        "name": "New class",
        "notes": null,
        "location_type": null,
        "service_offering_id": 188,
        "physical_location": null
      }
    ],
    "students": [

    ],
    "coaches": [

    ]
  }
}

Clone group class

This method creates a new group class based on class identified by :class_id

Endpoint

POST /api/v1/classes/:class_id/clone

Request

Route

POST /api/v1/classes/189/clone

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/classes/189/clone" -d '' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "group_class": {
    "id": 190,
    "name": "Adams-Nader",
    "active": true,
    "session_duration": 120,
    "total_num_sessions": 4,
    "max_students_per_session": 9,
    "booking_type": null,
    "code": null,
    "description": null,
    "recurrence": {
      "id": 181,
      "human_name": "Daily at  5:38 PM "
    },
    "start_datetime": "2016-12-22T17:38:42Z",
    "last_session": "2016-12-25T17:38:42Z",
    "subcategory": {
      "id": 274,
      "name": "sartorial188",
      "category_id": null,
      "color_code": null,
      "sort_order": null,
      "pic_url": {
      }
    },
    "student_count": 0,
    "business_id": 73,
    "delivery_format": "in person",
    "service_offering_locations": [

    ],
    "students": [

    ],
    "coaches": [

    ]
  }
}

Get group class

Endpoint

GET /api/v1/classes/:id

Request

Route

GET /api/v1/classes/191

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/classes/191" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "group_class": {
    "id": 191,
    "name": "Parker, Muller and Larson",
    "active": true,
    "session_duration": 90,
    "total_num_sessions": 2,
    "max_students_per_session": 6,
    "booking_type": null,
    "code": null,
    "description": null,
    "recurrence": {
      "id": 182,
      "human_name": "Daily at  5:38 PM "
    },
    "start_datetime": "2016-12-22T17:38:42Z",
    "last_session": "2016-12-23T17:38:42Z",
    "subcategory": {
      "id": 275,
      "name": "helvetica189",
      "category_id": null,
      "color_code": null,
      "sort_order": null,
      "pic_url": {
      }
    },
    "student_count": 0,
    "business_id": 74,
    "delivery_format": "in person",
    "service_offering_locations": [

    ],
    "students": [

    ],
    "coaches": [

    ]
  }
}

Update group class with coaches

Update group class with new values. For example, with new coach IDs

Endpoint

PUT /api/v1/classes/:id

Parameters

Name Description Type
service_offering[coach_ids] required Array of coach profiles assigned to teach this class Array
service_offering[name] Name of the class String
service_offering[business_id] Business ID Integer
service_offering[subcategory_id] Subcategory ID Integer
service_offering[active] Class is active or not Boolean
service_offering[session_duration] How long is a session in this class Integer
service_offering[total_num_sessions] How many sessions in this class Integer
service_offering[max_students_per_session] Upto how many student are allowed in each class session Integer
service_offering[booking_type] Specify all the types of booking allowed for this class from [`selfservice`, `requestbooking`, `staffbooking`]. Null value indicates all three types of booking are allowed. Array
service_offering[start_datetime] Start date and time of a class String
service_offering[recurrence_id] Repeatedness of a class - ID Integer
service_offering[code] Any book keeping code for reasons such as integration with 3rd party point-of-sale or billing systems String
service_offering[description] Detailed description of the class String
service_offering[location][location_type] Location type - custom, online, physical String
service_offering[location][name] Alterbative name for location String
service_offering[location][notes] Location notes String
service_offering[location][physical_location_id] Physical location ID if type - physical Integer

Request

Route

PUT /api/v1/classes/192

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "service_offering": {
    "coach_ids": [
      64,
      65
    ]
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/classes/192" -d '{"service_offering":{"coach_ids":[64,65]}}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "group_class": {
    "id": 192,
    "name": "Gleason, Lowe and West",
    "active": true,
    "session_duration": 45,
    "total_num_sessions": 5,
    "max_students_per_session": 5,
    "booking_type": null,
    "code": null,
    "description": null,
    "recurrence": {
      "id": 183,
      "human_name": "Daily at  5:38 PM "
    },
    "start_datetime": "2016-12-22T17:38:43Z",
    "last_session": "2016-12-26T17:38:43Z",
    "subcategory": {
      "id": 276,
      "name": "brooklyn190",
      "category_id": null,
      "color_code": null,
      "sort_order": null,
      "pic_url": {
      }
    },
    "student_count": 0,
    "business_id": 75,
    "delivery_format": "in person",
    "service_offering_locations": [

    ],
    "students": [

    ],
    "coaches": [
      {
        "id": 64,
        "first_name": "Constance",
        "last_name": "Will",
        "gender": "male",
        "dob": null,
        "pic_url": null,
        "profile_description": null,
        "business_id": 75,
        "user_id": 187,
        "verified": false
      },
      {
        "id": 65,
        "first_name": "Violette",
        "last_name": "Kassulke",
        "gender": "male",
        "dob": null,
        "pic_url": null,
        "profile_description": null,
        "business_id": 75,
        "user_id": 188,
        "verified": false
      }
    ]
  }
}

Archive group class

Endpoint

POST /api/v1/classes/:id/archive

Request

Route

POST /api/v1/classes/193/archive

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/classes/193/archive" -d '' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "group_class": {
    "id": 193,
    "name": "McGlynn-Wyman",
    "active": false,
    "session_duration": 60,
    "total_num_sessions": 1,
    "max_students_per_session": 12,
    "booking_type": null,
    "code": null,
    "description": null,
    "recurrence": {
      "id": 184,
      "human_name": "Daily at  5:38 PM "
    },
    "start_datetime": "2016-12-22T17:38:43Z",
    "last_session": "2016-12-22T17:38:43Z",
    "subcategory": {
      "id": 277,
      "name": "flexitarian191",
      "category_id": null,
      "color_code": null,
      "sort_order": null,
      "pic_url": {
      }
    },
    "student_count": 0,
    "business_id": 76,
    "delivery_format": "in person",
    "service_offering_locations": [

    ],
    "students": [

    ],
    "coaches": [

    ]
  }
}

Unarchive group class

Endpoint

POST /api/v1/classes/:id/unarchive

Request

Route

POST /api/v1/classes/194/unarchive

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/classes/194/unarchive" -d '' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "group_class": {
    "id": 194,
    "name": "Hamill LLC",
    "active": true,
    "session_duration": 60,
    "total_num_sessions": 5,
    "max_students_per_session": 8,
    "booking_type": null,
    "code": null,
    "description": null,
    "recurrence": {
      "id": 185,
      "human_name": "Daily at  5:38 PM "
    },
    "start_datetime": "2016-12-22T17:38:43Z",
    "last_session": "2016-12-26T17:38:43Z",
    "subcategory": {
      "id": 278,
      "name": "vice192",
      "category_id": null,
      "color_code": null,
      "sort_order": null,
      "pic_url": {
      }
    },
    "student_count": 0,
    "business_id": 77,
    "delivery_format": "in person",
    "service_offering_locations": [

    ],
    "students": [

    ],
    "coaches": [

    ]
  }
}

Remove group class without bookings

Endpoint

DELETE /api/v1/classes/:id

Request

Route

DELETE /api/v1/classes/195

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/classes/195" -d '' -X DELETE \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
}

Remove group class with bookings

This method will output 422 error.

Endpoint

DELETE /api/v1/classes/:id

Request

Route

DELETE /api/v1/classes/196

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/classes/196" -d '' -X DELETE \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

422

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "errors": [
    {
      "status": 422,
      "title": "Group class could not be deleted."
    },
    {
    }
  ]
}

Delete multiple group classes

Endpoint

POST /api/v1/classes/batch_delete

Parameters

Name Description
ids required Array of class IDs to delete

Request

Route

POST /api/v1/classes/batch_delete

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "ids": [
    1,
    2
  ]
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/classes/batch_delete" -d '{"ids":[1,2]}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
}

Archive multiple group classes

Endpoint

POST /api/v1/classes/batch_archive

Parameters

Name Description
ids required Array of class IDs to archive

Request

Route

POST /api/v1/classes/batch_archive

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "ids": [
    1,
    2
  ]
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/classes/batch_archive" -d '{"ids":[1,2]}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
}

Add student to all appointments of group class

Endpoint

POST /api/v1/classes/:id/add_student

Parameters

Name Description
student_id required Student profile ID

Request

Route

POST /api/v1/classes/197/add_student

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "student_id": 67
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/classes/197/add_student" -d '{"student_id":67}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "group_class": {
    "id": 197,
    "name": "Cummings-McLaughlin",
    "active": true,
    "session_duration": 45,
    "total_num_sessions": 4,
    "max_students_per_session": 4,
    "booking_type": null,
    "code": null,
    "description": null,
    "recurrence": {
      "id": 188,
      "human_name": "Daily at  5:38 PM "
    },
    "start_datetime": "2016-12-22T17:38:43Z",
    "last_session": "2016-12-25T17:38:43Z",
    "subcategory": {
      "id": 281,
      "name": "vice195",
      "category_id": null,
      "color_code": null,
      "sort_order": null,
      "pic_url": {
      }
    },
    "student_count": 1,
    "business_id": 83,
    "delivery_format": "in person",
    "service_offering_locations": [

    ],
    "students": [
      {
        "id": 67,
        "bio": null,
        "business_id": null,
        "created_at": "2016-12-22T17:38:43.428Z",
        "dob": null,
        "first_name": "Lillie",
        "gender": "female",
        "last_name": "Brakus",
        "pic_url": null,
        "profile_description": null,
        "updated_at": "2016-12-22T17:38:43.428Z",
        "user_id": 198
      }
    ],
    "coaches": [

    ]
  }
}

Drop student from all appointments of group class

Endpoint

POST /api/v1/classes/:id/drop_student

Parameters

Name Description
student_id required Student profile ID

Request

Route

POST /api/v1/classes/198/drop_student

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "student_id": 68
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/classes/198/drop_student" -d '{"student_id":68}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "group_class": {
    "id": 198,
    "name": "Lemke-Dare",
    "active": true,
    "session_duration": 90,
    "total_num_sessions": 5,
    "max_students_per_session": 12,
    "booking_type": null,
    "code": null,
    "description": null,
    "recurrence": {
      "id": 189,
      "human_name": "Daily at  5:38 PM "
    },
    "start_datetime": "2016-12-22T17:38:43Z",
    "last_session": "2016-12-26T17:38:43Z",
    "subcategory": {
      "id": 282,
      "name": "fixie196",
      "category_id": null,
      "color_code": null,
      "sort_order": null,
      "pic_url": {
      }
    },
    "student_count": 0,
    "business_id": 84,
    "delivery_format": "in person",
    "service_offering_locations": [

    ],
    "students": [

    ],
    "coaches": [

    ]
  }
}

Service Offerings - Private Lessons

List private lessons of the user

Endpoint

GET /api/v1/users/:user_id/lessons

Request

Route

GET /api/v1/users/201/lessons

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/users/201/lessons" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 1
Content-Type: application/json; charset=utf-8

Body

{
  "private_lessons": [
    {
      "id": 199,
      "name": "Aufderhar, Corwin and Roberts",
      "active": true,
      "session_duration": 30,
      "total_num_sessions": 1,
      "max_students_per_session": 1,
      "booking_type": null,
      "code": null,
      "description": null,
      "business_id": 85,
      "subcategory": {
        "id": 287,
        "name": "authentic197",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [
        {
          "self": {
            "id": 69,
            "first_name": "Madison",
            "last_name": "Lemke",
            "gender": "female",
            "dob": null,
            "pic_url": null,
            "bio": null,
            "user_id": 201,
            "verified": false
          },
          "next_session_date": "2016-12-22T17:38:43.641Z",
          "pending_sessions": 0,
          "upcoming_sessions": 0,
          "completed_sessions": 0
        }
      ],
      "coaches": [

      ]
    }
  ]
}

List private lessons for a business

Endpoint

GET /api/v1/businesses/:business_id/lessons

Request

Route

GET /api/v1/businesses/86/lessons

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/businesses/86/lessons" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 1
Content-Type: application/json; charset=utf-8

Body

{
  "private_lessons": [
    {
      "id": 200,
      "name": "Kuvalis-Ondricka",
      "active": true,
      "session_duration": 120,
      "total_num_sessions": 1,
      "max_students_per_session": 2,
      "booking_type": null,
      "code": null,
      "description": null,
      "business_id": 86,
      "subcategory": {
        "id": 292,
        "name": "tousled198",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    }
  ]
}

List used and other lessons for current user

Endpoint

GET /api/v1/businesses/:business_id/user_lessons

Request

Route

GET /api/v1/businesses/87/user_lessons

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=8mu7szizjc4wd3hhe725qv9u75omnzaijo8i8prqdvi7epvx2zarqnvcyee9p0xk

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/businesses/87/user_lessons" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=8mu7szizjc4wd3hhe725qv9u75omnzaijo8i8prqdvi7epvx2zarqnvcyee9p0xk"

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "user_lessons": {
    "used_lessons": [
      {
        "id": 201,
        "active": true,
        "booking_type": null,
        "business_id": 87,
        "code": null,
        "created_at": "2016-12-22T17:38:43.817Z",
        "delivery_format": "in person",
        "description": null,
        "max_students_per_session": 2,
        "name": "Nikolaus, Hyatt and Ryan",
        "recurrence_id": null,
        "session_duration": 90,
        "start_datetime": null,
        "subcategory_id": 297,
        "total_num_sessions": 1,
        "updated_at": "2016-12-22T17:38:43.817Z"
      }
    ],
    "other_lessons": [
      {
        "id": 202,
        "active": true,
        "booking_type": null,
        "business_id": 87,
        "code": null,
        "created_at": "2016-12-22T17:38:43.823Z",
        "delivery_format": "in person",
        "description": null,
        "max_students_per_session": 2,
        "name": "Walter-Leffler",
        "recurrence_id": null,
        "session_duration": 30,
        "start_datetime": null,
        "subcategory_id": 298,
        "total_num_sessions": 1,
        "updated_at": "2016-12-22T17:38:43.823Z"
      }
    ]
  }
}

List private lessons for coach user

Endpoint

GET /api/v1/coaches/:coach_id/lessons

Request

Route

GET /api/v1/coaches/71/lessons

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/coaches/71/lessons" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 1
Content-Type: application/json; charset=utf-8

Body

{
  "private_lessons": [
    {
      "id": 203,
      "name": "Wolf, Senger and Brekke",
      "active": true,
      "session_duration": 60,
      "total_num_sessions": 1,
      "max_students_per_session": 1,
      "booking_type": null,
      "code": null,
      "description": null,
      "business_id": 88,
      "subcategory": {
        "id": 303,
        "name": "loko201",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    }
  ]
}

List private lessons for student user

Endpoint

GET /api/v1/students/:student_id/lessons

Request

Route

GET /api/v1/students/72/lessons

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/students/72/lessons" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 1
Content-Type: application/json; charset=utf-8

Body

{
  "private_lessons": [
    {
      "id": 204,
      "name": "Corwin, Bogisich and Kertzmann",
      "active": true,
      "session_duration": 45,
      "total_num_sessions": 1,
      "max_students_per_session": 1,
      "booking_type": null,
      "code": null,
      "description": null,
      "business_id": 90,
      "subcategory": {
        "id": 308,
        "name": "synth202",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [
        {
          "self": {
            "id": 72,
            "first_name": "Liza",
            "last_name": "Cole",
            "gender": "female",
            "dob": null,
            "pic_url": null,
            "bio": null,
            "user_id": 211,
            "verified": false
          },
          "next_session_date": "2016-12-22T17:38:44.043Z",
          "pending_sessions": 0,
          "upcoming_sessions": 0,
          "completed_sessions": 0
        }
      ],
      "coaches": [

      ]
    }
  ]
}

List archived private lessons for coach user

Can be applied to another list actions of lessons.

Endpoint

GET /api/v1/coaches/:coach_id/lessons

Parameters

Name Description
filter_by[archived] required Archived flag

Request

Route

GET /api/v1/coaches/73/lessons?filter_by[archived]=true

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Query Parameters

filter_by={"archived"=>"true"}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/coaches/73/lessons?filter_by[archived]=true" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 1
Content-Type: application/json; charset=utf-8

Body

{
  "private_lessons": [
    {
      "id": 205,
      "name": "Quigley-Mueller",
      "active": false,
      "session_duration": 60,
      "total_num_sessions": 1,
      "max_students_per_session": 2,
      "booking_type": null,
      "code": null,
      "description": null,
      "business_id": 91,
      "subcategory": {
        "id": 313,
        "name": "leggings203",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    }
  ]
}

List archived private lessons for student user

Can be applied to another list actions of lessons.

Endpoint

GET /api/v1/students/:student_id/lessons

Parameters

Name Description
filter_by[archived] required Archived flag

Request

Route

GET /api/v1/students/74/lessons?filter_by[archived]=true

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Query Parameters

filter_by={"archived"=>"true"}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/students/74/lessons?filter_by[archived]=true" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 1
Content-Type: application/json; charset=utf-8

Body

{
  "private_lessons": [
    {
      "id": 206,
      "name": "Sipes, Leannon and Hills",
      "active": false,
      "session_duration": 30,
      "total_num_sessions": 1,
      "max_students_per_session": 2,
      "booking_type": null,
      "code": null,
      "description": null,
      "business_id": 93,
      "subcategory": {
        "id": 318,
        "name": "etsy204",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [
        {
          "self": {
            "id": 74,
            "first_name": "Dagmar",
            "last_name": "Barrows",
            "gender": "female",
            "dob": null,
            "pic_url": null,
            "bio": null,
            "user_id": 217,
            "verified": false
          },
          "next_session_date": "2016-12-22T17:38:44.244Z",
          "pending_sessions": 0,
          "upcoming_sessions": 0,
          "completed_sessions": 0
        }
      ],
      "coaches": [

      ]
    }
  ]
}

Add new private lesson for a business

Endpoint

POST /api/v1/businesses/:business_id/lessons

Parameters

Name Description Type
service_offering[name] required Name of the lesson String
service_offering[business_id] required Business ID Integer
service_offering[subcategory_id] required Subcategory ID Integer
service_offering[active] required Lesson is active or not Boolean
service_offering[session_duration] required How long is a session in this lesson Integer
service_offering[total_num_sessions] required How many sessions in this lesson. Default to 1 if not sure. Integer
service_offering[max_students_per_session] required Upto how many student are allowed in each session. Typically, 1 or 2 for a private lesson. Integer
service_offering[booking_type] required Specify all the types of booking allowed for this lesson from [`selfservice`, `requestbooking`, `staffbooking`]. Null value indicates all three types of booking are allowed. Array
service_offering[code] Any book keeping code for reasons such as integration with 3rd party point-of-sale or billing systems String
service_offering[description] Detailed description of the lesson String
service_offering[coach_ids] Coach profile IDs of coaches who are allowed to teach this lesson. Null value implies any coach in the business is allowed to. Array
service_offering[location][location_type] Location type - custom, online, physical String
service_offering[location][name] Alterbative name for location String
service_offering[location][notes] Location notes String
service_offering[location][physical_location_id] Physical location ID if type - physical Integer

Request

Route

POST /api/v1/businesses/94/lessons

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "service_offering": {
    "name": "New class",
    "business_id": 94,
    "subcategory_id": 319,
    "active": true,
    "session_duration": 60,
    "total_num_sessions": 1,
    "max_students_per_session": 1,
    "location": {
      "name": "New class"
    }
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/businesses/94/lessons" -d '{"service_offering":{"name":"New class","business_id":94,"subcategory_id":319,"active":true,"session_duration":60,"total_num_sessions":1,"max_students_per_session":1,"location":{"name":"New class"}}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "private_lesson": {
    "id": 207,
    "name": "New class",
    "active": true,
    "session_duration": 60,
    "total_num_sessions": 1,
    "max_students_per_session": 1,
    "booking_type": null,
    "code": null,
    "description": null,
    "business_id": 94,
    "subcategory": {
      "id": 319,
      "name": "Tennis",
      "category_id": 30,
      "color_code": null,
      "sort_order": null,
      "pic_url": {
      }
    },
    "delivery_format": null,
    "service_offering_locations": [
      {
        "id": 18,
        "is_default": true,
        "name": "New class",
        "notes": null,
        "location_type": null,
        "service_offering_id": 207,
        "physical_location": null
      }
    ],
    "students": [

    ],
    "coaches": [

    ]
  }
}

Clone private lesson

This method creates a new lesson based on lesson identified by :lesson_id

Endpoint

POST /api/v1/lessons/:lesson_id/clone

Request

Route

POST /api/v1/lessons/208/clone

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/lessons/208/clone" -d '' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "private_lesson": {
    "id": 209,
    "name": "Moore-Oberbrunner",
    "active": true,
    "session_duration": 30,
    "total_num_sessions": 1,
    "max_students_per_session": 1,
    "booking_type": null,
    "code": null,
    "description": null,
    "business_id": 95,
    "subcategory": {
      "id": 327,
      "name": "humblebrag205",
      "category_id": null,
      "color_code": null,
      "sort_order": null,
      "pic_url": {
      }
    },
    "delivery_format": "in person",
    "service_offering_locations": [

    ],
    "students": [

    ],
    "coaches": [

    ]
  }
}

Get private lesson

Endpoint

GET /api/v1/lessons/:id

Request

Route

GET /api/v1/lessons/210

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/lessons/210" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "private_lesson": {
    "id": 210,
    "name": "DuBuque-Greenholt",
    "active": true,
    "session_duration": 60,
    "total_num_sessions": 1,
    "max_students_per_session": 2,
    "booking_type": null,
    "code": null,
    "description": null,
    "business_id": 96,
    "subcategory": {
      "id": 332,
      "name": "plaid206",
      "category_id": null,
      "color_code": null,
      "sort_order": null,
      "pic_url": {
      }
    },
    "delivery_format": "in person",
    "service_offering_locations": [

    ],
    "students": [

    ],
    "coaches": [

    ]
  }
}

Update private lesson with locations

Update private lesson with new values. For example, with new physical location IDs

Endpoint

PUT /api/v1/lessons/:id

Parameters

Name Description Type
service_offering[subcategory_id] Subcategory ID Integer
service_offering[name] Name of the lesson String
service_offering[active] Lesson is active or not Boolean
service_offering[session_duration] How long is a session in this lesson Integer
service_offering[total_num_sessions] How many sessions in this lesson. Default to 1 if not sure. Integer
service_offering[max_students_per_session] Upto how many student are allowed in each session. Typically, 1 or 2 for a private lesson. Integer
service_offering[booking_type] Specify all the types of booking allowed for this lesson from [`selfservice`, `requestbooking`, `staffbooking`]. Null value indicates all three types of booking are allowed. Array
service_offering[code] Any book keeping code for reasons such as integration with 3rd party point-of-sale or billing systems String
service_offering[description] Detailed description of the lesson String
service_offering[coach_ids] Coach profile IDs of coaches who are allowed to teach this lesson. Null value implies any coach in the business is allowed to. Array
service_offering[location][location_type] Location type - custom, online, physical String
service_offering[location][name] Alterbative name for location String
service_offering[location][notes] Location notes String
service_offering[location][physical_location_id] Physical location ID if type - physical Integer

Request

Route

PUT /api/v1/lessons/211

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "service_offering": {
    "location": {
      "location_type": "physical",
      "notes": "Meet me here",
      "physical_location_id": 23
    }
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/lessons/211" -d '{"service_offering":{"location":{"location_type":"physical","notes":"Meet me here","physical_location_id":23}}}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "private_lesson": {
    "id": 211,
    "name": "Boehm LLC",
    "active": true,
    "session_duration": 120,
    "total_num_sessions": 1,
    "max_students_per_session": 1,
    "booking_type": null,
    "code": null,
    "description": null,
    "business_id": 97,
    "subcategory": {
      "id": 337,
      "name": "VHS207",
      "category_id": null,
      "color_code": null,
      "sort_order": null,
      "pic_url": {
      }
    },
    "delivery_format": "in person",
    "service_offering_locations": [
      {
        "id": 19,
        "is_default": true,
        "name": null,
        "notes": "Meet me here",
        "location_type": "physical",
        "service_offering_id": 211,
        "physical_location": {
          "id": 23,
          "lat": "57.85264837716082",
          "long": "-151.76275939027147",
          "place_id": {
            "google": "ChIJrTLr-GyuEmsRBfy61i59si0"
          },
          "street": null,
          "district": null
        }
      }
    ],
    "students": [

    ],
    "coaches": [

    ]
  }
}

Archive private lesson

Endpoint

POST /api/v1/lessons/:id/archive

Request

Route

POST /api/v1/lessons/212/archive

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/lessons/212/archive" -d '' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "private_lesson": {
    "id": 212,
    "name": "Keebler and Sons",
    "active": false,
    "session_duration": 120,
    "total_num_sessions": 1,
    "max_students_per_session": 2,
    "booking_type": null,
    "code": null,
    "description": null,
    "business_id": 98,
    "subcategory": {
      "id": 342,
      "name": "+1208",
      "category_id": null,
      "color_code": null,
      "sort_order": null,
      "pic_url": {
      }
    },
    "delivery_format": "in person",
    "service_offering_locations": [

    ],
    "students": [

    ],
    "coaches": [

    ]
  }
}

Unarchive private lesson

Endpoint

POST /api/v1/lessons/:id/unarchive

Request

Route

POST /api/v1/lessons/213/unarchive

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/lessons/213/unarchive" -d '' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "private_lesson": {
    "id": 213,
    "name": "Runolfsdottir-Leannon",
    "active": true,
    "session_duration": 30,
    "total_num_sessions": 1,
    "max_students_per_session": 2,
    "booking_type": null,
    "code": null,
    "description": null,
    "business_id": 99,
    "subcategory": {
      "id": 347,
      "name": "health209",
      "category_id": null,
      "color_code": null,
      "sort_order": null,
      "pic_url": {
      }
    },
    "delivery_format": "in person",
    "service_offering_locations": [

    ],
    "students": [

    ],
    "coaches": [

    ]
  }
}

Remove private lesson without bookings

This method will successfully remove private lesson.

Endpoint

DELETE /api/v1/lessons/:id

Request

Route

DELETE /api/v1/lessons/214

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/lessons/214" -d '' -X DELETE \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
}

Remove private lesson with bookings

This method will output 422 error.

Endpoint

DELETE /api/v1/lessons/:id

Request

Route

DELETE /api/v1/lessons/215

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/lessons/215" -d '' -X DELETE \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

422

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "errors": [
    {
      "status": 422,
      "title": "Private lesson could not be deleted."
    },
    {
    }
  ]
}

Delete multiple private lessons

Endpoint

POST /api/v1/lessons/batch_delete

Parameters

Name Description
ids required Array of lesson IDs to delete

Request

Route

POST /api/v1/lessons/batch_delete

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "ids": [
    1,
    2
  ]
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/lessons/batch_delete" -d '{"ids":[1,2]}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
}

Archive multiple private lessons

Endpoint

POST /api/v1/lessons/batch_archive

Parameters

Name Description
ids required Array of lesson IDs to archive

Request

Route

POST /api/v1/lessons/batch_archive

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "ids": [
    1,
    2
  ]
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/lessons/batch_archive" -d '{"ids":[1,2]}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
}

Session - Appointments

List appointments for booking

Endpoint

GET /api/v1/bookings/:booking_id/appointments

Request

Route

GET /api/v1/bookings/31/appointments

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/bookings/31/appointments" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 1
Content-Type: application/json; charset=utf-8

Body

{
  "session_appointments": [
    {
      "id": 29,
      "state": "scheduled",
      "service_offering_type": "PrivateLesson",
      "coaches": [
        {
          "id": 76,
          "first_name": "Deshaun",
          "last_name": "Pouros",
          "gender": "female",
          "dob": null,
          "pic_url": null,
          "profile_description": null,
          "business_id": 106,
          "user_id": 242,
          "verified": false
        }
      ],
      "students": [
        {
          "self": {
            "id": 77,
            "first_name": "Scottie",
            "last_name": "Borer",
            "gender": "female",
            "dob": null,
            "pic_url": null,
            "bio": null,
            "user_id": 247,
            "verified": false
          }
        }
      ],
      "notes": null,
      "start_datetime": "2016-12-22T17:38:45Z",
      "end_datetime": "2016-12-22T19:38:45Z",
      "booking": {
        "id": 31,
        "requester_id": 80,
        "state": "requested",
        "booking_datetime": null,
        "service_offering_location_id": null,
        "booking_coach_id": null,
        "service_offering_type": "PrivateLesson",
        "students": [

        ]
      },
      "service_offering": {
        "id": 216,
        "name": "Cremin-Fadel",
        "active": true,
        "session_duration": 45,
        "total_num_sessions": 1,
        "max_students_per_session": 1,
        "booking_type": null,
        "code": null,
        "description": null,
        "business_id": 105,
        "subcategory": {
          "id": 366,
          "name": "heirloom212",
          "category_id": null,
          "color_code": null,
          "sort_order": null,
          "pic_url": {
          }
        },
        "delivery_format": "in person",
        "service_offering_locations": [
          {
            "id": 20,
            "is_default": true,
            "name": null,
            "notes": "meet in skype",
            "location_type": "online",
            "service_offering_id": 216,
            "physical_location": null
          }
        ],
        "students": [
          {
            "self": {
              "id": 77,
              "first_name": "Scottie",
              "last_name": "Borer",
              "gender": "female",
              "dob": null,
              "pic_url": null,
              "bio": null,
              "user_id": 247,
              "verified": false
            },
            "next_session_date": "2016-12-22T17:38:45.528Z",
            "pending_sessions": 0,
            "upcoming_sessions": 0,
            "completed_sessions": 0
          }
        ],
        "coaches": [

        ]
      },
      "service_offering_location": null
    }
  ]
}

List appointments for a coach

Endpoint

GET /api/v1/coaches/:coach_id/appointments

Request

Route

GET /api/v1/coaches/82/appointments

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/coaches/82/appointments" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 1
Content-Type: application/json; charset=utf-8

Body

{
  "session_appointments": [
    {
      "id": 31,
      "state": "scheduled",
      "service_offering_type": "PrivateLesson",
      "coaches": [
        {
          "id": 82,
          "first_name": "Amina",
          "last_name": "Hackett",
          "gender": "female",
          "dob": null,
          "pic_url": null,
          "profile_description": null,
          "business_id": 112,
          "user_id": 271,
          "verified": false
        }
      ],
      "students": [
        {
          "self": {
            "id": 83,
            "first_name": "Adelia",
            "last_name": "Lind",
            "gender": "female",
            "dob": null,
            "pic_url": null,
            "bio": null,
            "user_id": 276,
            "verified": false
          }
        }
      ],
      "notes": null,
      "start_datetime": "2016-12-22T17:38:46Z",
      "end_datetime": "2016-12-22T19:38:46Z",
      "booking": {
        "id": 33,
        "requester_id": 86,
        "state": "requested",
        "booking_datetime": null,
        "service_offering_location_id": null,
        "booking_coach_id": null,
        "service_offering_type": "PrivateLesson",
        "students": [

        ]
      },
      "service_offering": {
        "id": 220,
        "name": "Kling Inc",
        "active": true,
        "session_duration": 90,
        "total_num_sessions": 1,
        "max_students_per_session": 1,
        "booking_type": null,
        "code": null,
        "description": null,
        "business_id": 111,
        "subcategory": {
          "id": 370,
          "name": "flannel216",
          "category_id": null,
          "color_code": null,
          "sort_order": null,
          "pic_url": {
          }
        },
        "delivery_format": "in person",
        "service_offering_locations": [
          {
            "id": 21,
            "is_default": true,
            "name": null,
            "notes": "meet in skype",
            "location_type": "online",
            "service_offering_id": 220,
            "physical_location": null
          }
        ],
        "students": [
          {
            "self": {
              "id": 83,
              "first_name": "Adelia",
              "last_name": "Lind",
              "gender": "female",
              "dob": null,
              "pic_url": null,
              "bio": null,
              "user_id": 276,
              "verified": false
            },
            "next_session_date": "2016-12-22T17:38:46.305Z",
            "pending_sessions": 0,
            "upcoming_sessions": 0,
            "completed_sessions": 0
          }
        ],
        "coaches": [

        ]
      },
      "service_offering_location": null
    }
  ]
}

List appointments for a class

Endpoint

GET /api/v1/classes/:class_id/appointments

Request

Route

GET /api/v1/classes/225/appointments

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/classes/225/appointments" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 1
Content-Type: application/json; charset=utf-8

Body

{
  "session_appointments": [
    {
      "id": 34,
      "state": "scheduled",
      "service_offering_type": "GroupClass",
      "coaches": [

      ],
      "students": [

      ],
      "notes": null,
      "start_datetime": "2016-12-22T17:38:46Z",
      "end_datetime": "2016-12-22T19:38:46Z",
      "booking": {
        "id": 36,
        "requester_id": 93,
        "state": "requested",
        "booking_datetime": null,
        "service_offering_location_id": null,
        "booking_coach_id": null,
        "service_offering_type": "GroupClass",
        "students": [

        ]
      },
      "service_offering": {
        "id": 225,
        "name": "Koss-Haley",
        "active": true,
        "session_duration": 45,
        "total_num_sessions": 4,
        "max_students_per_session": 1,
        "booking_type": null,
        "code": null,
        "description": null,
        "recurrence": {
          "id": 194,
          "human_name": "Daily at  5:38 PM "
        },
        "start_datetime": "2016-12-22T17:38:46Z",
        "last_session": "2016-12-25T17:38:46Z",
        "subcategory": {
          "id": 375,
          "name": "drinking221",
          "category_id": null,
          "color_code": null,
          "sort_order": null,
          "pic_url": {
          }
        },
        "student_count": 0,
        "business_id": 117,
        "delivery_format": "in person",
        "service_offering_locations": [

        ],
        "students": [

        ],
        "coaches": [

        ]
      },
      "service_offering_location": null
    }
  ]
}

List appointments for a coach with filtering on start date

This example uses filtering and can be applied to other list actions of appointments.

Endpoint

GET /api/v1/coaches/:coach_id/appointments

Parameters

Name Description
filter_by[start_date] required Start datetime (UTC, iso8601) to filter results
filter_by[end_date] required End datetime (UTC, iso8601) to filter results

Request

Route

GET /api/v1/coaches/94/appointments?filter_by[start_date]=2016-12-22T17%3A38%3A47Z&filter_by[end_date]=2016-12-22T18%3A08%3A47Z

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Query Parameters

filter_by={"start_date"=>"2016-12-22T17:38:47Z", "end_date"=>"2016-12-22T18:08:47Z"}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/coaches/94/appointments?filter_by[start_date]=2016-12-22T17%3A38%3A47Z&filter_by[end_date]=2016-12-22T18%3A08%3A47Z" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 1
Content-Type: application/json; charset=utf-8

Body

{
  "session_appointments": [
    {
      "id": 35,
      "state": "scheduled",
      "service_offering_type": "PrivateLesson",
      "coaches": [
        {
          "id": 94,
          "first_name": "Taylor",
          "last_name": "Daugherty",
          "gender": "male",
          "dob": null,
          "pic_url": null,
          "profile_description": null,
          "business_id": 124,
          "user_id": 329,
          "verified": false
        }
      ],
      "students": [
        {
          "self": {
            "id": 95,
            "first_name": "Palma",
            "last_name": "Nitzsche",
            "gender": "male",
            "dob": null,
            "pic_url": null,
            "bio": null,
            "user_id": 334,
            "verified": false
          }
        }
      ],
      "notes": null,
      "start_datetime": "2016-12-22T17:38:47Z",
      "end_datetime": "2016-12-22T18:38:47Z",
      "booking": {
        "id": 37,
        "requester_id": 98,
        "state": "requested",
        "booking_datetime": null,
        "service_offering_location_id": null,
        "booking_coach_id": null,
        "service_offering_type": "PrivateLesson",
        "students": [

        ]
      },
      "service_offering": {
        "id": 228,
        "name": "Wuckert-Heidenreich",
        "active": true,
        "session_duration": 90,
        "total_num_sessions": 1,
        "max_students_per_session": 2,
        "booking_type": null,
        "code": null,
        "description": null,
        "business_id": 123,
        "subcategory": {
          "id": 378,
          "name": "keffiyeh224",
          "category_id": null,
          "color_code": null,
          "sort_order": null,
          "pic_url": {
          }
        },
        "delivery_format": "in person",
        "service_offering_locations": [
          {
            "id": 23,
            "is_default": true,
            "name": null,
            "notes": "meet in skype",
            "location_type": "online",
            "service_offering_id": 228,
            "physical_location": null
          }
        ],
        "students": [
          {
            "self": {
              "id": 95,
              "first_name": "Palma",
              "last_name": "Nitzsche",
              "gender": "male",
              "dob": null,
              "pic_url": null,
              "bio": null,
              "user_id": 334,
              "verified": false
            },
            "next_session_date": "2016-12-22T17:38:47.427Z",
            "pending_sessions": 0,
            "upcoming_sessions": 0,
            "completed_sessions": 0
          }
        ],
        "coaches": [

        ]
      },
      "service_offering_location": null
    }
  ]
}

List appointments for a lesson

Endpoint

GET /api/v1/lessons/:lesson_id/appointments

Request

Route

GET /api/v1/lessons/232/appointments

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/lessons/232/appointments" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 1
Content-Type: application/json; charset=utf-8

Body

{
  "session_appointments": [
    {
      "id": 37,
      "state": "scheduled",
      "service_offering_type": "PrivateLesson",
      "coaches": [
        {
          "id": 100,
          "first_name": "Beatrice",
          "last_name": "Schiller",
          "gender": "female",
          "dob": null,
          "pic_url": null,
          "profile_description": null,
          "business_id": 130,
          "user_id": 358,
          "verified": false
        }
      ],
      "students": [
        {
          "self": {
            "id": 101,
            "first_name": "Heidi",
            "last_name": "Funk",
            "gender": "male",
            "dob": null,
            "pic_url": null,
            "bio": null,
            "user_id": 363,
            "verified": false
          }
        }
      ],
      "notes": null,
      "start_datetime": "2016-12-22T17:38:48Z",
      "end_datetime": "2016-12-22T19:08:48Z",
      "booking": {
        "id": 39,
        "requester_id": 104,
        "state": "requested",
        "booking_datetime": null,
        "service_offering_location_id": null,
        "booking_coach_id": null,
        "service_offering_type": "PrivateLesson",
        "students": [

        ]
      },
      "service_offering": {
        "id": 232,
        "name": "McCullough, Dach and Reynolds",
        "active": true,
        "session_duration": 30,
        "total_num_sessions": 1,
        "max_students_per_session": 1,
        "booking_type": null,
        "code": null,
        "description": null,
        "business_id": 129,
        "subcategory": {
          "id": 382,
          "name": "Thundercats228",
          "category_id": null,
          "color_code": null,
          "sort_order": null,
          "pic_url": {
          }
        },
        "delivery_format": "in person",
        "service_offering_locations": [
          {
            "id": 24,
            "is_default": true,
            "name": null,
            "notes": "meet in skype",
            "location_type": "online",
            "service_offering_id": 232,
            "physical_location": null
          }
        ],
        "students": [
          {
            "self": {
              "id": 101,
              "first_name": "Heidi",
              "last_name": "Funk",
              "gender": "male",
              "dob": null,
              "pic_url": null,
              "bio": null,
              "user_id": 363,
              "verified": false
            },
            "next_session_date": "2016-12-22T17:38:48.009Z",
            "pending_sessions": 0,
            "upcoming_sessions": 0,
            "completed_sessions": 0
          }
        ],
        "coaches": [

        ]
      },
      "service_offering_location": null
    }
  ]
}

List appointments for a business

Endpoint

GET /api/v1/businesses/:business_id/appointments

Request

Route

GET /api/v1/businesses/135/appointments

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/businesses/135/appointments" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 2
Content-Type: application/json; charset=utf-8

Body

{
  "session_appointments": [
    {
      "id": 40,
      "state": "scheduled",
      "service_offering_type": "GroupClass",
      "coaches": [

      ],
      "students": [

      ],
      "notes": null,
      "start_datetime": "2016-12-22T17:38:48Z",
      "end_datetime": "2016-12-22T19:38:48Z",
      "booking": {
        "id": 42,
        "requester_id": 111,
        "state": "requested",
        "booking_datetime": null,
        "service_offering_location_id": null,
        "booking_coach_id": null,
        "service_offering_type": "GroupClass",
        "students": [

        ]
      },
      "service_offering": {
        "id": 237,
        "name": "Zieme, Hodkiewicz and Romaguera",
        "active": true,
        "session_duration": 120,
        "total_num_sessions": 2,
        "max_students_per_session": 9,
        "booking_type": null,
        "code": null,
        "description": null,
        "recurrence": {
          "id": 200,
          "human_name": "Daily at  5:38 PM "
        },
        "start_datetime": "2016-12-22T17:38:48Z",
        "last_session": "2016-12-23T17:38:48Z",
        "subcategory": {
          "id": 387,
          "name": "lomo233",
          "category_id": null,
          "color_code": null,
          "sort_order": null,
          "pic_url": {
          }
        },
        "student_count": 0,
        "business_id": 135,
        "delivery_format": "in person",
        "service_offering_locations": [

        ],
        "students": [

        ],
        "coaches": [

        ]
      },
      "service_offering_location": null
    },
    {
      "id": 39,
      "state": "scheduled",
      "service_offering_type": "PrivateLesson",
      "coaches": [
        {
          "id": 106,
          "first_name": "Horacio",
          "last_name": "Gaylord",
          "gender": "female",
          "dob": null,
          "pic_url": null,
          "profile_description": null,
          "business_id": 136,
          "user_id": 387,
          "verified": false
        }
      ],
      "students": [
        {
          "self": {
            "id": 107,
            "first_name": "Guy",
            "last_name": "Stamm",
            "gender": "female",
            "dob": null,
            "pic_url": null,
            "bio": null,
            "user_id": 392,
            "verified": false
          }
        }
      ],
      "notes": null,
      "start_datetime": "2016-12-22T17:38:48Z",
      "end_datetime": "2016-12-22T18:08:48Z",
      "booking": {
        "id": 41,
        "requester_id": 110,
        "state": "requested",
        "booking_datetime": null,
        "service_offering_location_id": null,
        "booking_coach_id": null,
        "service_offering_type": "PrivateLesson",
        "students": [

        ]
      },
      "service_offering": {
        "id": 236,
        "name": "Sawayn and Sons",
        "active": true,
        "session_duration": 120,
        "total_num_sessions": 1,
        "max_students_per_session": 2,
        "booking_type": null,
        "code": null,
        "description": null,
        "business_id": 135,
        "subcategory": {
          "id": 386,
          "name": "biodiesel232",
          "category_id": null,
          "color_code": null,
          "sort_order": null,
          "pic_url": {
          }
        },
        "delivery_format": "in person",
        "service_offering_locations": [
          {
            "id": 25,
            "is_default": true,
            "name": null,
            "notes": "meet in skype",
            "location_type": "online",
            "service_offering_id": 236,
            "physical_location": null
          }
        ],
        "students": [
          {
            "self": {
              "id": 107,
              "first_name": "Guy",
              "last_name": "Stamm",
              "gender": "female",
              "dob": null,
              "pic_url": null,
              "bio": null,
              "user_id": 392,
              "verified": false
            },
            "next_session_date": "2016-12-22T17:38:48.588Z",
            "pending_sessions": 0,
            "upcoming_sessions": 0,
            "completed_sessions": 0
          }
        ],
        "coaches": [

        ]
      },
      "service_offering_location": null
    }
  ]
}

List appointments for a student

Endpoint

GET /api/v1/students/:student_id/appointments

Request

Route

GET /api/v1/students/113/appointments

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/students/113/appointments" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 1
Content-Type: application/json; charset=utf-8

Body

{
  "session_appointments": [
    {
      "id": 41,
      "state": "scheduled",
      "service_offering_type": "PrivateLesson",
      "coaches": [
        {
          "id": 112,
          "first_name": "Aisha",
          "last_name": "Turner",
          "gender": "female",
          "dob": null,
          "pic_url": null,
          "profile_description": null,
          "business_id": 142,
          "user_id": 416,
          "verified": false
        }
      ],
      "students": [
        {
          "self": {
            "id": 113,
            "first_name": "Ethel",
            "last_name": "Satterfield",
            "gender": "female",
            "dob": null,
            "pic_url": null,
            "bio": null,
            "user_id": 421,
            "verified": false
          }
        }
      ],
      "notes": null,
      "start_datetime": "2016-12-22T17:38:49Z",
      "end_datetime": "2016-12-22T18:38:49Z",
      "booking": {
        "id": 43,
        "requester_id": 116,
        "state": "requested",
        "booking_datetime": null,
        "service_offering_location_id": null,
        "booking_coach_id": null,
        "service_offering_type": "PrivateLesson",
        "students": [

        ]
      },
      "service_offering": {
        "id": 240,
        "name": "Gerlach-Pfeffer",
        "active": true,
        "session_duration": 30,
        "total_num_sessions": 1,
        "max_students_per_session": 2,
        "booking_type": null,
        "code": null,
        "description": null,
        "business_id": 141,
        "subcategory": {
          "id": 390,
          "name": "marfa236",
          "category_id": null,
          "color_code": null,
          "sort_order": null,
          "pic_url": {
          }
        },
        "delivery_format": "in person",
        "service_offering_locations": [
          {
            "id": 26,
            "is_default": true,
            "name": null,
            "notes": "meet in skype",
            "location_type": "online",
            "service_offering_id": 240,
            "physical_location": null
          }
        ],
        "students": [
          {
            "self": {
              "id": 113,
              "first_name": "Ethel",
              "last_name": "Satterfield",
              "gender": "female",
              "dob": null,
              "pic_url": null,
              "bio": null,
              "user_id": 421,
              "verified": false
            },
            "next_session_date": "2016-12-22T17:38:49.176Z",
            "pending_sessions": 0,
            "upcoming_sessions": 0,
            "completed_sessions": 0
          }
        ],
        "coaches": [

        ]
      },
      "service_offering_location": null
    }
  ]
}

List appointments for a user filtering on service offering

This example uses filtering and can be applied to other list actions of appointments.

Endpoint

GET /api/v1/users/:user_id/appointments

Parameters

Name Description
filter_by[service_offering_id] required Service offering (clas/lesson) ID to filter

Request

Route

GET /api/v1/users/444/appointments?filter_by[service_offering_id]=244

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Query Parameters

filter_by={"service_offering_id"=>"244"}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/users/444/appointments?filter_by[service_offering_id]=244" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 0
Content-Type: application/json; charset=utf-8

Body

{
  "session_appointments": [

  ]
}

List appointments for a user

Endpoint

GET /api/v1/users/:user_id/appointments

Request

Route

GET /api/v1/users/473/appointments

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/users/473/appointments" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 0
Content-Type: application/json; charset=utf-8

Body

{
  "session_appointments": [

  ]
}

Add new appointment to a class

Endpoint

POST /api/v1/classes/:class_id/appointments

Parameters

Name Description
session_appointment[start_datetime] required Start date and time of appointment
session_appointment[end_datetime] required End date and time of appointment
session_appointment[coach_ids] required Array of coach profile IDs
session_appointment[student_ids] required Array of student profile IDs
session_appointment[state] required State of appointment, default - scheduled, no need to pass this param on creation
session_appointment[notes] required Notes about appointment
session_appointment[service_offering_location_id] required ID of a service offering location
session_appointment[booking_id] required Booking ID

Request

Route

POST /api/v1/classes/253/appointments

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "session_appointment": {
    "start_datetime": "2016-12-22T17:38:51Z",
    "end_datetime": "2016-12-22T18:08:51Z",
    "booking_id": 50
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/classes/253/appointments" -d '{"session_appointment":{"start_datetime":"2016-12-22T17:38:51Z","end_datetime":"2016-12-22T18:08:51Z","booking_id":50}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "session_appointment": {
    "id": 49,
    "state": "scheduled",
    "service_offering_type": "GroupClass",
    "coaches": [

    ],
    "students": [

    ],
    "notes": null,
    "start_datetime": "2016-12-22T17:38:51Z",
    "end_datetime": "2016-12-22T18:08:51Z",
    "booking": {
      "id": 50,
      "requester_id": 135,
      "state": "requested",
      "booking_datetime": null,
      "service_offering_location_id": null,
      "booking_coach_id": null,
      "service_offering_type": "GroupClass",
      "students": [

      ]
    },
    "service_offering": {
      "id": 253,
      "name": "Schneider, Pagac and Olson",
      "active": true,
      "session_duration": 90,
      "total_num_sessions": 2,
      "max_students_per_session": 9,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 208,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:50Z",
      "last_session": "2016-12-23T17:38:50Z",
      "subcategory": {
        "id": 403,
        "name": "master249",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 159,
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    },
    "service_offering_location": null
  }
}

Add new appointment to a lesson

Endpoint

POST /api/v1/lessons/:lesson_id/appointments

Parameters

Name Description
session_appointment[start_datetime] required Start date and time of appointment
session_appointment[end_datetime] required End date and time of appointment
session_appointment[student_ids] required Array of student profile IDs
session_appointment[coach_ids] required Array of coach profile IDs
session_appointment[state] required State of appointment, default - scheduled, no need to pass this param on creation
session_appointment[notes] required Notes about appointment
session_appointment[service_offering_location_id] required ID of a service offering location
session_appointment[booking_id] required Booking ID

Request

Route

POST /api/v1/lessons/256/appointments

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "session_appointment": {
    "start_datetime": "2016-12-22T17:38:51Z",
    "end_datetime": "2016-12-22T18:38:51Z",
    "student_ids": [
      137,
      138
    ],
    "booking_id": 51
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/lessons/256/appointments" -d '{"session_appointment":{"start_datetime":"2016-12-22T17:38:51Z","end_datetime":"2016-12-22T18:38:51Z","student_ids":[137,138],"booking_id":51}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "session_appointment": {
    "id": 52,
    "state": "scheduled",
    "service_offering_type": "PrivateLesson",
    "coaches": [

    ],
    "students": [
      {
        "self": {
          "id": 137,
          "first_name": "Wilburn",
          "last_name": "Witting",
          "gender": "male",
          "dob": null,
          "pic_url": null,
          "bio": null,
          "user_id": 537,
          "verified": false
        }
      },
      {
        "child": {
          "id": 138,
          "first_name": "Edison",
          "last_name": "Ferry",
          "gender": "male",
          "dob": null,
          "pic_url": null,
          "bio": null,
          "user_id": 553,
          "verified": false
        },
        "self": {
          "id": 139,
          "first_name": "Jason",
          "last_name": "Bogisich",
          "gender": "female",
          "dob": null,
          "pic_url": null,
          "bio": null,
          "user_id": 553,
          "verified": false
        }
      }
    ],
    "notes": null,
    "start_datetime": "2016-12-22T17:38:51Z",
    "end_datetime": "2016-12-22T18:38:51Z",
    "booking": {
      "id": 51,
      "requester_id": 140,
      "state": "requested",
      "booking_datetime": null,
      "service_offering_location_id": null,
      "booking_coach_id": null,
      "service_offering_type": "PrivateLesson",
      "students": [

      ]
    },
    "service_offering": {
      "id": 256,
      "name": "Hartmann, McClure and Thiel",
      "active": true,
      "session_duration": 90,
      "total_num_sessions": 1,
      "max_students_per_session": 2,
      "booking_type": null,
      "code": null,
      "description": null,
      "business_id": 165,
      "subcategory": {
        "id": 406,
        "name": "kickstarter252",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "delivery_format": "in person",
      "service_offering_locations": [
        {
          "id": 30,
          "is_default": true,
          "name": null,
          "notes": "meet in skype",
          "location_type": "online",
          "service_offering_id": 256,
          "physical_location": null
        }
      ],
      "students": [
        {
          "self": {
            "id": 137,
            "first_name": "Wilburn",
            "last_name": "Witting",
            "gender": "male",
            "dob": null,
            "pic_url": null,
            "bio": null,
            "user_id": 537,
            "verified": false
          },
          "next_session_date": "2016-12-22T17:38:51.000Z",
          "pending_sessions": 0,
          "upcoming_sessions": 0,
          "completed_sessions": 0
        },
        {
          "child": {
            "id": 138,
            "first_name": "Edison",
            "last_name": "Ferry",
            "gender": "male",
            "dob": null,
            "pic_url": null,
            "bio": null,
            "user_id": 553,
            "verified": false
          },
          "self": {
            "id": 139,
            "first_name": "Jason",
            "last_name": "Bogisich",
            "gender": "female",
            "dob": null,
            "pic_url": null,
            "bio": null,
            "user_id": 553,
            "verified": false
          },
          "next_session_date": "2016-12-22T17:38:51.000Z",
          "pending_sessions": 0,
          "upcoming_sessions": 0,
          "completed_sessions": 0
        }
      ],
      "coaches": [

      ]
    },
    "service_offering_location": null
  }
}

Get session appointment

Endpoint

GET /api/v1/appointments/:id

Request

Route

GET /api/v1/appointments/55

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/appointments/55" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "session_appointment": {
    "id": 55,
    "state": "scheduled",
    "service_offering_type": "PrivateLesson",
    "coaches": [
      {
        "id": 142,
        "first_name": "Alejandrin",
        "last_name": "Von",
        "gender": "male",
        "dob": null,
        "pic_url": null,
        "profile_description": null,
        "business_id": 172,
        "user_id": 561,
        "verified": false
      }
    ],
    "students": [
      {
        "self": {
          "id": 143,
          "first_name": "Rylee",
          "last_name": "McClure",
          "gender": "male",
          "dob": null,
          "pic_url": null,
          "bio": null,
          "user_id": 566,
          "verified": false
        }
      }
    ],
    "notes": null,
    "start_datetime": "2016-12-22T17:38:52Z",
    "end_datetime": "2016-12-22T19:38:52Z",
    "booking": {
      "id": 53,
      "requester_id": 146,
      "state": "requested",
      "booking_datetime": null,
      "service_offering_location_id": null,
      "booking_coach_id": null,
      "service_offering_type": "PrivateLesson",
      "students": [

      ]
    },
    "service_offering": {
      "id": 260,
      "name": "Bradtke-Jerde",
      "active": true,
      "session_duration": 120,
      "total_num_sessions": 1,
      "max_students_per_session": 1,
      "booking_type": null,
      "code": null,
      "description": null,
      "business_id": 171,
      "subcategory": {
        "id": 410,
        "name": "offal256",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "delivery_format": "in person",
      "service_offering_locations": [
        {
          "id": 31,
          "is_default": true,
          "name": null,
          "notes": "meet in skype",
          "location_type": "online",
          "service_offering_id": 260,
          "physical_location": null
        }
      ],
      "students": [
        {
          "self": {
            "id": 143,
            "first_name": "Rylee",
            "last_name": "McClure",
            "gender": "male",
            "dob": null,
            "pic_url": null,
            "bio": null,
            "user_id": 566,
            "verified": false
          },
          "next_session_date": "2016-12-22T17:38:52.314Z",
          "pending_sessions": 0,
          "upcoming_sessions": 0,
          "completed_sessions": 0
        }
      ],
      "coaches": [

      ]
    },
    "service_offering_location": {
      "id": 31,
      "is_default": true,
      "name": null,
      "notes": "meet in skype",
      "location_type": "online",
      "service_offering_id": 260,
      "physical_location": null
    }
  }
}

Update session appointment for its state

Endpoint

PUT /api/v1/appointments/:id

Parameters

Name Description
session_appointment[state] required State of appointment, default - scheduled, no need to pass this param on creation
session_appointment[coach_ids] Array of coach profiles IDs
session_appointment[student_ids] Array of student profiles IDs
session_appointment[start_datetime] Start date and time of appointment
session_appointment[end_datetime] End date and time of appointment
session_appointment[notes] Notes about appointment
session_appointment[location_notes] Notes about online
session_appointment[service_offering_location_id] ID of a physical location
session_appointment[booking_id] Booking ID

Request

Route

PUT /api/v1/appointments/56

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "session_appointment": {
    "state": "canceled"
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/appointments/56" -d '{"session_appointment":{"state":"canceled"}}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "session_appointment": {
    "id": 56,
    "state": "canceled",
    "service_offering_type": "PrivateLesson",
    "coaches": [
      {
        "id": 148,
        "first_name": "Ariane",
        "last_name": "Fay",
        "gender": "male",
        "dob": null,
        "pic_url": null,
        "profile_description": null,
        "business_id": 178,
        "user_id": 590,
        "verified": false
      }
    ],
    "students": [
      {
        "self": {
          "id": 149,
          "first_name": "Phoebe",
          "last_name": "Mayer",
          "gender": "male",
          "dob": null,
          "pic_url": null,
          "bio": null,
          "user_id": 595,
          "verified": false
        }
      }
    ],
    "notes": null,
    "start_datetime": "2016-12-22T17:38:53Z",
    "end_datetime": "2016-12-22T18:38:53Z",
    "booking": {
      "id": 55,
      "requester_id": 152,
      "state": "requested",
      "booking_datetime": null,
      "service_offering_location_id": null,
      "booking_coach_id": null,
      "service_offering_type": "PrivateLesson",
      "students": [

      ]
    },
    "service_offering": {
      "id": 264,
      "name": "Schaefer LLC",
      "active": true,
      "session_duration": 60,
      "total_num_sessions": 1,
      "max_students_per_session": 2,
      "booking_type": null,
      "code": null,
      "description": null,
      "business_id": 177,
      "subcategory": {
        "id": 414,
        "name": "PBR&B260",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "delivery_format": "in person",
      "service_offering_locations": [
        {
          "id": 32,
          "is_default": true,
          "name": null,
          "notes": "meet in skype",
          "location_type": "online",
          "service_offering_id": 264,
          "physical_location": null
        }
      ],
      "students": [
        {
          "self": {
            "id": 149,
            "first_name": "Phoebe",
            "last_name": "Mayer",
            "gender": "male",
            "dob": null,
            "pic_url": null,
            "bio": null,
            "user_id": 595,
            "verified": false
          },
          "next_session_date": null,
          "pending_sessions": 0,
          "upcoming_sessions": 0,
          "completed_sessions": 0
        }
      ],
      "coaches": [

      ]
    },
    "service_offering_location": null
  }
}

Update session appointment for its coaches

Endpoint

PUT /api/v1/appointments/:id

Parameters

Name Description
session_appointment[coach_ids] required Array of coach profiles IDs
session_appointment[student_ids] Array of student profile IDs
session_appointment[state] State of appointment, default - scheduled, no need to pass this param on creation
session_appointment[start_datetime] Start date and time of appointment
session_appointment[end_datetime] End date and time of appointment
session_appointment[notes] Notes about appointment
session_appointment[location_notes] Notes about online
session_appointment[service_offering_location_id] ID of a physical location
session_appointment[booking_id] Booking ID

Request

Route

PUT /api/v1/appointments/58

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "session_appointment": {
    "coach_ids": [
      154
    ]
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/appointments/58" -d '{"session_appointment":{"coach_ids":[154]}}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "session_appointment": {
    "id": 58,
    "state": "scheduled",
    "service_offering_type": "PrivateLesson",
    "coaches": [
      {
        "id": 154,
        "first_name": "Sydni",
        "last_name": "Hagenes",
        "gender": "female",
        "dob": null,
        "pic_url": null,
        "profile_description": null,
        "business_id": 184,
        "user_id": 619,
        "verified": false
      }
    ],
    "students": [
      {
        "self": {
          "id": 155,
          "first_name": "Blaise",
          "last_name": "Beer",
          "gender": "female",
          "dob": null,
          "pic_url": null,
          "bio": null,
          "user_id": 624,
          "verified": false
        }
      }
    ],
    "notes": null,
    "start_datetime": "2016-12-22T17:38:53Z",
    "end_datetime": "2016-12-22T19:38:53Z",
    "booking": {
      "id": 57,
      "requester_id": 158,
      "state": "requested",
      "booking_datetime": null,
      "service_offering_location_id": null,
      "booking_coach_id": null,
      "service_offering_type": "PrivateLesson",
      "students": [

      ]
    },
    "service_offering": {
      "id": 268,
      "name": "Miller-Roob",
      "active": true,
      "session_duration": 45,
      "total_num_sessions": 1,
      "max_students_per_session": 1,
      "booking_type": null,
      "code": null,
      "description": null,
      "business_id": 183,
      "subcategory": {
        "id": 418,
        "name": "mlkshk264",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "delivery_format": "in person",
      "service_offering_locations": [
        {
          "id": 33,
          "is_default": true,
          "name": null,
          "notes": "meet in skype",
          "location_type": "online",
          "service_offering_id": 268,
          "physical_location": null
        }
      ],
      "students": [
        {
          "self": {
            "id": 155,
            "first_name": "Blaise",
            "last_name": "Beer",
            "gender": "female",
            "dob": null,
            "pic_url": null,
            "bio": null,
            "user_id": 624,
            "verified": false
          },
          "next_session_date": "2016-12-22T17:38:53.664Z",
          "pending_sessions": 0,
          "upcoming_sessions": 0,
          "completed_sessions": 0
        }
      ],
      "coaches": [

      ]
    },
    "service_offering_location": null
  }
}

Mark attendance for appointment

Endpoint

POST /api/v1/appointments/:id/mark_attendance

Parameters

Name Description
attendance required Attendance status for appointment (attended/absent)
student_ids required Array of student_ids to mark attendance for

Request

Route

POST /api/v1/appointments/60/mark_attendance

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "attendance": "absent",
  "student_ids": [
    161
  ]
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/appointments/60/mark_attendance" -d '{"attendance":"absent","student_ids":[161]}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
}

Cancel appointment

Endpoint

POST /api/v1/appointments/:id/cancel

Request

Route

POST /api/v1/appointments/62/cancel

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/appointments/62/cancel" -d '' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
}

Remove session appointment

Endpoint

DELETE /api/v1/appointments/:id

Request

Route

DELETE /api/v1/appointments/64

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/appointments/64" -d '' -X DELETE \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
}

Session - Availability Slots

List all available availability slots records for a coach

Endpoint

GET /api/v1/coaches/:coach_id/availability_slots

Request

Route

GET /api/v1/coaches/178/availability_slots

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/coaches/178/availability_slots" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "availability_slots": [
    {
      "id": 1,
      "coach_id": 178,
      "mo_start": "10:00",
      "mo_end": "17:00",
      "tu_start": null,
      "tu_end": null,
      "we_start": "10:00",
      "we_end": "17:00",
      "th_start": null,
      "th_end": null,
      "fr_start": "10:00",
      "fr_end": "17:00",
      "sa_start": null,
      "sa_end": null,
      "su_start": null,
      "su_end": null
    }
  ]
}

Set availability slots record for a coach

It creates avalaibility slots for coach. You can pass times on specific days in which coach is available. End value for a day has to be greater than the start value by at least 30 minutes

Endpoint

POST /api/v1/coaches/:coach_id/availability_slots

Parameters

Name Description
availability_slot[type] Type of the availability slot - 'available' or 'blocked'. By default, it's 'available'
availability_slot[mo_start] Start time on Monday
availability_slot[mo_end] End time on Monday
availability_slot[tu_start] Start time on Tuesday
availability_slot[tu_end] End time on Tuesday
availability_slot[we_start] Start time on Wednesday
availability_slot[we_end] End time on Wednesday
availability_slot[th_start] Start time on Thursday
availability_slot[th_end] End time on Thursday
availability_slot[fr_start] Start time on Friday
availability_slot[fr_end] End time on Friday
availability_slot[sa_start] Start time on Saturday
availability_slot[sa_end] End time on Saturday
availability_slot[su_start] Start time on Sunday
availability_slot[su_end] End time on Sunday

Request

Route

POST /api/v1/coaches/179/availability_slots

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "availability_slot": {
    "we_start": "10:30",
    "we_end": "12:30"
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/coaches/179/availability_slots" -d '{"availability_slot":{"we_start":"10:30","we_end":"12:30"}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "availability_slot": {
    "id": 2,
    "coach_id": 179,
    "mo_start": null,
    "mo_end": null,
    "tu_start": null,
    "tu_end": null,
    "we_start": "10:30",
    "we_end": "12:30",
    "th_start": null,
    "th_end": null,
    "fr_start": null,
    "fr_end": null,
    "sa_start": null,
    "sa_end": null,
    "su_start": null,
    "su_end": null
  }
}

Get availability slots record

Endpoint

GET /api/v1/availability_slots/:id

Request

Route

GET /api/v1/availability_slots/3

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/availability_slots/3" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "availability_slot": {
    "id": 3,
    "coach_id": 180,
    "mo_start": null,
    "mo_end": null,
    "tu_start": null,
    "tu_end": null,
    "we_start": null,
    "we_end": null,
    "th_start": null,
    "th_end": null,
    "fr_start": null,
    "fr_end": null,
    "sa_start": null,
    "sa_end": null,
    "su_start": null,
    "su_end": null
  }
}

Update availability slots record

It updates record with coach availability on Friday

Endpoint

PUT /api/v1/availability_slots/:id

Parameters

Name Description
availability_slot[fr_start] required Start time on Friday
availability_slot[fr_end] required End time on Friday
availability_slot[type] Type of the availability slot - 'available' or 'blocked'. By default, it's 'available'
availability_slot[mo_start] Start time on Monday
availability_slot[mo_end] End time on Monday
availability_slot[tu_start] Start time on Tuesday
availability_slot[tu_end] End time on Tuesday
availability_slot[we_start] Start time on Wednesday
availability_slot[we_end] End time on Wednesday
availability_slot[th_start] Start time on Thursday
availability_slot[th_end] End time on Thursday
availability_slot[sa_start] Start time on Saturday
availability_slot[sa_end] End time on Saturday
availability_slot[su_start] Start time on Sunday
availability_slot[su_end] End time on Sunday

Request

Route

PUT /api/v1/availability_slots/4

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "availability_slot": {
    "fr_start": "10:30",
    "fr_end": "12:30"
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/availability_slots/4" -d '{"availability_slot":{"fr_start":"10:30","fr_end":"12:30"}}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "availability_slot": {
    "id": 4,
    "coach_id": 181,
    "mo_start": null,
    "mo_end": null,
    "tu_start": null,
    "tu_end": null,
    "we_start": null,
    "we_end": null,
    "th_start": null,
    "th_end": null,
    "fr_start": "10:30",
    "fr_end": "12:30",
    "sa_start": null,
    "sa_end": null,
    "su_start": null,
    "su_end": null
  }
}

Remove availability slots record

Endpoint

DELETE /api/v1/availability_slots/:id

Request

Route

DELETE /api/v1/availability_slots/5

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/availability_slots/5" -d '' -X DELETE \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
}

Get coach availability from some start day during some number of days

Endpoint

GET /api/v1/coaches/:coach_id/availability

Parameters

Name Description
start required Date to start (UTC)
duration required Number of days to count from start (default is 30)

Request

Route

GET /api/v1/coaches/183/availability?start=2016-12-22&duration=2

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Query Parameters

start=2016-12-22
duration=2

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/coaches/183/availability?start=2016-12-22&duration=2" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "coach_availability": [
    {
      "start_time": "2016-12-22T10:00:00.000Z",
      "end_time": "2016-12-22T17:00:00.000Z"
    },
    {
      "start_time": "2016-12-23T10:00:00.000Z",
      "end_time": "2016-12-23T17:00:00.000Z"
    },
    {
      "start_time": "2016-12-24T17:00:00.000Z",
      "end_time": "2016-12-24T20:00:00.000Z"
    }
  ]
}

Session - Blocked Slots

List all blocked slots for a coach

Endpoint

GET /api/v1/coaches/:coach_id/blocked_slots

Request

Route

GET /api/v1/coaches/184/blocked_slots

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/coaches/184/blocked_slots" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "blocked_slots": [
    {
      "id": 3,
      "coach_id": 184,
      "start_datetime": "2016-12-22T17:38:55Z",
      "end_datetime": "2016-12-22T23:38:55Z"
    }
  ]
}

Set blocked slot for a coach

Endpoint

POST /api/v1/coaches/:coach_id/blocked_slots

Parameters

Name Description
blocked_slot[start_datetime] required Date & time in UTC
blocked_slot[end_datetime] required Date & time in UTC

Request

Route

POST /api/v1/coaches/185/blocked_slots

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "blocked_slot": {
    "start_datetime": "2016-12-23T17:38:55Z",
    "end_datetime": "2016-12-23T23:38:55Z"
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/coaches/185/blocked_slots" -d '{"blocked_slot":{"start_datetime":"2016-12-23T17:38:55Z","end_datetime":"2016-12-23T23:38:55Z"}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "blocked_slot": {
    "id": 5,
    "coach_id": 185,
    "start_datetime": "2016-12-23T17:38:55Z",
    "end_datetime": "2016-12-23T23:38:55Z"
  }
}

Get blocked slot

Endpoint

GET /api/v1/blocked_slots/:id

Request

Route

GET /api/v1/blocked_slots/6

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/blocked_slots/6" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "blocked_slot": {
    "id": 6,
    "coach_id": 186,
    "start_datetime": "2016-12-22T17:38:55Z",
    "end_datetime": "2016-12-22T21:38:55Z"
  }
}

Update blocked slots

Endpoint

PUT /api/v1/blocked_slots/:id

Parameters

Name Description
blocked_slot[start_datetime] required Date & time in UTC
blocked_slot[end_datetime] required Date & time in UTC

Request

Route

PUT /api/v1/blocked_slots/7

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "blocked_slot": {
    "start_datetime": "2016-12-22T18:08:55Z",
    "end_datetime": "2016-12-22T20:38:55Z"
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/blocked_slots/7" -d '{"blocked_slot":{"start_datetime":"2016-12-22T18:08:55Z","end_datetime":"2016-12-22T20:38:55Z"}}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "blocked_slot": {
    "id": 7,
    "coach_id": 187,
    "start_datetime": "2016-12-22T18:08:55Z",
    "end_datetime": "2016-12-22T20:38:55Z"
  }
}

Remove blocked slots

Endpoint

DELETE /api/v1/blocked_slots/:id

Request

Route

DELETE /api/v1/blocked_slots/8

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/blocked_slots/8" -d '' -X DELETE \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
}

Session - Bookings

List bookings for an user

Endpoint

GET /api/v1/users/:user_id/bookings

Request

Route

GET /api/v1/users/756/bookings

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/users/756/bookings" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 2
Content-Type: application/json; charset=utf-8

Body

{
  "bookings": [
    {
      "id": 65,
      "requester_id": 189,
      "state": "requested",
      "booking_datetime": null,
      "service_offering_location_id": null,
      "booking_coach_id": null,
      "service_offering_type": "PrivateLesson",
      "students": [

      ],
      "service_offering": {
        "id": 286,
        "name": "McGlynn, Wilkinson and Bartell",
        "active": true,
        "session_duration": 60,
        "total_num_sessions": 1,
        "max_students_per_session": 2,
        "booking_type": null,
        "code": null,
        "description": null,
        "business_id": 220,
        "subcategory": {
          "id": 440,
          "name": "truffaut282",
          "category_id": null,
          "color_code": null,
          "sort_order": null,
          "pic_url": {
          }
        },
        "delivery_format": "in person",
        "service_offering_locations": [

        ],
        "students": [

        ],
        "coaches": [

        ]
      }
    },
    {
      "id": 66,
      "requester_id": 189,
      "state": "requested",
      "booking_datetime": null,
      "service_offering_location_id": null,
      "booking_coach_id": null,
      "service_offering_type": "GroupClass",
      "students": [

      ],
      "service_offering": {
        "id": 287,
        "name": "O'Conner Inc",
        "active": true,
        "session_duration": 120,
        "total_num_sessions": 2,
        "max_students_per_session": 3,
        "booking_type": null,
        "code": null,
        "description": null,
        "recurrence": {
          "id": 225,
          "human_name": "Daily at  5:38 PM "
        },
        "start_datetime": "2016-12-22T17:38:56Z",
        "last_session": "2016-12-23T17:38:56Z",
        "subcategory": {
          "id": 441,
          "name": "locavore283",
          "category_id": null,
          "color_code": null,
          "sort_order": null,
          "pic_url": {
          }
        },
        "student_count": 0,
        "business_id": 221,
        "delivery_format": "in person",
        "service_offering_locations": [

        ],
        "students": [

        ],
        "coaches": [

        ]
      }
    }
  ]
}

Create a booking record in `requested` state with existing student and service offering

Endpoint

POST /api/v1/bookings

Parameters

Name Description
booking[requester_id] required Profile ID who requests a booking - Parent student profile or Coach profile
booking[service_offering_id] required Group Class/Private Lesson ID
booking[student_ids] required IDs of students requested to attend
booking[booking_coach_id] required Business profile ID of a coaching business user
booking[booking_datetime] required Booking date and time
booking[booking_location_id] required Physical Location ID

Request

Route

POST /api/v1/bookings

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "booking": {
    "requester_id": 193,
    "service_offering_id": 289,
    "student_ids": [
      195,
      196
    ],
    "booking_datetime": "2016-12-22T17:38:56Z"
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/bookings" -d '{"booking":{"requester_id":193,"service_offering_id":289,"student_ids":[195,196],"booking_datetime":"2016-12-22T17:38:56Z"}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "booking": {
    "id": 69,
    "requester_id": 193,
    "state": "requested",
    "booking_datetime": "2016-12-22T17:38:56Z",
    "service_offering_location_id": 37,
    "booking_coach_id": null,
    "service_offering_type": "GroupClass",
    "students": [
      {
        "id": 195,
        "first_name": "Mekhi",
        "last_name": "Mitchell",
        "gender": "male",
        "dob": null,
        "pic_url": null,
        "bio": null,
        "user_id": 760,
        "verified": false
      },
      {
        "id": 196,
        "first_name": "Hollie",
        "last_name": "Leffler",
        "gender": "female",
        "dob": null,
        "pic_url": null,
        "bio": null,
        "user_id": 760,
        "verified": false
      }
    ],
    "service_offering": {
      "id": 289,
      "name": "Brown, Lind and West",
      "active": true,
      "session_duration": 45,
      "total_num_sessions": 3,
      "max_students_per_session": 0,
      "booking_type": null,
      "code": null,
      "description": null,
      "recurrence": {
        "id": 226,
        "human_name": "Daily at  5:38 PM "
      },
      "start_datetime": "2016-12-22T17:38:56Z",
      "last_session": "2016-12-24T17:38:56Z",
      "subcategory": {
        "id": 447,
        "name": "carry285",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "student_count": 0,
      "business_id": 223,
      "delivery_format": "in person",
      "service_offering_locations": [
        {
          "id": 37,
          "is_default": true,
          "name": null,
          "notes": null,
          "location_type": "physical",
          "service_offering_id": 289,
          "physical_location": null
        }
      ],
      "students": [

      ],
      "coaches": [

      ]
    }
  }
}

Create a booking record in `requested` state with a new parent student and service offering

Endpoint

POST /api/v1/bookings

Parameters

Name Description
booking[requester_id] required Profile ID who requests a booking - Parent student profile or Coach profile
booking[new_service_offering][business_id] required Service offering data
booking[new_service_offering][session_duration] required Service offering data
booking[new_service_offering][subcategory_id] required Service offering data
booking[new_service_offering][type] required Service offering data - type (PrivateLesson/GroupClass)
booking[new_service_offering][subcategory_id] required Service offering data - subcategory_id
booking[new_service_offering][delivery_format] required Service offering data - delivery_format
booking[invitee][first_name] required Parent Student data - first name
booking[invitee][last_name] required Parent Student data - last name
booking[invitee][phone_number] required Parent Student data - last name
booking[notes] required Notes about appointment
booking[booking_datetime] required Booking date and time
booking[booking_location_id] required Physical Location ID
booking[booking_coach_id] required Business profile ID of a coaching business user

Request

Route

POST /api/v1/bookings

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "booking": {
    "requester_id": 198,
    "new_service_offering": {
      "business_id": 227,
      "session_duration": "120",
      "subcategory_id": 450,
      "type": "PrivateLesson",
      "delivery_format": "online"
    },
    "invitee": {
      "first_name": "Rylee",
      "last_name": "Reinger",
      "phone_number": "+375256668989"
    },
    "notes": "Kogi scenester wayfarers hammock.",
    "booking_datetime": "2016-12-22T17:38:56Z",
    "booking_location_id": 24
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/bookings" -d '{"booking":{"requester_id":198,"new_service_offering":{"business_id":227,"session_duration":"120","subcategory_id":450,"type":"PrivateLesson","delivery_format":"online"},"invitee":{"first_name":"Rylee","last_name":"Reinger","phone_number":"+375256668989"},"notes":"Kogi scenester wayfarers hammock.","booking_datetime":"2016-12-22T17:38:56Z","booking_location_id":24}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "booking": {
    "id": 72,
    "requester_id": 198,
    "state": "requested",
    "booking_datetime": "2016-12-22T17:38:56Z",
    "service_offering_location_id": 38,
    "booking_coach_id": null,
    "service_offering_type": "PrivateLesson",
    "students": [
      {
        "id": 201,
        "first_name": "Rylee",
        "last_name": "Reinger",
        "gender": null,
        "dob": null,
        "pic_url": null,
        "bio": null,
        "user_id": 768,
        "verified": false
      }
    ],
    "service_offering": {
      "id": 296,
      "name": "120-min tennis lesson",
      "active": true,
      "session_duration": 120,
      "total_num_sessions": 1,
      "max_students_per_session": 1,
      "booking_type": "staff",
      "code": null,
      "description": null,
      "business_id": 227,
      "subcategory": {
        "id": 450,
        "name": "Tennis",
        "category_id": 42,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "delivery_format": "online",
      "service_offering_locations": [
        {
          "id": 38,
          "is_default": true,
          "name": null,
          "notes": null,
          "location_type": "online",
          "service_offering_id": 296,
          "physical_location": null
        }
      ],
      "students": [

      ],
      "coaches": [

      ]
    }
  }
}

Create a booking record in `requested` state with a new child student and service offering

Endpoint

POST /api/v1/bookings

Parameters

Name Description
booking[requester_id] required Profile ID who requests a booking - Parent student profile or Coach profile
booking[new_service_offering][business_id] required Service offering data
booking[new_service_offering][session_duration] required Service offering data
booking[new_service_offering][subcategory_id] required Service offering data
booking[new_service_offering][type] required Service offering data - type (PrivateLesson/GroupClass)
booking[new_service_offering][subcategory_id] required Service offering data - subcategory_id
booking[new_service_offering][delivery_format] required Service offering data - delivery_format
booking[invitee][first_name] required Parent Student data - first name
booking[invitee][last_name] required Parent Student data - last name
booking[invitee][phone_number] required Parent Student data - last name
booking[notes] required Notes about appointment
booking[booking_datetime] required Booking date and time
booking[booking_location_id] required Physical Location ID
booking[booking_coach_id] required Business profile ID of a coaching business user
booking[child_student][child_first_name] Child Student data - first name
booking[child_student][child_last_name] Child Student data - last name

Request

Route

POST /api/v1/bookings

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "booking": {
    "requester_id": 203,
    "new_service_offering": {
      "business_id": 231,
      "session_duration": "120",
      "subcategory_id": 458,
      "type": "PrivateLesson",
      "delivery_format": "online"
    },
    "invitee": {
      "first_name": "Milo",
      "last_name": "Muller",
      "phone_number": "+375256668989"
    },
    "notes": "Ethical trust fund brooklyn butcher sustainable pinterest tattooed.",
    "booking_datetime": "2016-12-22T17:38:56Z",
    "booking_location_id": 25,
    "child_student": {
      "child_first_name": "Eunice",
      "child_last_name": "Barrows"
    }
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/bookings" -d '{"booking":{"requester_id":203,"new_service_offering":{"business_id":231,"session_duration":"120","subcategory_id":458,"type":"PrivateLesson","delivery_format":"online"},"invitee":{"first_name":"Milo","last_name":"Muller","phone_number":"+375256668989"},"notes":"Ethical trust fund brooklyn butcher sustainable pinterest tattooed.","booking_datetime":"2016-12-22T17:38:56Z","booking_location_id":25,"child_student":{"child_first_name":"Eunice","child_last_name":"Barrows"}}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "booking": {
    "id": 75,
    "requester_id": 203,
    "state": "requested",
    "booking_datetime": "2016-12-22T17:38:56Z",
    "service_offering_location_id": 39,
    "booking_coach_id": null,
    "service_offering_type": "PrivateLesson",
    "students": [
      {
        "id": 207,
        "first_name": "Eunice",
        "last_name": "Barrows",
        "gender": null,
        "dob": null,
        "pic_url": null,
        "bio": null,
        "user_id": 773,
        "verified": false
      }
    ],
    "service_offering": {
      "id": 301,
      "name": "120-min tennis lesson",
      "active": true,
      "session_duration": 120,
      "total_num_sessions": 1,
      "max_students_per_session": 1,
      "booking_type": "staff",
      "code": null,
      "description": null,
      "business_id": 231,
      "subcategory": {
        "id": 458,
        "name": "Tennis",
        "category_id": 43,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "delivery_format": "online",
      "service_offering_locations": [
        {
          "id": 39,
          "is_default": true,
          "name": null,
          "notes": null,
          "location_type": "online",
          "service_offering_id": 301,
          "physical_location": null
        }
      ],
      "students": [

      ],
      "coaches": [

      ]
    }
  }
}

Get a booking record

Endpoint

GET /api/v1/bookings/:id

Request

Route

GET /api/v1/bookings/76

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/bookings/76" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "booking": {
    "id": 76,
    "requester_id": 208,
    "state": "requested",
    "booking_datetime": null,
    "service_offering_location_id": null,
    "booking_coach_id": null,
    "service_offering_type": "PrivateLesson",
    "students": [

    ],
    "service_offering": {
      "id": 304,
      "name": "Miller Group",
      "active": true,
      "session_duration": 120,
      "total_num_sessions": 1,
      "max_students_per_session": 2,
      "booking_type": null,
      "code": null,
      "description": null,
      "business_id": 236,
      "subcategory": {
        "id": 472,
        "name": "sustainable298",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    }
  }
}

Update a booking record with coach

Endpoint

PUT /api/v1/bookings/:id

Parameters

Name Description
booking[booking_coach_id] required Business profile ID of a coaching business user
booking[student_ids] Array of student profile IDs
booking[service_offering_id] Group Class/Private Lesson ID
booking[booking_datetime] Booking date and time
booking[service_offering_location_id] Service Offering Location ID

Request

Route

PUT /api/v1/bookings/78

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "booking": {
    "booking_coach_id": 216
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/bookings/78" -d '{"booking":{"booking_coach_id":216}}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "booking": {
    "id": 78,
    "requester_id": 212,
    "state": "requested",
    "booking_datetime": null,
    "service_offering_location_id": null,
    "booking_coach_id": 216,
    "service_offering_type": "PrivateLesson",
    "students": [

    ],
    "service_offering": {
      "id": 308,
      "name": "Runolfsdottir, Schoen and Corwin",
      "active": true,
      "session_duration": 120,
      "total_num_sessions": 1,
      "max_students_per_session": 2,
      "booking_type": null,
      "code": null,
      "description": null,
      "business_id": 240,
      "subcategory": {
        "id": 480,
        "name": "drinking302",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    }
  }
}

Update a booking record with students

Endpoint

PUT /api/v1/bookings/:id

Parameters

Name Description
booking[student_ids] required Array of student profile IDs
booking[booking_coach_id] Business profile ID of a coaching business user
booking[service_offering_id] Group Class/Private Lesson ID
booking[booking_datetime] Booking date and time
booking[service_offering_location_id] Service Offering Location ID

Request

Route

PUT /api/v1/bookings/80

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "booking": {
    "student_ids": [
      219
    ]
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/bookings/80" -d '{"booking":{"student_ids":[219]}}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "booking": {
    "id": 80,
    "requester_id": 217,
    "state": "requested",
    "booking_datetime": null,
    "service_offering_location_id": null,
    "booking_coach_id": null,
    "service_offering_type": "PrivateLesson",
    "students": [
      {
        "id": 219,
        "first_name": "Vesta",
        "last_name": "Doyle",
        "gender": "female",
        "dob": null,
        "pic_url": null,
        "bio": null,
        "user_id": 784,
        "verified": false
      }
    ],
    "service_offering": {
      "id": 312,
      "name": "McClure, Lueilwitz and Sanford",
      "active": true,
      "session_duration": 30,
      "total_num_sessions": 1,
      "max_students_per_session": 1,
      "booking_type": null,
      "code": null,
      "description": null,
      "business_id": 245,
      "subcategory": {
        "id": 488,
        "name": "post-ironic306",
        "category_id": null,
        "color_code": null,
        "sort_order": null,
        "pic_url": {
        }
      },
      "delivery_format": "in person",
      "service_offering_locations": [

      ],
      "students": [

      ],
      "coaches": [

      ]
    }
  }
}

Remove a booking record

Endpoint

DELETE /api/v1/bookings/:id

Request

Route

DELETE /api/v1/bookings/82

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/bookings/82" -d '' -X DELETE \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
}

Accept booking by invited user with self student profile

Endpoint

POST /api/v1/bookings/:id/accept

Parameters

Name Description
comment Provided comment

Request

Route

POST /api/v1/bookings/84/accept

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/bookings/84/accept" -d '' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
}

Decline booking by invited user with self student profile

Endpoint

POST /api/v1/bookings/:id/decline

Parameters

Name Description
comment Provided comment

Request

Route

POST /api/v1/bookings/86/decline

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/bookings/86/decline" -d '' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
}

Session - Booking Requests

Get booking request data

Endpoint

GET /api/v1/booking_requests/:id

Request

Route

GET /api/v1/booking_requests/NaPYnekFwt93p1RkeGoLoiN4

Headers

Accept: application/json
Content-Type: application/json

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/booking_requests/NaPYnekFwt93p1RkeGoLoiN4" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "booking_request": {
    "booking_id": 1,
    "phone_number": "+375254567899"
  }
}

Users

Get user

Endpoint

GET /api/v1/users/:id

Request

Route

GET /api/v1/users/804

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/users/804" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "user": {
    "id": 804,
    "settings": {
      "notifications": {
        "sms": {
          "invites": true,
          "bookings": true,
          "appointments": true
        },
        "push": {
          "invites": true,
          "bookings": true,
          "appointments": true
        }
      },
      "activities": [

      ]
    },
    "verified": false,
    "phone_numbers": [
      {
        "number": "+375258771776",
        "verified": false
      }
    ],
    "student_profiles": {
      "self": [

      ],
      "child": [

      ]
    },
    "coach_profiles": [

    ]
  }
}

Set or update activities for user

Endpoint

POST /api/v1/users/:user_id/activities

Parameters

Name Description Type
activity_ids required Activity IDs Array

Request

Route

POST /api/v1/users/805/activities

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "activity_ids": [
    514,
    515,
    516,
    517
  ]
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/users/805/activities" -d '{"activity_ids":[514,515,516,517]}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "user": {
    "id": 805,
    "settings": {
      "notifications": {
        "sms": {
          "invites": true,
          "bookings": true,
          "appointments": true
        },
        "push": {
          "invites": true,
          "bookings": true,
          "appointments": true
        }
      },
      "activities": [
        {
          "id": 514,
          "name": "Piano",
          "category_id": 50,
          "color_code": null,
          "sort_order": null,
          "pic_url": {
          }
        },
        {
          "id": 515,
          "name": "Percussion",
          "category_id": 50,
          "color_code": null,
          "sort_order": null,
          "pic_url": {
          }
        },
        {
          "id": 516,
          "name": "Vocal",
          "category_id": 50,
          "color_code": null,
          "sort_order": null,
          "pic_url": {
          }
        },
        {
          "id": 517,
          "name": "Guitar",
          "category_id": 50,
          "color_code": null,
          "sort_order": null,
          "pic_url": {
          }
        }
      ]
    },
    "verified": false,
    "phone_numbers": [
      {
        "number": "+375254243295",
        "verified": false
      }
    ],
    "student_profiles": {
      "self": [

      ],
      "child": [

      ]
    },
    "coach_profiles": [

    ]
  }
}

List businesses that have invited a user

Get a list of businesses. They are not customers yet because they have not accepted to join the business

Endpoint

GET /api/v1/users/:id/my_biz_invites

Request

Route

GET /api/v1/users/806/my_biz_invites

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/users/806/my_biz_invites" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

X-Per-Page: 15
X-Page: 1
X-Total: 1
Content-Type: application/json; charset=utf-8

Body

{
  "businesses": [
    {
      "id": 261,
      "name": "Casimir Lesch Jr.",
      "description": "optimize leading-edge communities",
      "url": "http://kerluke.io/clint",
      "state": "new",
      "settings": {
        "categories": [

        ],
        "subcategories": [

        ]
      },
      "owner": {
        "id": 807,
        "settings": {
          "notifications": {
            "sms": {
              "invites": true,
              "bookings": true,
              "appointments": true
            },
            "push": {
              "invites": true,
              "bookings": true,
              "appointments": true
            }
          },
          "activities": [

          ]
        },
        "verified": false,
        "phone_numbers": [
          {
            "number": "+375251628662",
            "verified": false
          }
        ],
        "student_profiles": {
          "self": [

          ],
          "child": [

          ]
        },
        "coach_profiles": [

        ]
      },
      "coaches": [

      ],
      "admins": [

      ]
    }
  ]
}

Get QuickBlox credentials of a user

This method returns QB credentials because they were set.

Endpoint

GET /api/v1/users/:user_id/qb

Request

Route

GET /api/v1/users/808/qb

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/users/808/qb" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "quickblox": {
    "login": "wiztr_qbs_808",
    "password": "rqhdcbez",
    "quickblox_id": null
  }
}

List chat connections of the user

Endpoint

GET /api/v1/users/:user_id/chat_connections

Request

Route

GET /api/v1/users/809/chat_connections

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/users/809/chat_connections" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "chat_connections": {
    "users": [
      {
        "id": 811,
        "settings": {
          "notifications": {
            "sms": {
              "invites": true,
              "bookings": true,
              "appointments": true
            },
            "push": {
              "invites": true,
              "bookings": true,
              "appointments": true
            }
          },
          "activities": [

          ]
        },
        "verified": false,
        "phone_numbers": [
          {
            "number": "+375252185155",
            "verified": false
          }
        ],
        "student_profiles": {
          "self": [
            {
              "id": 238,
              "first_name": "Junius",
              "last_name": "Goyette",
              "gender": "male",
              "dob": null,
              "pic_url": null,
              "bio": null,
              "user_id": 811,
              "verified": false
            }
          ],
          "child": [

          ]
        },
        "coach_profiles": [

        ],
        "quickblox": {
          "login": null,
          "id": null
        }
      }
    ]
  }
}

User Settings

List configuration settings for a user

Endpoint

GET /api/v1/users/:user_id/settings

Request

Route

GET /api/v1/users/814/settings

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/users/814/settings" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "user": {
    "id": 814,
    "settings": {
      "notifications": {
        "sms": {
          "invites": true,
          "bookings": true,
          "appointments": true
        },
        "push": {
          "invites": true,
          "bookings": true,
          "appointments": true
        }
      },
      "activities": [

      ]
    },
    "verified": false,
    "phone_numbers": [
      {
        "number": "+375254455921",
        "verified": false
      }
    ],
    "student_profiles": {
      "self": [

      ],
      "child": [

      ]
    },
    "coach_profiles": [

    ]
  }
}

Set or update configuration settings for a user

Endpoint

POST /api/v1/users/:user_id/settings

Parameters

Name Description
settings required Settings hash

Request

Route

POST /api/v1/users/815/settings

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "settings": {
    "notifications": {
      "sms": {
        "bookings": false,
        "invites": false,
        "appointments": false
      },
      "push": {
        "bookings": true,
        "invites": true,
        "appointments": true
      }
    }
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/users/815/settings" -d '{"settings":{"notifications":{"sms":{"bookings":false,"invites":false,"appointments":false},"push":{"bookings":true,"invites":true,"appointments":true}}}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "user": {
    "id": 815,
    "settings": {
      "notifications": {
        "sms": {
          "bookings": false,
          "invites": false,
          "appointments": false
        },
        "push": {
          "bookings": true,
          "invites": true,
          "appointments": true
        }
      },
      "activities": [

      ]
    },
    "verified": false,
    "phone_numbers": [
      {
        "number": "+375251421538",
        "verified": false
      }
    ],
    "student_profiles": {
      "self": [

      ],
      "child": [

      ]
    },
    "coach_profiles": [

    ]
  }
}

User Devices

Set device token to current user

Endpoint

POST /api/v1/device_tokens

Parameters

Name Description
device[token] required Device token
device[platform] required Device platform
device[version] required Device version
device[hw_model] required Device hw_model

Request

Route

POST /api/v1/device_tokens

Headers

Accept: application/json
Content-Type: application/json
Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ==

Body

{
  "device": {
    "token": "740f4707 bebcf74f 9b7c25d4 8e335894 5f6aa01d a5ddb387 462c7eaf 61bb78ad",
    "platform": "ios",
    "version": "7",
    "hw_model": "iPhone7"
  }
}

cURL

curl "https://wiztr-staging.herokuapp.com/api/v1/device_tokens" -d '{"device":{"token":"740f4707 bebcf74f 9b7c25d4 8e335894 5f6aa01d a5ddb387 462c7eaf 61bb78ad","platform":"ios","version":"7","hw_model":"iPhone7"}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: Token token=UIzIfgGxgjYIXOjY3C6NfEuM65iGHoOqqWoJwYdAG/kMUHXTJD4336IsZxpY+ejKiA2t2T0GoOHjGICmhWoNMQ=="

Response

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "device": {
    "id": 160,
    "token": "740f4707 bebcf74f 9b7c25d4 8e335894 5f6aa01d a5ddb387 462c7eaf 61bb78ad",
    "platform": "ios",
    "version": "7",
    "hw_model": "iPhone7"
  }
}