API V1 Documentation

Authentication

The 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

To obtain an API token, login to your Blink Lesson account, go to "Organization Settings", then "API".

Headers

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

URI

Blink Lesson API V1 is hosted on the following base URI:

https://api.blinksession.com/v1

Status Codes

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

Throttling, Request Limit

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.


Pagination, Limit, Sorting

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'.

Meta Object With GET Requests

meta: {
	pagination: {
	    total_count: 1354,
	    total_pages: 3,
	    current_page: 2,
	    limit: 500
	}
}

Staff vs. Student vs. Student-Login

When interacting with the Blink Lesson API you must understand the different between staff, student, and student-login.

Staff: A user account for a staff member (admin, therapist, providers, tutors, etc.). Staff are "linked" to all students they see Online.

Student: People that are receiving therapy/care/tutoring. The "Student" is not a user that logs in. Students are "linked" to one or more Student-Logins. Student-Logins can login and start a session for any "Student" linked to them.

Student-Login: The person who will login for the student. If the student is old enough to have an email address, this would be the Student them self. Otherwise, it would be a parent or helper. A "Student" also needs linked "Student-login" in order to be able to login and join a session. If your app will use SSO, it will be logging in the "Student-Login".

Diagram: Staff - Student - Student-Login

Single Sign On

Blink Lesson's Single Sign On service allows you to request a time-sensitive sso_token to login your staff and or students through your app.

Requirements

1. To turn on/off SSO for your organization send an email to support@blinksession.com.

2. Add redirect settings under "Single Sign On Settings" above.

3. When adding staff or student-logins through the API, if SSO is Off, the new user will receive a registration email. If SSO is ON, they will NOT receive a registration email and will be made "active" immediately.

Flow

1. Your server sends a POST to request a sso_token for a specific user (staff or student login).
2. Blink Lesson creates the sso_token with an expiration of 5 minutes.
3. Bink Session responds with the sso_token.
4. You receive the sso_token and direct your user to any login.blinklesson.app (or white label) URI with the sso_token as a URL parameter.
5. Blink Lesson will take the sso_token from the URL, log them in, and direct them to the intended page.

HTTP Request

POST /v1/sso/{staffId} OR {studentLoginId}

Response

{
	"data": {
	    "id": 12,
	    "sso_token": "tE3YvtHy5t56w2Ou2fmB"
	},
	"status": {
	    "message": "Success, sso_token attached",
	    "status_code": 200
	}
}

Example

1. You need to send a staff user to Blink Lesson for a session. The user's Blink Lesson ID is 855 and the session is with student ID 1233.
2. You send a POST to https://api.blinksession.com/v1/sso/855 (with your api_token in the auth header).
3. You received the sso_token back.
4. You redirect your user to the Blink Lesson dashboard with the sso_token:
login.blinklesson.app?sso_token={sso_token}


Session (Online Lesson) Route OR Join-By-Link

Staff must login to join sessions (SSO or manual login). But, people meeting with staff can join two ways.

1) Session Route: If you will be storing student data in Blink Lesson (lessons, notes, uploads, boards, etc.), you will need to create a student and student login for each. You will direct such students to sessions by building a "Session Route". In other words, they will need to login or be logged in through SSO to join sessions.

1) Join-by-Link: If you will NOT be storing student data in Blink Lesson, you can simply direct session (online lesson) participants to the staff person's "join_by_link". In other words, you do not need to create the student in Blink Lesson, they can simply join by going to the staff user's "join_by_link".


Routes with SSO

If you are utilizing the SSO system, you can direct users to any URI within Blink Lesson (or white-label URL). Though, the only routes you will likely direct your users to are the dashboard and a session (online lesson). If your organization has a white-label setup, replace https://login.blinklesson.app with your white-label URL.

Dashboard

To direct to the dashboard with SSO you would use:
https://login.blinklesson.app?sso_token={token}


Building a Staff Session (online lesson) URL

Staff session URLs include the student id or student ids of the students that will be in the session (online lesson). Notice, you should include the studentId, not the studentLoginId.

Single Student Session

https://login.blinklesson.app/session/{studentId}?sso_token={token}

Group Session (online lessons)

For group sessions (online lesson), staff can either add students to the session on the group session page, or, you can pass the studentIds as a parameter so they are automatically chosen. The "s" parameter should = a comma separated list of studentIds.

https://login.blinklesson.app/session/multi?s={listOfIds}&sso_token={token}

Building a Student Session URL

Student session URLs include the staff id AND student id. Notice, you should include the studentId, not the studentLoginId, but you will request a sso_token for the studentLoginId.

All Student Sessions

Whether the student is joining a single or group session, the session URL is the same. When the URL is hit, the system will check if the staff id has added the student id to a group session. If yes, it will automatically route the user to the group session. If not, it will route to a regular session.

https://login.blinklesson.app/session/{studentId}/{staffId}?sso_token={token}

Staff Endpoints

Staff GET

HTTP Request

GET /v1/staff/{staffId}

