SkyPrep API

Introduction

Welcome to the SkyPrep API. The API allows you to do most common actions in SkyPrep. This includes create, read, update and delete operations for users, groups, courses and enrollments.

The API is a simple HTTP GET/POST interface using query string parameters (e.g. a request can look like https://api.skyprep.io/admin/api/create_user?api_key=12345
&user_email=sampleuser@skyprep.com&first_name=James....
) or POST body parameters. It is designed around ease-of-use and is fairly simple to get working with in many programming and scripting languages.

All responses are returned in JSON format by default. To return XML, append the parameter format equal to xml to the request.

A RESTful version of the API will become available in the near future.

We recommend using the Postman Client for Google Chrome to test using the API to understand how data is returned.

If you are simply testing the API in the Google Chrome browser, you should also install JSONView which will format and properly unescape JSON-formatted text.

All API requests are made to https://api.skyprep.io/admin/api

Any questions can be sent to api@skyprep.com


SDKs


Authentication

The API requires the account's API key to provided as part of every request, as well as your platform's domain (without any HTTP or HTTPS prefix). The API key can be found in the Customization tab of the platform. All requests MUST include the api_key.

** Make sure to keep the api_key private and secure. DO NOT expose the API key. **

A version of the API that authenticates using signed parameters (HMAC/SHA2) that do not include an API key as part of the request payload will be made available in the near future to allow embedding API calls in public-facing/non server-side links.

        GET https://api.skyprep.io/admin/api/test_connection

         #parameters

          {
          	"api_key" : "Your API Key", //Required
          	"acct_key" : "yourskyprepdomain.skyprepapp.com" //Required
          }


         #sample response

          {
          	"message" : "success"
          }

        
      

Users

The SkyPrep API lets you add, update and delete users.

Get All Users

Get all the users in the system.
Returns a JSON array.

GET https://api.skyprep.io/admin/api/get_users

GET https://api.skyprep.io/admin/api/get_users


#sample response 
[ {
	"id" : 32,
	"first_name" : "John",
	"last_name" : "Doe",
	"username" : "john.doe@skyprep.com",
	"card_no" : "Emp. # 3211221",
	"created_at" : "June 23 2013 12:00:00"
	//More JSON data

	
},
{
	"id" : 44,
	"first_name" : "James",
	"last_name" : "Deere",
	"username" : "james.deere@skyprep.com",
	"card_no" : "Emp. # 1472546",
	"created_at" : "June 28 2013 12:00:00"
	//More JSON data

	
},

....


]




Get a User

Users data can be retrieved using the API.

GET https://api.skyprep.io/admin/api/get_user
user_id (or user_email ):
integer / string The internal ID of the user (this cannot be changed) OR the users email.

GET https://api.skyprep.io/admin/api/get_user

#parameters {
	"user_id" : The internal SkyPrep user_id (unique) //OR
	"user_email" : "The users email"
}

#sample response {
	"id" : 32,
	"first_name" : "John",
	"last_name" : "Doe",
	"username" : "john.doe@skyprep.com",
	"card_no" : "Emp. # 3211221"
	//More JSON data

	
}



Create a User

Users (learners, admins, managers) can be created through the API by passing in these parameters

POST https://api.skyprep.io/admin/api/create_user
email:
string (required) The email of the user
password:
string (optional ) The password of the user. This must be 8 characters. Otherwise, a password will be automatically generated.
first_name:
string The first name of the user
last_name:
string The last name of the user
email_notifications
boolean Whether the user receives email notifications
card_no:
string The unique user identifier of the user (e.g. student #, badge #)
cell:
string The users cell phone number
title:
string The users title
work_phone:
string The users work phone number
address:
string The users address
admin:
boolean (false) Whether the user is an admin
manager:
boolean (false) Whether the user is a manager
ca_{x}:
string Custom Attribute {x}
(Note: x is a number between 0 and 10, e.g. ca_3) for a total of 11 custom attributes
send_login_information:
boolean (false) Whether to email the user their log-in information (username/password).

POST https://api.skyprep.io/admin/api/create_user

#parameters {
	"email" : 'james.doakes@skyprep.com'
	"first_name" : "James",
	"last_name" : "Doakes",
	"admin" : false,
	"manager" : true,
	"title" : "Detective",
	"cell" : "818-333-3333",
	"work_phone" : "818-444-4444",
	"address " : "10 Dexter Drive Miami FL"
	"card_no" : "Badge No. 158-612",
	"ca_0" : "Alias: Bay Harbour Butcher"

}

