Endpoints
Staff GET POST PUT DELETE Students GET POST PUT DELETE Student-Logins GET POST PUT DELETE Events (schedule) GET POST PUT DELETE Reports EVENTS SESSIONS Resource Sellers APPROVE BUYERThe Blink Lesson API authenticates request at the organizational level. API tokens are issued to your organization, not a specific user. The token will have access to read, update, delete all organization data available view the endpoints below.
In order to use the API, you must authenticate your request by including your API token as a bearer token value in the header:
Authorization: Bearer API_TOKEN_HERE
Along with your authorization header, make sure you have the following content type headers are set on every request:
Accept: application/json Content-Type: application/json
Blink Lesson API V1 is hosted on the following base URI:
https://api.blinksession.com/v1
Blink Lesson uses conventional HTTP response codes to indicate the success or failure of an API request.
Code | Reason |
---|---|
200 | Success |
401 | To Many Login Attempts |
404 | No Data Found |
403 | Access Forbidden |
406 | Data Validation Error |
500 | Internal Server Error |
API requests which fail based on invalid api_token or inactive organization are throttled. You are allowed 5 requests until throttling kicks in and will be throttled for 60 seconds.
You are allowed 60 API request per minute. Any requests within a minute window that go beyond 60 will be denied.
All api request are logged and monitored.
All GET request have a limit of 500 records per page. With each GET request, a "meta" object will be returned with query count and pagination information. If you suspect your request query will, or could in the future, return more than 500 results, you will need to add code to read the "meta" object to determine if the 'total_count' is higher than the 'limit'.
To specify a limit of less than 500, pass limit={number}.
For sorting, check each each GET Parameters section for possible sort values. The default sort is 'id' direction 'asc'.
Key | Description |
---|---|
objects | To retrieve a nested JSON object of the following, add parameter 'objects' with each needed object separated by a comma (i.e. ?objects=students,invoices)
|
limit | To set limit to less than 500 |
sort | Sort by options: id first_name last_name display_name phone activated user_timezone created_at updated_at |
direction | asc or desc. asc is default. |
{
"status": {
"message": "Success, Staff Users Attached.",
"status_code": 200
},
"meta": {
"pagination": {
"total_count": 5,
"total_pages": 1,
"current_page": 1,
"limit": 500
}
},
"data": [
{
"id": 16,
"first_name": "Blink",
"last_name": "Session",
"display_name": "Blink Lesson",
"email": "info@blinksession.com",
"phone": "719-555-5555",
"user_timezone": "America/Denver",
"new_email_not_validated": "",
"user_availability": [
{
"dow": 0,
"start": "00:15",
"end": "23:15"
}
],
"created_at": {
"date": "2017-07-02 09:04:41.000000",
"timezone_type": 3,
"timezone": "America/Denver"
},
"updated_at": {
"date": "2019-04-18 17:53:20.000000",
"timezone_type": 3,
"timezone": "America/Denver"
},
"deleted_at": null,
"activated": "Yes",
"join_by_link": "https://login.blinklesson.app/joinsession/23n98v892n3f",
"studentsWithLinkedStudentLogins": [
{
"id": 80,
"first_name": "BlinkSession",
"last_name": "Support",
"date_of_birth": "12/01/2017",
"student_timezone": "Pacific/Kwajalein",
"organization_id": 1,
"location_id": null,
"discharged": 0,
"notes": "This student is help sessions with users",
"created_at": "2017-12-13 08:48:27",
"updated_at": "2018-09-10 11:33:14",
"deleted_at": null,
"users_role_teacher_one_string": "Blink Lesson | Another Staff",
"location": "",
"pivot": {
"user_id": 16,
"student_id": 80
},
"linked_student_logins": [
{
"id": 125,
"first_name": "BlinkLesson",
"last_name": "Support",
"display_name": "Blink Support",
"email": "support@blinklesson.app",
"phone": "555-555-5555",
"user_timezone": null,
"user_availability": null,
"new_email_not_validated": null,
"organization_id": 1,
"created_at": "2017-12-13 08:48:27",
"updated_at": "2019-04-25 10:39:49",
"deleted_at": null,
"activated": "Yes",
"pivot": {
"student_id": 80,
"user_id": 125
}
}
],
"student_location": null
}
]
}
]
}
POST /v1/staff
Key | Description |
---|---|
first_name | REQUIRED |
last_name | REQUIRED |
display_name | REQUIRED - Name students will see |
REQUIRED - Email must be unique | |
phone | REQUIRED |
user_timezone | REQUIRED - Must be valid PHP timezone: List |
Organization-General-Admin | binary 1/0 - View and edit Organization Settings |
Organization-User-Admin | binary 1/0 - Add, edit, delete ALL user accounts and view all their info. View, add, edit, delete ALL students. View reports of ALL staff. Observe other staff. |
Schedule-Admin | binary 1/0 - View, add, edit, delete other staff's appointments. |
Record-Sessions | binary 1/0 - Can record sessions. |
Staff-Access | binary 1/0 - View other staff. Join & start sessions (meetings) with other staff. Add staff to and join other group sessions |
Logins-Access | binary 1/0 - Add, edit "Logins" (of only linked students). Note: This access is not required to only view "Logins" of your linked students. |
Join-by-Link | binary 1/0 - Can have people join sessions by their join_by_link |
linked_student_ids | To link this new staff user to students. Value should be comma separated list of student ids (i.e. linked_student_ids=44,232,44) |
{
"status": {
"message": "Success, new staff user added. User NOT sent a registration email since SSO is On. Prorated charge of 15.00 added to organization credit card (if that is their payment method)",
"status_code": 200
}
"data": {
"id": 1184,
"first_name": "New",
"last_name": "Staff",
"display_name": "Mrs. Staff",
"email": "new@staff.com",
"phone": "555-555-5555",
"user_timezone": "America/Denver"
"students": [
{
"id": 949,
"first_name": "Bill",
"last_name": "Bob",
"date_of_birth": "04/23/2019",
"student_timezone": "America/New_York",
"organization_id": 1,
"location_id": null,
"discharged": 0,
"notes": "",
"created_at": "2019-04-12 14:27:20",
"updated_at": "2019-04-17 17:37:22",
"deleted_at": null,
"users_role_teacher_one_string": "New Staff",
"location": "",
"pivot": {
"user_id": 1184,
"student_id": 949
},
"student_location": null
},
{
"id": 814,
"first_name": "John",
"last_name": "Smith",
"date_of_birth": "03/27/2019",
"student_timezone": "America/New_York",
"organization_id": 1,
"location_id": null,
"discharged": 1,
"notes": "",
"created_at": "2019-03-07 13:27:24",
"updated_at": "2019-03-26 20:42:35",
"deleted_at": null,
"users_role_teacher_one_string": "New Staff",
"location": "",
"pivot": {
"user_id": 1184,
"student_id": 814
},
"student_location": null
}
],
"permissions": [
{
"name": "Organization-User-Admin",
"get": 1,
"post": 1,
"update": 1,
"delete": 1
},
{
"name": "Schedule-Admin",
"get": 1,
"post": 1,
"update": 1,
"delete": 1
},
{
"name": "Record-Sessions",
"get": 1,
"post": 1,
"update": 1,
"delete": 1
}
]
}
}
PUT /v1/staff/{staffId}
Key | Description |
---|---|
first_name | |
last_name | |
display_name | Name students will see |
Email must be unique | |
phone | |
user_timezone | Must be valid PHP timezone: List |
Organization-General-Admin | binary 1/0 - Pass 1 or 0 to update |
Organization-User-Admin | binary 1/0 - Pass 1 or 0 to update |
Schedule-Admin | binary 1/0 - Pass 1 or 0 to update |
Record-Sessions | binary 1/0 - Pass 1 or 0 to update |
Staff-Access | binary 1/0 - Pass 1 or 0 to update |
Logins-Access | binary 1/0 - Pass 1 or 0 to update |
Join-by-Link | binary 1/0 - Pass 1 or 0 to update |
linked_student_ids | ** To update linked students you must pass ALL student ids this staff should be linked to in a comma separated list (i.e. linked_student_ids=44,232,44). Student IDs not in your list will be un-linked. New student ids in your list will be linked. To unlink all students, pass parameter with no value. |
{
"status": {
"message": "Success, staff updated. New data attached",
"status_code": 200
}
"data": {
"id": 1184,
"first_name": "New",
"last_name": "Staff",
"display_name": "Mrs. Staff",
"email": "new@staff.com",
"phone": "555-555-5555",
"user_timezone": "America/Denver"
"students": [
{
"id": 814,
"first_name": "John",
"last_name": "Smith",
"date_of_birth": "03/27/2019",
"student_timezone": "America/New_York",
"organization_id": 1,
"location_id": null,
"discharged": 1,
"notes": "",
"created_at": "2019-03-07 13:27:24",
"updated_at": "2019-03-26 20:42:35",
"deleted_at": null,
"users_role_teacher_one_string": "New Staff",
"location": "",
"pivot": {
"user_id": 1184,
"student_id": 814
},
"student_location": null
}
],
"permissions": [
{
"name": "Organization-User-Admin",
"get": 1,
"post": 1,
"update": 1,
"delete": 1
},
{
"name": "Record-Sessions",
"get": 1,
"post": 1,
"update": 1,
"delete": 1
}
]
}
}
DELETE /v1/staff/{staffId}
{
"status": {
"message": "Success, staff deleted. Subscription price will be adjusted next month to reflect change in the number of staff.",
"status_code": 200
}
}
GET /v1/students/{studentId}
To retrieve all students, omit studentId
Key | Description |
---|---|
objects | To retrieve a nested JSON object of the following, add parameter 'objects' with each needed object separated by a comma (i.e. ?objects=linkedStudentLogins,invoices,studentNotes)
|
limit | To set limit to less than 500 |
sort | Sort by options: id location_id location discharged created_at updated_at |
direction | asc or desc. asc is default. |
{
"status": {
"message": "Success, Students Attached.",
"status_code": 200
},
"meta": {
"pagination": {
"total_count": 41,
"total_pages": 1,
"current_page": 1,
"limit": 500
}
},
"data": [
{
"id": 80,
"first_name": "Jon",
"last_name": "Doe",
"date_of_birth": "12/01/2017",
"student_timezone": "Pacific/Kwajalein",
"organization_id": 1,
"location_id": null,
"discharged": 0,
"notes": "This is a note on the student",
"created_at": {
"date": "2017-12-13 08:48:27.000000",
"timezone_type": 3,
"timezone": "America/Denver"
},
"updated_at": {
"date": "2018-09-10 11:33:14.000000",
"timezone_type": 3,
"timezone": "America/Denver"
},
"deleted_at": null,
"linkedStudentLogins": [
{
"id": 125,
"first_name": "Amy",
"last_name": "Doe",
"display_name": "",
"email": "amydoe@gmail.com",
"phone": "555-555-5555",
"user_timezone": "America/Denver",
"organization_id": 1,
"created_at": "2017-12-13 08:48:27",
"updated_at": "2019-04-25 10:39:49",
"deleted_at": null,
"activated": "Yes",
}
],
"studentNotes": [
{
"id": 3387,
"author_user_id": 12,
"note": "In meiner Schule wurde Englisch so gut wie überhaupt nicht unterrichtet. Das Fach begann zwar bereits in der 4. Klasse, aber bishin zur 9. lernte man ausschließlich Farben, Zahlen, Obst, ABC und seltsamerweise mal Autoteile xD\r\nIch bewundere diese kleinen Kinder die einfach schon auf englisch singen können. Ich hab damals irgendeinen Kauderwelsch",
"student_visible": 1,
"created_at": "Mar 14, 2019, 12:00 am",
"updated_at": "Apr 19, 2019, 3:40 pm",
"deleted_at": null,
"author_full_name": "Author Name",
"created_short": "Mar 14, 2019 (Thu)",
"student_full_name": "John Doe",
"author": {
"id": 12,
"first_name": "Author",
"last_name": "Name",
"display_name": "Mr Author",
"email": "Author@Author.com",
"phone": "555-555-5555",
"user_timezone": "Africa/Bangui",
"created_at": null,
"updated_at": "2019-05-06 10:02:47",
"deleted_at": null,
"activated": "Yes"
}
}
],
"invoices": [
{
"id": 54,
"student_id": 80,
"organization_id": 1,
"author_user_id": 12,
"charge": "33.00",
"tax_rate": "3.00",
"tax_calculated_amount": "0.99",
"charge_plus_tax": "33.99",
"note": "we",
"payment_terms": "wer",
"due_on": "2019-04-30 00:00:00",
"payment_received_on": "",
"payment_transaction_id": null,
"created_at": "Apr 19, 2019",
"updated_at": "Apr 19, 2019, 2:58 pm",
"deleted_at": null,
"due_readable": "Apr 30, 2019",
"due_edit": "04/30/2019",
"payment_received_edit": "04/30/2019",
"author_name": "Bob Smith",
"student_name": "BlinkSession Support",
"payment_received_on_edit": null,
"author": {
"id": 12,
"first_name": "Therapist",
"last_name": "Sally",
"display_name": "Miss Sally",
"email": "sally@org.com",
"phone": "555-555-5555",
"created_at": null,
"updated_at": "2019-05-06 10:02:47",
"deleted_at": null,
"activated": "Yes"
},
}
]
}
]
}
POST /v1/students
Key | Description |
---|---|
first_name | REQUIRED |
last_name | REQUIRED |
date_of_birth | REQUIRED (MM/DD/YYY) |
student_timezone | REQUIRED - Student's timezone - Must be valid PHP timezone: List |
notes | Any notes about the student |
location_id | ID of a location setup by the organization |
discharged | 1/0 binary - is student discharged? Discharged students cannot join sessions. This is often used to deactivate students if on a pay-per-active-student plan. |
{
"status": {
"message": "Success, new student added. Make sure to add a new Student-Login and link this student to them or link this student to an existing login.",
"status_code": 200
}
"data": {
"first_name": "New",
"last_name": "Student",
"date_of_birth": "04/03/1990",
"notes": "Note about this student",
"organization_id": 1,
"student_timezone": "America/Los_Angeles",
"updated_at": "2019-05-06 17:45:19",
"created_at": "2019-05-06 17:45:19",
"id": 951,
"location": "",
}
}
PUT /v1/students/{studentId}
Key | Description |
---|---|
first_name | |
last_name | |
date_of_birth | MM/DD/YYYY |
student_timezone | Must be valid PHP timezone: List |
notes | |
location_id | ID of a location setup by the organization |
discharged | 1/0 binary - is student discharged? Discharged students cannot join sessions. This is often used to deactivate students if on a pay-per-active-student plan. |
{
"status": {
"message": "Success, student updated. New data attached",
"status_code": 200
},
"data": {
"id": 951,
"first_name": "Joe",
"last_name": "Doe",
"date_of_birth": "02/26/2011",
"location": "",
"location_id": null,
"discharged": 0,
"student_timezone": "America/Los_Angeles",
"notes": ""
}
}
DELETE /v1/students/{studentId}
{
"status": {
"message": "Success, student deleted.",
"status_code": 200
}
}
GET /v1/student-logins/{studentLoginId}
To retrieve all student logins, omit studentLoginId
Key | Description | |
---|---|---|
objects | To retrieve a nested JSON object of the following, add parameter 'objects' with each needed object separated by a comma (i.e. ?objects=students,invoices)
notificationPrefs |
|
limit | To set limit to less than 500 | |
sort | Sort by options: id created_at updated_at |
|
direction | asc or desc. asc is default. |
{
"status": {
"message": "Success, Student-Login Users Attached.",
"status_code": 200
},
"meta": {
"pagination": {
"total_count": 45,
"total_pages": 1,
"current_page": 1,
"limit": 500
}
},
"data": [
{
"id": 272,
"first_name": "Johnny",
"last_name": "Walker",
"display_name": "test Test",
"email": "jon@wiskey.com",
"phone": "555-555-5555",
"user_timezone": 'America/Denver',
"new_email_not_validated": null,
"organization_id": 1,
"created_at": {
"date": "2018-05-02 13:54:10.000000",
"timezone_type": 3,
"timezone": "America/Denver"
},
"updated_at": {
"date": "2019-04-18 16:57:51.000000",
"timezone_type": 3,
"timezone": "America/Denver"
},
"deleted_at": null,
"activated": "No",
"trial_ends_at": null
"students": [
{
"id": 814,
"first_name": "Joe",
"last_name": "Student",
"date_of_birth": "03/27/2019",
"student_timezone": "America/New_York",
"organization_id": 1,
"location_id": null,
"discharged": 1,
"notes": "",
"created_at": "2019-03-07 13:27:24",
"updated_at": "2019-03-26 20:42:35",
"deleted_at": null,
"location": "",
"student_location": null
},
{
"id": 621,
"first_name": "Joe's Sister",
"last_name": "Student",
"date_of_birth": "01/17/2019",
"student_timezone": "America/Chicago",
"organization_id": 1,
"location_id": null,
"discharged": null,
"notes": "",
"created_at": "2019-01-08 20:17:06",
"updated_at": "2019-01-08 20:17:06",
"deleted_at": null,
"location": "",
"student_location": null
},
],
"invoices": [{
"id": 54,
"student_id": 80,
"organization_id": 1,
"author_user_id": 12,
"charge": "33.00",
"tax_rate": "3.00",
"tax_calculated_amount": "0.99",
"charge_plus_tax": "33.99",
"note": "we",
"payment_terms": "wer",
"due_on": "2019-04-30 00:00:00",
"payment_received_on": "",
"payment_transaction_id": null,
"created_at": "Apr 19, 2019",
"updated_at": "Apr 19, 2019, 2:58 pm",
"deleted_at": null,
"due_readable": "Apr 30, 2019",
"due_edit": "04/30/2019",
"payment_received_edit": "04/30/2019",
"author_name": "Eric DeGrove",
"student_name": "BlinkSession Support",
"payment_received_on_edit": null,
"author": {
"id": 12,
"first_name": "Therapist",
"last_name": "Sally",
"display_name": "Miss Sally",
"email": "sally@org.com",
"phone": "555-555-5555",
"created_at": null,
"updated_at": "2019-05-06 10:02:47",
"deleted_at": null,
"activated": "Yes"
},
},
"notificationPrefs": {
"events_email": 1,
"events_sms": 1,
"homework_email": 1,
"homework_sms": 0,
"invoices_email": 0,
"invoices_sms": 0,
"msg_email": 0,
"msg_sms": 1
}
],
}
]
}
POST /v1/student-logins
Key | Description |
---|---|
first_name | REQUIRED |
last_name | REQUIRED |
REQUIRED - Email must be unique | |
phone | REQUIRED **10 digit mobile number required for text notification (US & Canada Supported) |
linked_student_ids | REQUIRED - New student-logins must have at least one linked student_id. If you just made an API call to add a "student", you would add that student's ID here to link this new student-login to that new student. You can also link this new student-login to existing student_ids. Value should be comma separated list of student ids (i.e. linked_student_ids=44,232) |
Notification Preferences | **you must pass ALL notification preferences you want turned ON |
events_email | binary 1/0 (appointment reminders & self schedule confirm by email) |
events_sms | binary 1/0 (appointment reminders & self schedule confirm by text) |
homework_email | binary 1/0 (homework added, updated, deleted by email) |
homework_sms | binary 1/0 (homework added, updated, deleted by text) |
invoices_email | binary 1/0 (invoices added, receipts by email) |
invoices_sms | binary 1/0 (invoices added, receipts by text) |
msg_email | binary 1/0 (messages received notice by email) |
msg_sms | binary 1/0 (messages received notice by text) |
{
"status": {
"message": "Success, new student-login user added. User not sent a registration email since SSO is On.",
"status_code": 200
}
"data": {
"id": 1186,
"first_name": "Jack",
"last_name": "Daniels",
"email": "jack@tennessee.com",
"phone": "555-555-5555"
"students": [
{
"id": 80,
"first_name": "Jack",
"last_name": "Daniels",
"date_of_birth": "12/01/1990",
"student_timezone": "Pacific/Kwajalein",
"organization_id": 1,
"location_id": null,
"discharged": 0,
"notes": "T",
"created_at": "2017-12-13 08:48:27",
"updated_at": "2018-09-10 11:33:14",
"deleted_at": null,
"users_role_teacher_one_string": "Therapist Amy",
"location": "",
"pivot": {
"user_id": 1186,
"student_id": 80
},
"student_location": null
}
],
"notificationPrefs": {
"events_email": 1,
"events_sms": 1,
"homework_email": 1,
"homework_sms": 0,
"invoices_email": 0,
"invoices_sms": 0,
"msg_email": 0,
"msg_sms": 1
}
}
}
PUT /v1/student-logins/{studentLoginId}
Key | Description |
---|---|
first_name | |
last_name | |
Email must be unique | |
phone | |
linked_student_ids | ** To update linked students you must pass ALL student ids this student-login should be linked to in a comma separated list (i.e. linked_student_ids=44,232,44). Student IDs not in your list will be un-linked. New student ids in your list will be linked. To unlink all students, pass parameter with no value. |
Notification Preferences | **you must pass ALL notification preferences you want turned ON |
events_email | binary 1/0 (appointment reminders & self schedule confirm by email) |
events_sms | binary 1/0 (appointment reminders & self schedule confirm by text) |
homework_email | binary 1/0 (homework added, updated, deleted by email) |
homework_sms | binary 1/0 (homework added, updated, deleted by text) |
invoices_email | binary 1/0 (invoices added, receipts by email) |
invoices_sms | binary 1/0 (invoices added, receipts by text) |
msg_email | binary 1/0 (messages received notice by email) |
msg_sms | binary 1/0 (messages received notice by text) |
{
"status": {
"message": "Success, student-login updated. New data attached",
"status_code": 200
}
"data": {
"id": 1186,
"first_name": "Buffalo",
"last_name": "Trace",
"email": "buffalo@trace.com",
"phone": "555-555-5555"
"students": [
{
"id": 80,
"first_name": "Sam",
"last_name": "Trace",
"date_of_birth": "12/01/2017",
"student_timezone": "Pacific/Las_Angelas",
"organization_id": 1,
"location_id": null,
"discharged": 0,
"notes": "",
"created_at": "2017-12-13 08:48:27",
"updated_at": "2018-09-10 11:33:14",
"deleted_at": null,
"users_role_teacher_one_string": "Eagle Rare | Math Tutor",
"location": "",
"pivot": {
"user_id": 1186,
"student_id": 80
},
"student_location": null
}
],
"notificationPrefs": {
"events_email": 1,
"events_sms": 1,
"homework_email": 1,
"homework_sms": 0,
"invoices_email": 0,
"invoices_sms": 0,
"msg_email": 0,
"msg_sms": 1
}
}
}
DELETE /v1/staff/{studentLoginId}
{
"status": {
"message": "Success, student-login deleted.",
"status_code": 200
}
}
Timezone Neutral: In Blink Lesson, event (appointment) start and end times are stored in the UTC timezone so they can be converted to each user's unique timezone when requested. But, you don't need to submit times in UTC. You will add a timezone parameter with POST and PUT request which will be used by Blink Lesson to convert start/end times to UTC.
Staff & Students Linked to Event: When you POST a new event, you will also pass the staffId(s) and studentId(s) that should be linked to the event.
Student-Logins: Student-logins are never linked to events, only staff and students. Student-logins are sent email reminders of all students linked to them.
Get events for a staff
GET /v1/events/staff/{staffId}
Get events for a student
GET /v1/events/student/{studentId}
Get events for all linked students for a student-login
GET /v1/events/student-login/{studentLoginId}
Key | Description |
---|---|
timezone | REQUIRED - Blink Lesson will convert start and end times to the timezone you pass. Must be valid PHP timezone: List |
future | Pass future=1 to get only future events. Don't pass future & past together. |
past | Pass past=1 to get only past events. Don't pass future & past together. |
rangeStart | YYYY-MM-DD - calculated based on the timezone you pass. |
rangeEnd | YYYY-MM-DD - calculated based on the timezone you pass. |
status | Pass status={status-name} to get only events with a specific status. Event status' are only changed if a staff member, or an API call, manually changes the status:
|
objects | To retrieve a nested JSON object of the following, add parameter 'objects' with each needed object separated by a comma (i.e. ?objects=students,staff)
|
limit | To set limit to less than 500 |
sort | Sort by options: id status type_id start end created_at updated_at recurring_of_event_id |
direction | asc or desc. asc is default. |
{
"status": {
"message": "Success, events attached.",
"status_code": 200
},
meta: {
pagination: {
total_count: 1,
total_pages: 1,
current_page: 1,
limit: 500
}
},
"data": [
{
"createdByUserid": 54,
"recurring_of_event_id": 211,
"recurring_first_appt_start": "2018-01-30 05:00:00",
"recurring_visits": 8,
"recurring_frequency": 1,
"title": "Crown Royal",
"details": "apt details",
"status": "Scheduled",
"type_id": null,
"allDay": false,
"start": "2018-01-30 05:00:00",
"end": "2018-01-30 05:55:00",
"created_at": "Apr 9, 2018, 4:25 pm",
"updated_at": "Jan 2, 2019, 5:02 pm",
"id": 211,
"staff": [
{
"id": 321,
"event_id": 211,
"user_id": 54,
"student_id": null,
"get": 1,
"post": 1,
"put": 1,
"delete": 1,
"created_at": "Jan 30, 2018, 12:25 am",
"updated_at": "Jan 30, 2018, 12:25 am",
"deleted_at": null,
"user": {
"id": 54,
"first_name": "Joe",
"last_name": "teacher",
"display_name": "Joe",
"email": "joe@teacher.com",
"phone": "555-555-5555",
"user_timezone": "America/New_York",
"user_availability": null,
"new_email_not_validated": "",
"created_at": "2017-10-24 01:43:48",
"updated_at": "2019-04-08 07:17:03",
"deleted_at": null,
"activated": "Yes"
}
}
],
"students": [
{
"id": 322,
"event_id": 211,
"user_id": null,
"student_id": 47,
"get": 1,
"post": 0,
"put": 0,
"delete": 0,
"created_at": "Jan 30, 2018, 12:25 am",
"updated_at": "Jan 30, 2018, 12:25 am",
"deleted_at": null,
"student": {
"id": 47,
"first_name": "Crown",
"last_name": "Royal",
"date_of_birth": "06/22/1956",
"student_timezone": "America/New_York",
"location_id": null,
"discharged": 0,
"notes": "",
"created_at": "2017-11-06 04:14:07",
"updated_at": "2018-01-30 00:24:18",
"deleted_at": null,
"location": "",
}
}
],
},
}
}
If event is in a recurring series
recurring_of_event_id: First event of the recurring series
recurring_first_appt_start: Start of the first event in the recurring series
recurring_visits: Number of events in the series
recurring_frequency: 1 = every week, 2 every other week, 4 = every four weeks
title: If students are linked to this event, title will be their name(s). If not, title will be the title entered by the creator.
start & end: Both are returned adjusted for the timezone you supplied in the request.
POST /v1/events
Key | Description | |
---|---|---|
linked_staff_ids | REQUIRED - add parameter 'linked_staff_ids' with each staff id separated by a comma (i.e. staff_ids=458,1025) | |
timezone | REQUIRED - Timezone the 'start' value was set in. Must be valid PHP timezone: List | |
start | REQUIRED - YYYY-MM-DD HH:MM - Will be converted to UTC timezone based on the timezone passed. | |
minutes | REQUIRED - Events must have a length in minutes OR be marked as allday. Pass minutes={integer} OR minutes=allday. | |
linked_student_ids OR title | REQUIRED - Events must be linked to at least one student OR have a title. Either add parameter 'linked_student_ids' with each student id separated by a comma (i.e. linked_student_ids=1458,21025), OR title={event title}. | |
recurring | 1/0 binary - is this a recurring appointment. | |
frequency | REQUIRED IF recurring=1 - 1 = every week, 2 = every other week, 4 = every four weeks. | |
frequency_ending_after | REQUIRED IF recurring=1 - number of recurring events to add. Minimum is 2, Maximum is 104. | |
details | Details about event (not visible to student) | |
type_id | ID of a appointment type setup by the organization |
{
"status": {
"message": "Success, event added and attached (if recurring, first event attached)",
"status_code": 200
},
"data": {
"id": 23515,
"recurring_of_event_id": 23515,
"recurring_first_appt_start": "2019-05-16 09:15:00",
"recurring_visits": 24,
"recurring_frequency": 1,
"title": "Student One, Student Two",
"details": "added from the api",
"status": "Scheduled",
"type_id": 0,
"allDay": false,
"start": "2019-05-16 09:15:00",
"end": "2019-05-16 10:15:00",
"created_at": "May 9, 2019, 2:54 pm",
"updated_at": "May 9, 2019, 2:54 pm",
"students": [
{
"id": 41995,
"event_id": 23515,
"user_id": null,
"student_id": 934,
"get": 1,
"post": 0,
"put": 0,
"delete": 0,
"created_at": "May 9, 2019, 2:54 pm",
"updated_at": "May 9, 2019, 2:54 pm",
"deleted_at": null,
"student": {
"id": 934,
"first_name": "Student",
"last_name": "One",
"date_of_birth": "05/01/2019",
"student_timezone": "America/New_York",
"organization_id": 1,
"location_id": 15,
"discharged": 0,
"notes": "enable my child",
"created_at": "2019-04-03 17:42:46",
"updated_at": "2019-04-24 18:25:50",
"deleted_at": null,
"location": "Martinez School",
"linked_student_logins": [
{
"id": 1154,
"first_name": "Helper",
"last_name": "Amy",
"email": "helperamy@school.com",
"phone": "555-555-5555",
"created_at": "2019-04-03 17:42:46",
"updated_at": "2019-04-18 17:11:49",
"deleted_at": null,
"activated": "No",
},
{
"id": 125,
"first_name": "Helper",
"last_name": "Bob",
"email": "helperbob@school.com",
"phone": "555-444-6666",
"created_at": "2017-12-13 08:48:27",
"updated_at": "2019-04-25 10:39:49",
"deleted_at": null,
"activated": "Yes",
}
],
"student_location": {
"id": 15,
"organization_id": 1,
"name": "Martinez School",
"created_at": "Apr 17, 2019, 11:32 pm",
"updated_at": "Apr 17, 2019, 5:32 pm",
"deleted_at": null
}
}
}
],
"staff": [
{
"id": 41994,
"event_id": 23515,
"user_id": 12,
"student_id": null,
"get": 1,
"post": 1,
"put": 1,
"delete": 1,
"created_at": "May 9, 2019, 2:54 pm",
"updated_at": "May 9, 2019, 2:54 pm",
"deleted_at": null,
"user": {
"id": 12,
"first_name": "Staff",
"last_name": "Person",
"display_name": "Mr. Staff",
"email": "staff@hospital.com",
"phone": "555-555-5555",
"user_timezone": "Africa/Bangui",
"user_availability": [
{
"dow": 0,
"start": "00:00",
"end": "24:15"
},
{
"dow": 5,
"start": "00:00",
"end": "13:00"
}
],
"created_at": null,
"updated_at": "2019-05-09 14:18:11",
"deleted_at": null,
"activated": "Yes"
}
}
]
}
}
PUT /v1/events/{eventId}
Key | Description |
---|---|
linked_staff_ids | ** To update linked staff you must pass ALL staff ids this event should be linked to in a comma separated list (i.e. linked_staff_ids=44,232). Staff IDs not in your list will be un-linked. New staff ids in your list will be linked. |
linked_student_ids OR title | ** To update linked students you must pass ALL student ids this event should be linked to in a comma separated list (i.e. linked_student_ids=458,7859). Student IDs not in your list will be un-linked. New students ids in your list will be linked. If you pass 'title' any previous linked students will be un-linked. |
start REQUIRES timezone | If you want to change the start value you must pass timezone also. Start - YYYY-MM-DD HH:MM - Timezone must be valid PHP timezone: List |
timezone | If you want the returned start and end values, after update, to be converted to a timezone, pass timezone with your request. Timezone must be valid PHP timezone: List |
minutes | minutes={integer} OR minutes=allday. |
status | Change event status to:
|
type_id | Change ID of a appointment type setup by the organization |
details | text (not visible to student) |
edit_recurring_future | REQUIRED IF event is in a series (has a recurring_of_event_id) - 1/0 binary - 1 = will update this + future events - 0 = will only update this event and remove it from the series. |
{
"status": {
"message": "Success, staff updated. New data attached",
"status_code": 200
}
"data": {
"id": 1184,
"first_name": "New",
"last_name": "Staff",
"display_name": "Mrs. Staff",
"email": "new@staff.com",
"phone": "555-555-5555",
"user_timezone": "America/Denver"
"students": [
{
"id": 814,
"first_name": "John",
"last_name": "Smith",
"date_of_birth": "03/27/2019",
"student_timezone": "America/New_York",
"organization_id": 1,
"location_id": null,
"discharged": 1,
"notes": "",
"created_at": "2019-03-07 13:27:24",
"updated_at": "2019-03-26 20:42:35",
"deleted_at": null,
"users_role_teacher_one_string": "New Staff",
"location": "",
"pivot": {
"user_id": 1184,
"student_id": 814
},
"student_location": null
}
],
"permissions": [
{
"name": "Organization-User-Admin",
"get": 1,
"post": 1,
"update": 1,
"delete": 1
},
{
"name": "Record-Sessions",
"get": 1,
"post": 1,
"update": 1,
"delete": 1
}
]
}
}
DELETE /v1/events/{eventId}
Key | Description |
---|---|
delete_recurring_future | REQUIRED IF event is in a series (has a recurring_of_event_id) - 1/0 binary - 1 = will delete this + future events - 0 = will only delete this event and remove it from the series. |
{
"status": {
"message": "Success, event deleted.",
"status_code": 200
}
}
GET /v1/reports/events
Key | Description |
---|---|
timezone | REQUIRED - Blink Lesson will convert start, end, and other dates/times to the timezone you pass. Must be valid PHP timezone: List |
rangeStart | REQUIRED - YYYY-MM-DD - calculated based on the timezone you pass. |
rangeEnd | REQUIRED - YYYY-MM-DD - calculated based on the timezone you pass. |
status | Pass status={status-name} to get only events with a specific status. Event status' are only changed if a staff member, or an API call, manually changes the status:
|
limit | To set limit to less than 500 |
sort | Sort by options: id status type_id start end staff_id created_at updated_at recurring_of_event_id |
direction | asc or desc. asc is default. |
{
"status": {
"message": "Success, events attached. Note: Event report data is updated nightly or if a front-end user pulls events from the reports page.",
"status_code": 200
},
"meta": {
"pagination": {
"total_count": 129,
"total_pages": 1,
"current_page": 1,
"limit": 500
}
},
"data": [
{
"id": 3159,
"start": "2018-04-05 08:15:00",
"end": "2018-04-05 08:48:00",
"allDay": 0,
"possible_matching_sessions": "Staff Joined: Jan 11, 2019, 11:57 am Student Joined: Jan 11, 2019, 12:02 pm Both America/New_York Timezone",
"student_connected_event": "Yes",
"title": "Student Name",
"details": null,
"status": "Scheduled",
"type_id": null,
"type_name": null,
"staff_name": "Blink Lesson",
"staff_id": "16",
"student_locations": "",
"created_at": "Apr 13, 2019, 9:28 am",
"updated_at": "Apr 13, 2019, 9:28 am"
}
]
}
possible_matching_sessions: Blink Lesson looks for sessions between the staff and student(s) in the event on the date of the event. If a session where either the staff OR student joined occurred, this will include the time the staff and student joined.
start & end: Both are returned adjusted for the timezone you supplied in the request.
student_connected_event: Will be 'Yes' if students were linked to this event.
title: Will be the student(s) linked to the event or user-created title.
GET /v1/reports/sessions
Key | Description |
---|---|
timezone | REQUIRED - Blink Lesson will convert dates/times to the timezone you pass. Must be valid PHP timezone: List |
rangeStart | YYYY-MM-DD - calculated based on the timezone you pass. |
rangeEnd | YYYY-MM-DD - calculated based on the timezone you pass. |
status | Pass status={status-name} to get only events with a specific status. Event status' are only changed if a staff member, or an API call, manually changes the status:
|
limit | To set limit to less than 500 |
sort | Sort by options: id session_created_at staff_joined_session student_joined_session length staff_id session_recording_min |
direction | asc or desc. asc is default. |
{
"status": {
"message": "Success, session attached. Note: Sessions report data is updated nightly or if a front-end user pulls sessions from the reports page.",
"status_code": 200
},
"meta": {
"pagination": {
"total_count": 224,
"total_pages": 1,
"current_page": 1,
"limit": 500
}
},
"data": [
{
"id": 1,
"session_id": 529,
"session_created_at": "2018-01-31 09:07:59",
"staff_joined_session": "2018-1-31, 10:07 am ",
"student_joined_session": null,
"length": null,
"staff_id": 16,
"student_ids": 80,
"student_names": "BlinkSession Support",
"staff_name": 'Joe Whiskey',
"possible_matching_events": "2018-07-20, 12:30 am (America/Denver Timezone) With: "BlinkSession Support Type: 2018-07-20",
"session_recording_min": 25,
"session_recording_deleted_at": null,
"session_recording_visible_to_student": 1
}
]
}
possible_matching_events: Blink Lesson looks for events between the staff and student(s) on the date of the session. More than one events are separated by a comma.
session_created_at: Returned adjusted for the timezone you supplied in the request.
staff_joined_session: Returned adjusted for the timezone you supplied in the request.
student_joined_session: Returned adjusted for the timezone you supplied in the request. If more than one student in the session, this is the time the first student entered the session.
student_ids: If more than one student in session, ids will be separated by a comma.
session_recording_min: If the session was recording and the recording was finalized this will not-be-null.
Use the following endpoints to approve/disapprove a Blink Lesson user to buy one or all of your resources. Resources can only be purchased by "Staff" users. To restrict buying a resource you are selling, go to the edit page for that resource -> Sell/Share -> Restrict.
When you "Restrict" a resource in Blink Lesson, you are required to provide a link where buyers can go to complete the approval. Blink will append the meta data you need as URL parameters to your link.
If you cannot pull the staff_id and resource_id from the URL, you will need to require the buyer to enter their Bink Session id, which you will need to make the POST request to approve. Any Blink (or white-label) user can find their id by logging in, clicking "My Account" and then "My Information".
1. User navigates to your resource’s product page in the Blink Lesson catalog.
2. User clicks on the approval link you added for that resource. You link will be appended with following data as URL parameters:
3. You have the user fill out a public form or login to your system to request approval to purchase the resource, or all your resources, in Blink Lesson.
4. To approve the user, use the Blink Lesson API to send a POST request to approve the staff_id to buy the specific resource_id or 'all' your resources.
5. Once your POST request is received, Blink Lesson will immediately allow the user to buy the resource(s) and email them that you have granted access.
If you need to repeal access, utilize the DELETE end point. If you anticipate needing to repeal, you should retain the user's Blink Lesson ID and any specific Blink resource IDs in your database.
POST /v1/resource-approval/{staffId}/{resourceId}
To approve buying all resources, use 'all' as the resource ID
{
"status": {
"message": "Success, staff_id 12 is now approved to buy resource_id: 6075",
"status_code": 200
}
}
DELETE /v1/resource-approval/{staffId}/{resourceId}
To disapprove buying all resources, use 'all' as the resource ID
{
"status": {
"message": "Success, staff_id 12 is has been disapproved from buying resource_id: 6075",
"status_code": 200
}
}