To retrieve all staff, omit staffId

Parameters

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)

  • students
  • studentsWithLinkedStudentLogins
  • permissions

limitTo set limit to less than 500
sort Sort by options:
id
first_name
last_name
display_name
email
phone
activated
user_timezone
created_at
updated_at
directionasc or desc. asc is default.

Response

{
    "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
                }
            ]
        }
    ]
}

Response Key

user_availability: If the staff user has set their available, each slot will be represented as it's own JSON object. "dow" = day with 0 being Sunday. "start" and "end" are based on the user's timezone.
join_by_link: Link people can use to join a session with this staff user. This should only used for sessions with people you do not need to store data on in Blink Lesson (appointments, notes, uploads, boards, etc.). NOTE: if the organization has white-label setup, the user's join_by_link will be the white-label URL.

Staff POST

HTTP Request

* If SSO is OFF, staff will receive a registration email. If SSO is ON, staff will NOT receive a registration email.
* When new staff are created the organization's credit card will be charged a prorated charge amount for the remainder of the current month.
* On success, you should store the new staff's ID in your database (i.e. blink_session_staff_id). You will need this if you will be using SSO.
POST /v1/staff

Payload

Key Description
first_nameREQUIRED
last_nameREQUIRED
display_name REQUIRED - Name students will see
email 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)

Response

{
	"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
            }
        ]
    }
}

Staff PUT

HTTP Request

PUT /v1/staff/{staffId}

Payload

Key Description
first_name
last_name
display_name Name students will see
email 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.

Response

{
	"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
            }
        ]
    }
}

Staff DELETE

HTTP Request

DELETE /v1/staff/{staffId}

Response

{
    "status": {
        "message": "Success, staff deleted. Subscription price will be adjusted next month to reflect change in the number of staff.",
        "status_code": 200
    }
}

Students Endpoints

Students GET

HTTP Request

GET /v1/students/{studentId}

To retrieve all students, omit studentId

Parameters

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)

  • linkedStudentLogins
  • linkedStaff
  • eventsFuture (future appointments)
  • eventsAll (all appointments)
  • invoices
  • unpaidInvoices
  • studentNotes
  • notesStudentVisible (studentNotes visible to student)
  • goals (progress json attached)
  • goalsStudentVisible (progress json attached)
  • scores (resource scores)
  • uploads
  • uploadsStudentVisible

limitTo set limit to less than 500
sort Sort by options:
id
location_id
location
discharged
created_at
updated_at
directionasc or desc. asc is default.

Response

{
    "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"
                    },
                }
            ]
        }
    ]
}

Students POST

HTTP Request

* Students will be checked for duplicates by first_name, last_name, and date_of_birth
* On success, you should store the new student's ID in your database (i.e. blink_session_student_id).
POST /v1/students

Payload

Key Description
first_nameREQUIRED
last_nameREQUIRED
date_of_birthREQUIRED (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.

Response

{
	"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": "",
    }
}

Students PUT

HTTP Request

PUT /v1/students/{studentId}

Payload

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.

Response

{
    "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": ""
    }
}

Students DELETE

HTTP Request

DELETE /v1/students/{studentId}

Response

{
    "status": {
        "message": "Success, student deleted.",
        "status_code": 200
    }
}

Student-Logins Endpoints

Student-Logins GET

HTTP Request

GET /v1/student-logins/{studentLoginId}

To retrieve all student logins, omit studentLoginId

Parameters

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)

  • students (linked students)
  • invoices (from all user's linked students)
notificationPrefs
limitTo set limit to less than 500
sort Sort by options:
id
created_at
updated_at
directionasc or desc. asc is default.

Response

{
    "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
                }
            ],
        }
    ]
}

Student-Logins POST

HTTP Request

* If SSO is OFF, student-logins will receive a registration email. If SSO is ON, student-logins will NOT receive a registration email.
* On success, you should store the new student-login's ID in your database (i.e. blink_session_student_login_id). You will need this if you will be using SSO.
POST /v1/student-logins

Payload

Key Description
first_nameREQUIRED
last_nameREQUIRED
email 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)

Response

{
	"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
        }

    }
}

Student-Logins PUT

HTTP Request

PUT /v1/student-logins/{studentLoginId}

Payload

Key Description
first_name
last_name
email 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)

Response

{
	"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
        }
    }
}

Student-Logins DELETE

HTTP Request

DELETE /v1/staff/{studentLoginId}

Response

{
    "status": {
        "message": "Success, student-login deleted.",
        "status_code": 200
    }
}

Events (schedule) Endpoints

Events Preface

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.

Events GET

HTTP Request

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}

Parameters