#sample response {
	"id" : 21,
	"first_name" : "James",
	"last_name" : "Doakes",
	"username" : "james.doakes@skyprep.com",
	"card_no" : "Badge No. 158-612",

	//Additional user data

	
}



Update a User

Users (learners, admins, managers) can be updated through the API by passing in these parameters. If parameters are ommited, they are not updated.

POST https://api.skyprep.io/admin/api/update_user

Note: parameters are the same as create above


POST https://api.skyprep.io/admin/api/update_user

#parameters {
	"user_email" : 'james.doakes@skyprep.com'
	"first_name" : "James",
	"last_name" : "Doakes",
	"admin" : false,
	"manager" : true,
	"title" : "Detective",
	"cell" : "818-333-3333",
	"work_phone" : "818-444-4444",
	"address " : "10 Dexter Drive Miami FL"
	"card_no" : "Badge No. 158-612",
	"ca_0" : "Alias: Bay Harbour Butcher",
	"access_start_date" : "July 31, 2015",
	"access_end_date" : "July 30, 2017"

}

#sample response {
	"id" : 21,
	"first_name" : "James",
	"last_name" : "Doakes",
	"username" : "james.doakes@skyprep.com",
	"card_no" : "Badge No. 158-612",

	//Additional user data

	
}



Delete a User

Deletes a user permanentely from the system.

POST https://api.skyprep.io/admin/api/destroy_user
user_email:
string (required) The email of the user to delete

POST https://api.skyprep.io/admin/api/destroy_user

#parameters {
	"user_email" : "james.doakes@skyprep.com"
}

#sample response {
	"message" : "success"
}



Retrieve automatic sign-in link (SSO)

Get an automatic sign-in URL for a user (by email)

user_email:
string (required) The email of the user
autocreate:
boolean (false) If set, the user will be automatically created if the user does not exist in the platform
user_first_name:
string The first name of the user
user_last_name:
string The last name of the user
key_type:
string (daily) can be either 'otl' or 'daily'. OTL generate one-time login keys so if the link returned is followed, it no longer works. Daily generates a login key usable for the entire day (UTC time)
user_groups:
string The list of user groups names the user should be enrolled in, separated by semi-colons (;). If a group does not exist, the group will be automatically created as well.
(Note: This should be the names as strings, not the IDs)

GET https://api.skyprep.io/admin/api/get_login_key/

#parameters
{
	"user_email" : 'dexter.morgan@skyprep.com',
	"autocreate" : true,
	"key_type" : "daily",
	"user_groups" : "Forensics Lab;Miami PD Staff"

}

#sample response
{
	"email": "dexter.morgan@skyprep.com",
	"login_key": "abcdefghijklmnopqrstuvwxyz0123456789",
	"url": "https://yourskyprepdomain.skyprepapp.com/account/signin?username=dexter.morgan@skyprep.com&login_key=abcdefghijklmnopqrstuvwxyz012345689"
}


Get Courses a User is Enrolled In

Get all the courses a user is currently enrolled in (directly, through groups and course bundle).
Returns a JSON array of courses.

GET https://api.skyprep.io/admin/api/get_user_courses
user_email:
string (required) The email of the user

GET https://api.skyprep.io/admin/api/get_user_courses


#sample response (Array)
[

 {
 	//Course JSON 1
 },

 {
 	//Course JSON 2
 },

 ///.... More courses
]




Warning: include(/var/www/http_docs/wp-content/themes/skyprep-api/_partials/_passed_course.php): failed to open stream: No such file or directory in /var/www/http_docs/wp-content/themes/skyprep-api/config.php on line 101

Warning: include(): Failed opening '/var/www/http_docs/wp-content/themes/skyprep-api/_partials/_passed_course.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/http_docs/wp-content/themes/skyprep-api/config.php on line 101

Mass Enroll Users into Courses, Groups and Course Bundles

Users data can be mass-enrolled into courses, groups and course bundles.