Key Description
timezoneREQUIRED - Blink Lesson will convert start and end times to the timezone you pass. Must be valid PHP timezone: List
futurePass future=1 to get only future events. Don't pass future & past together.
pastPass past=1 to get only past events. Don't pass future & past together.
rangeStartYYYY-MM-DD - calculated based on the timezone you pass.
rangeEndYYYY-MM-DD - calculated based on the timezone you pass.
statusPass 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:
  • Scheduled
  • Completed
  • Canceled-by-Staff
  • Canceled-by-Student-(Advance-Notice)
  • Canceled-by-Student-(Late-Notice)
  • Student-No-Show
  • Canceled-Facility-School-Closed
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)

  • students (all students linked to event with their linked_student_logins)
  • staff (all staff linked to event)

limitTo set limit to less than 500
sort Sort by options:
id
status
type_id
start
end
created_at
updated_at
recurring_of_event_id
directionasc or desc. asc is default.

Response

{
    "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": "",
                    }
                }
            ],
        },
    }        
}

Response Key

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.

Events POST

* New events must be linked to at least one staff (staff_ids).
* If a new event will not be linked to a student, it must have a title parameter.
* The timezone parameter is required when adding events. Start and end date/time for the event will be calculated based on your timezone.

HTTP Request

POST /v1/events

Payload

Key Description
linked_staff_idsREQUIRED - add parameter 'linked_staff_ids' with each staff id separated by a comma (i.e. staff_ids=458,1025)
timezoneREQUIRED - 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

Response

{
    "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"
                }
            }
        ]
    }
}

Events PUT

* Non-Recurring events cannot be changed to recurring.
* The frequency and number-of-weeks of recurring events cannot be changed.
* For recurring events you can update a single event in a series OR an event plus all future events in the series. But..
* Changing a single event in the series will also remove it from the series.
* Changing the event + future in the series will create a new series.

HTTP Request

PUT /v1/events/{eventId}

Payload

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 timezoneIf 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
timezoneIf 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.
statusChange event status to:
  • Scheduled
  • Completed
  • Canceled-by-Staff
  • Canceled-by-Student-(Advance-Notice)
  • Canceled-by-Student-(Late-Notice)
  • Student-No-Show
  • Canceled-Facility-School-Closed
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.

Response

{
	"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
            }
        ]
    }
}

Events DELETE

* For recurring events you can delete a single event in a series OR the event plus all future events in the series.

HTTP Request

DELETE /v1/events/{eventId}

Payload

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.

Response

{
    "status": {
        "message": "Success, event deleted.",
        "status_code": 200
    }
}

Reports

Report - Events GET

HTTP Request

GET /v1/reports/events

Parameters

Key Description
timezoneREQUIRED - Blink Lesson will convert start, end, and other dates/times to the timezone you pass. Must be valid PHP timezone: List
rangeStartREQUIRED - YYYY-MM-DD - calculated based on the timezone you pass.
rangeEndREQUIRED - YYYY-MM-DD - calculated based on the timezone you pass.
statusPass 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:
  • Scheduled
  • Completed
  • Canceled-by-Staff
  • Canceled-by-Student-(Advance-Notice)
  • Canceled-by-Student-(Late-Notice)
  • Student-No-Show
  • Canceled-Facility-School-Closed
limitTo 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
directionasc or desc. asc is default.

Response

{
    "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"
        }
    ]
}

Response Key

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.



Report - Sessions GET

HTTP Request

GET /v1/reports/sessions

Parameters

Key Description
timezoneREQUIRED - Blink Lesson will convert dates/times to the timezone you pass. Must be valid PHP timezone: List
rangeStartYYYY-MM-DD - calculated based on the timezone you pass.
rangeEndYYYY-MM-DD - calculated based on the timezone you pass.
statusPass 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:
  • Scheduled
  • Completed
  • Canceled-by-Staff
  • Canceled-by-Student-(Advance-Notice)
  • Canceled-by-Student-(Late-Notice)
  • Student-No-Show
  • Canceled-Facility-School-Closed
limitTo 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
directionasc or desc. asc is default.

Response

{
    "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
        }
    ]
}

Response Key

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.


Resource Seller Endpoints

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".

Approve Buyer Flow

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:

resource_id
staff_id
first_name
last_name
organization_name
email

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.

Disapprove Buyer

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.

Approve Buyer POST

HTTP Request

POST /v1/resource-approval/{staffId}/{resourceId}

To approve buying all resources, use 'all' as the resource ID

Who's Selling? This endpoint will accept approving resources sold by any staff user or resource seller who is part of your organization. If you omit resourceId, the buyer will have permission to buy restricted resources from all sellers who are part of your organization.

Response

{
	"status": {
        "message": "Success, staff_id 12 is now approved to buy resource_id: 6075",
        "status_code": 200
    }
}

Disapprove Buyer DELETE

HTTP Request

DELETE /v1/resource-approval/{staffId}/{resourceId}

To disapprove buying all resources, use 'all' as the resource ID

NOTE? If you previously approved the staff_id to buy all resources, you must disapprove all. If you try to disapprove a specific resource_id and previously approved all, you will receive an error telling you to disapprove all first.

Response

{
    "status": {
        "message": "Success, staff_id 12 is has been disapproved from buying resource_id: 6075",
        "status_code": 200
    }
}