POST https://api.skyprep.io/admin/api/mass_enroll
user_ids
integers (required) comma-seperated IDs of the users
OR user_emails
emails (required) comma-seperated emails of the users
user_group_ids
integers comma-seperated IDs of the groups to enroll into
course_ids
integers comma-seperated IDs of the courses to enroll into
course_bundle_ids
integers comma-seperated IDs of the course bundles to enroll into

GET https://api.skyprep.io/admin/api/mass_enroll

#parameters {
	"user_emails" : "dexter@skyprep.com,james@skyprep.com"
	"course_ids" : "84,96,101,323",
	"user_group_ids" : "505,680,4,122",
	"course_bundle_ids" : "222"
}

#sample response {

	"message" : "success" 
	
}



Courses

The SkyPrep API lets you update and delete courses. It also allows you to enroll users, and user groups into courses.

Get All Courses

Get All the Courses in the System

GET https://api.skyprep.io/admin/api/get_courses

GET https://api.skyprep.io/admin/api/get_courses

#sample response 
[
 {
 	//Course JSON 1
 },
 {
 	//Course JSON 2
 }
]



Courses

Courses contain the following fields which can be updated. The beta API currently returns additional parameters and information but only the parameters below are updatable through the update_user action.

id:
integer The internal ID of the course (this cannot be changed)
name:
string The name of the course
description:
string The description of the course
end_date:
date The course end date
start_date:
date The course start date

GET https://api.skyprep.io/admin/api/get_course

#parameters {
	"course_id" : The internal SkyPrep course_id (unique)
}

#sample response {
	"id" : 101,
	"name" : "My Course",
	....
	//More JSON data

	
}



Create a Course

Creates a course.

POST https://api.skyprep.io/admin/api/create_course
name:
string The name of the course
description:
string The description of the course.
start_date:
datetime The start date of the course.
end_date:
string The end date of the course.
active:
boolean Whether the course is active or not (i.e. available to learners)

POST https://api.skyprep.io/admin/api/create_course


#sample params {
	"name" : "How to Catch A Serial Killer",
	"active" : "true"
}

#sample response 

 {
 	"id" : "8877",
 	"name" : "How to Catch A Serial Killer",
 	....
 }


Update a Course

Updates a course.

POST https://api.skyprep.io/admin/api/update_course
course_id:
integer (required) The ID of the course
name:
string The name of the course
description:
string The description of the course.
start_date:
datetime The start date of the course.
end_date:
string The end date of the course.
active:
boolean Whether the course is active or not (i.e. available to learners)

POST https://api.skyprep.io/admin/api/update_course


#sample params {
	"course_id" : "6294",
	"name" : "How to Catch A Serial Killer",
	"active" : "true"
}

#sample response 
 {
 	"message" : "success"
 }


Delete a Course

Deletes a course permanentely from the system.

POST https://api.skyprep.io/admin/api/destroy_course
course_id
integer (required) The Internal SkyPrep course id

POST https://api.skyprep.io/admin/api/destroy_course

#parameters {
	"course_id" : "8812"
}

#sample response {
	"message" : "success"
}



Enroll a User into a Course

Users data can be retrieved using the API.

GET https://api.skyprep.io/admin/api/enroll_user_in_course
user_id
integer (required) The ID of the user
OR user_email
string (required) The email of the user
course_id
integer The ID of the course

POST https://api.skyprep.io/admin/api/enroll_user_in_course

#parameters {
	"user_email" : "dexter@skyprep.com",
	"course_id" : "144123"
}

#sample response 
{	
	"message" : "success"
}



Remove a User from a Course

POST https://api.skyprep.io/admin/api/remove_user_from_course
user_id
integer (required) The ID of the user
OR user_email
string The email address of the user
course_id
integer(required) The ID of the user group

POST https://api.skyprep.io/admin/api/remove_user_from_course

#sample parameters 

{
	"user_email" : "doakes@skyprep.com",
	"course_id" : "18872"
}

#sample response

{
	"message" : "success"	
}




Enroll a User into Courses

Enroll a single user into multiple courses. The courses are passed in as a comma-separated list of course IDs

POST https://api.skyprep.io/admin/api/enroll_user_in_courses
user_id
integer (required) The ID of the user
course_ids
integer(required) The IDs of the courses (comma-separated)

POST https://api.skyprep.io/admin/api/enroll_user_in_courses

#parameters {
	"user_id" : "77121"
	"course_ids" : "13,889,15,796,9788"
}

#sample response 
{
	"message" : "success"	
}



Add a Course into a User Group

POST https://api.skyprep.io/admin/api/add_course_to_user_group
course_id
integer (required) The ID of the course
user_group_id
integer(required) The ID of the user group

POST https://api.skyprep.io/admin/api/add_course_to_user_group

#parameters
{
	"user_group_id" : "1821",
	"course_id" : "123123"
}

#sample response
{
	"message" : "success"
}



Get a Course One-Time Password (OTP) Subscribe Key for a Course

OTP keys are course enrollment keys that can be provided to learners so they can self-enroll into a course using the courses self-enrollment link.

They are similar to the subscribe key for a course that you can set within the SkyPrep interface. The only difference is that an OTP key can only be used once, by a single user.

OTP keys are useful for scenarios where you need to provide limited access to a course, but you don't want to enroll users ahead of time. You can simply send them the key and they can enroll when they are ready.

OTP keys are also useful for selling courses. When a buyer buys the course, you can provide them the OTP key and the link to enroll into the course. OTP keys can only be used once.

Please note that a generated OTP key is tied to the main subscribe_key value in the course. If the subscribe_key changes, OTP keys become invalidated unless the subscribe_key is reverted back to what it was previously.

GET https://api.skyprep.io/admin/api/get_course_otp
course_id:
integer / string The internal ID of the user (this cannot be changed) OR the users email.
count (default: 10):
integer The number of OTP keys to generate
      
      GET https://api.skyprep.io/admin/api/get_course_otp

      #parameters {
      	"course_id" : "171",
      	"count" : 2
      }

      #sample response:
      [
      	"1234-5123-412",
      	"6712-zhja-181"
      ]


      
      

Get a User's Status in a Course

Users data can be retrieved using the API.

GET https://api.skyprep.io/admin/api/get_user_course_status
user_id (or user_email ):
integer / string The internal ID of the user (this cannot be changed) OR the users email.
course_id
integer The internal ID of the course.

GET https://api.skyprep.io/admin/api/get_user_course_status

#parameters 
{
	"user_id" : The internal SkyPrep user_id (unique) //OR
	"user_email" : "The users email",
	"course_id" : "8781"
}

#sample response 
{
	"status" : "passed"	
}



User Groups

The SkyPrep API lets you add, update and delete user groups.

User Groups

User Groups (i.e. Groups) are collections of users and collections of courses. A user who is enrolled into a user group has access to all the courses the user group has part of it.

GET https://api.skyprep.io/admin/api/get_user_groups



Get a User Group

Get a User Group and list of all of its users.

GET https://api.skyprep.io/admin/api/get_user_group

user_group_id
integer (required The ID of the user group

#sample parameters 
{
	"user_group_id" : "6401"
}

#sample response 
{
	"name" : "My Course",
	"users" : [
		//List of Users
	]
}


Create a User Group

User Groups (learners, admins, managers) can be created through the API by passing in these parameters

POST https://api.skyprep.io/admin/api/create_user_group
name
string (required The name of the user group
course_ids
string Comma separated IDs of courses that this user group should have access to
user_ids
string Comma separated IDs of users that should be members of this group.
user_group_id
integer The user group ID that this user group belongs to.

POST https://api.skyprep.io/admin/api/create_user_group

#parameters {
	"name" : 'Sales Team',
	"course_ids" : "693,431,6090",
	"user_ids" : "352,454,5553"

}

#sample response
{
	"id" : "123",
	"name" : "Sales Team"
	....
	
}



Update a User Group

Update a User Group

POST https://api.skyprep.io/admin/api/update_user_group




Delete a User Group

Delete a User Group

POST https://api.skyprep.io/admin/api/destroy_user_group


POST https://api.skyprep.io/admin/api/destroy_user_group

#sample parameters {
	"user_group_id" : "6612"
}

#sample response 
{
	"message" : "success"
}


Enroll a User into a User Group

POST https://api.skyprep.io/admin/api/enroll_user_in_user_group
user_id
integer (required) The ID of the user
user_group_id
integer(required) The ID of the user group

POST https://api.skyprep.io/admin/api/enroll_user_in_user_group

#parameters {
	"user_id" : The internal SkyPrep user_id (unique) //OR
	"user_email" : "The users email"
}

#sample response 
{
	"message" : "success"	
}



Remove a User from a User Group

POST https://api.skyprep.io/admin/api/remove_user_from_user_group
user_id
integer (required) The ID of the user
user_group_id
integer(required) The ID of the user group

POST https://api.skyprep.io/admin/api/remove_user_from_user_group

#parameters {
	"user_id" : "212",
	"user_group_id" : "7633"
}

#sample response

{
	"message" : "success"	
}




Get List of User Groups for a User

Get a list of the groups a user belongs to.

GET https://api.skyprep.io/admin/api/get_user_group_enrollments_for_user
user_id (or user_email ):
integer / string The internal ID of the user (this cannot be changed) OR the users email.

GET https://api.skyprep.io/admin/api/get_user

#parameters 
{
	"user_id" : The internal SkyPrep user_id (unique) //OR
	"user_email" : "The users email"
}

#sample response 
[
	{
		"id" : "1234",
		"name" : "Marketing Group",
		...
	},
	{
		"id" : 4512,
		"name" : "Sales Group",
		...
	},
	...
]




Add a Course into a User Group

POST https://api.skyprep.io/admin/api/add_course_to_user_group
course_id
integer (required) The ID of the course
user_group_id
integer(required) The ID of the user group

POST https://api.skyprep.io/admin/api/add_course_to_user_group

#parameters
{
	"user_group_id" : "1821",
	"course_id" : "123123"
}

#sample response
{
	"message" : "success"
}



Remove a Course from a User Group

POST https://api.skyprep.io/admin/api/remove_course_from_user_group
course_id
integer (required) The ID of the course
user_group_id
integer(required) The ID of the user group

POST https://api.skyprep.io/admin/api/remove_course_from_course_group

#parameters {
	"course_id" : The internal SkyPrep course id (unique) //OR
	"user_group_id" : "The internal SkyPrep user_group_id"
}

#sample response 
{
	"message" : "success"	
}




Course Progresses

The SkyPrep API lets you update and delete a user's course progress in a course.

Get All Course Progresses for a Single Course

GET https://api.skyprep.io/admin/api/get_course_progresses
course_id
integer (required The ID of the course

GET https://api.skyprep.io/admin/api/get_course_progresses

#parameters {
	"course_id" : "8812"
}

#sample response 
[
	{
		//Course Progress 1
	},
	{
		//Course Progress 2
	}
]




Get a Course Progress

Get a Course Progress

GET https://api.skyprep.io/admin/api/get_course_progress
user_id
integer (required) The ID of the user
course_id
integer (required The ID of the course
OR course_progress_id
integer (required The ID of the course progress

GET https://api.skyprep.io/admin/api/get_course_progress

#parameters {
	"course_progress_id" : "96854"
}

#sample response {
	"message" : "success"
}



Update a Course Progress

Updates a Course Progress

POST https://api.skyprep.io/admin/api/update_course_progress
course_progress_id
integer (required) The ID of the course progress
completion_date
datetime The completion date
set_status
string One of passed, failed, in-progress
      
      POST https://api.skyprep.io/admin/api/update_course_progress

      #parameters {
      	"course_progress_id" : "96854",
      	"set_status" : "failed"
      }

      #sample response {
      	"message" : "success"
      }


      
      

Delete a Course Progress

Delete a Course Progress Permanentely from the System

POST https://api.skyprep.io/admin/api/destroy_course_progress
course_progress_id:
integer (required) The internal SkyPrep ID of the coures_progress

POST https://api.skyprep.io/admin/api/destroy_course_progress

#sample parameters
{
	"course_progress_id" : "96854"
}

#sample response 
{
	"message" : "success"
}



Get Progress of a Course Item for a Single User

Get the progress of a course item for a user.
This call requires some combination of exam_id, user_id, course_id, course_progress_id and course_item_id for the API to return the status of a users progress through a specific course_item.
For example, if you specify the course_item_id and user_id, the system will figure out the course belonging to the course_item, get the course_progress of the user in that course, and then get the course_item_progress of that course_progress.
Another example. If you specify the exam_id and course_progress_id, the system will find the course_progress, figure out the user and the course, and find the first course item in that course that matches that has that exam as its exam_id, and return the users course_item progress for that course_item.

GET https://api.skyprep.io/admin/api/get_course_item_progress
user_id
integer The ID of the user
course_id
integer The ID of the course
course_item_id
integer The ID of the course item
exam_id
integer The ID of the exam
course_progress_id
integer The ID of the course progress

GET https://api.skyprep.io/admin/api/get_course_item_progress

#parameters {
  "course_id" : "1234",
  "user_id" : "5223",
  "course_item_id" : "5231",
}

#sample response {
  "message" : "success"
}


Set Course Item Progress

Set the Progress for a course item for a user in a course

POST https://api.skyprep.io/admin/api/set_course_item_progress
course_id
integer (required) The ID of the course
user_id
integer (required) The ID of the user
OR
------
course_progress_id
integer The ID of the course progress
course_item_id
The ID of the course item 1
set_status
The status to set to (passed, failed, in-progress, not-started
score
The score to set to
time
The time to set to
completion_date
The date that item was completed
      
      POST https://api.skyprep.io/admin/api/set_course_item_progress

      #parameters {
      	"user_id" : "124112",
      	"set_status" : "failed"
      }

      #sample response {
      	"message" : "success"
      }


      
      

Reports

The SkyPrep API lets you generate CSV reports.

Get a Report

Reports can be generated by passing in a report_type parameter as well as additional parameters required for the report (e.g. user_id, course_id, exam_id etc).

POST https://api.skyprep.io/admin/api/get_report
format:
One of
csv (default)
xlsx
report_type:
string (required) One of
all_users
all_courses
single_user
single_course
single_user_single_course
single_user_single_group
single_group_all_users
single_group_all_courses
single_exam

GET https://api.skyprep.io/admin/api/get_report

#sample parameters {
	"report_type" : "single_course_single_user",
	"user_id" : "41",
	"course_id" : "88"
}


Generate a Report Asynchronously

Reports can be generated by passing in a report_type parameter as well as additional parameters required for the report (e.g. user_id, course_id, exam_id etc).

A status_url is returned that you can visit to get the status and data of the report (when it is ready).

POST https://api.skyprep.io/admin/api/generate_async_report
format:
One of
csv (default)
xlsx
report_type:
string (required) One of
all_users
all_courses
single_user
single_course
single_user_single_course
single_user_single_group
single_group_all_users
single_group_all_courses
single_exam

GET https://api.skyprep.io/admin/api/generate_async_report

#parameters 
{
	"report_type" : "all_users",
	"format" : "csv"
}

#sample response 
{
	"status_url" : "https://api.skyprepapp.com/admin/api/get_async_report?report_id=1234"
}



Warning: include(/var/www/http_docs/wp-content/themes/skyprep-api/_partials/_articles.php): failed to open stream: No such file or directory in /var/www/http_docs/wp-content/themes/skyprep-api/config.php on line 101

Warning: include(): Failed opening '/var/www/http_docs/wp-content/themes/skyprep-api/_partials/_articles.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/http_docs/wp-content/themes/skyprep-api/config.php on line 101

Your SkyPrep Account

The SkyPrep API lets you update your SkyPrep account.

Account

Your SkyPrep account information.

GET https://api.skyprep.io/admin/api/get_program

GET https://api.skyprep.io/admin/api/get_program

#sample response {
	"acct_key" : "myapp.skyprepapp.com",
	"name" : "Your SkyPrep Training Program",
	//More JSON data

	
}



Get System Data

Get data/statistics about your platform

GET https://api.skyprep.io/admin/api/get_data
data_type:
string (required) One of user_count,
admin_count,
learner_count,
course_count,
user_group_count

GET https://api.skyprep.io/admin/api/get_data

#parameters {
	"data_type" : "learner_count"
}

#sample response {
	"data" : "587"
}



Content

The SkyPrep API lets you fetch your content.

Get Materials

Get All materials in your platform

GET https://api.skyprep.io/admin/api/get_materials

GET https://api.skyprep.io/admin/api/get_materials

#sample response 
[
 {
 	//Material 1
 },
 {
 	//Material 2
 }
]