Coursio API Documentation
General
An API method is always called via an HTTP POST request to an entity-named endpoint. Exact method name and any
possible parameters are placed into the request payload and encoded as a JSON string. RPC model has a routing
advantage over REST in our quite complex case and allows us to use the same API calls internally if we need to
prerender JSON data into the view before serving the page.
API uses camelCased names rather than under_scored.
HTTP request structure
All the fields except method are not obligatory.
{
"method": "someMethod", // method name
"data":
{
... // all the function arguments go here
}
"pageStart": 0, // data output starting row
"pageLength": 10 // data output row limit
}
If no output page limit is specified, then no limitation is performed. Normally you will not need to use
pagination as in many cases nice filtering is available within the methods themselves.
Responses structure
{
"isError": false, // a boolean showing the overall operation result
"errMsg": null, // possible error message string
"data":
{
... // output from the called method
}
}
HTTP response codes
Code | Description |
400 | Invalid data was sent. |
401 | Function requires proper authentication. |
403 | Access for the current user is denied. |
404 | Function doesn't exist. |
500 | Internal error or an undefined situation. |
Authentication
If user login was successful the server sends back the session identifier (sessionId
property in the response structure). This identifier may be later sent together with any API call to work
within the same login session. Identifier is sent in an HTTP header Token.
Testing
For testing purposes one may use a version of API connected to a test database
(https://t-api.s.coursio.com/). All external services (e.g. payments
providers) connected to this version are also in test mode. Test database is at regular intervals synchronized
with a production one, so do not count on keeping your data there for a long period.
Available functions
Click on a specific endpoint to see a list of functions contained. Click on a function name to see a list of
parameters. Use 'Test' button to test API live. As the majority of function will require authentication, you
may use login form at the bottom of this page to log in.
Toggle all
-
-
course
—
Checks user's access to a course. User must be one of your readers or you. Pass 'expires' to set expiration date.
-
circle
—
Checks user's access to a circle. User must be one of your readers or you.
-
-
-
loginHmac
—
Logs you in via HMAC authentication. Use either HTTP headers or method variables.
-
-
-
-
loginCdk
—
Login using Coursio Disposable Key
-
-
status
—
Returns current status
-
-
-
-
restorePassword
—
Allows you to set a new password using a password restoration code
-
-
-
send
—
Sends an emails with an invitation
-
loadTerms
—
Loads the most recent terms and user info
-
accept
—
Accepts a business invite
-
-
-
list
—
Lists all existing business invites, use pagination
-
delete
—
Deletes a business invite completely
-
-
read
—
Returns a list of available course categories
-
-
-
-
-
-
-
-
addToCourse
—
Adds a circle to a course. Gives course access rights to all the circle users.
-
removeFromCourse
—
Removes a circle from a course. Removes course access rights for all the circle users.
-
-
-
reportTypo
—
Reports an error in module content to its owner
-
-
-
-
-
create
—
Creates an empty course (with 1 section and 1 page)
-
update
—
Updates the course object
-
delete
—
Performs a course soft-deletion
-
-
getToc
—
Retrieves the table of contents
-
-
-
-
-
-
-
joinForFree
—
Join a course now and for free if it's allowed by store rules
-
fetchDiploma
—
OBSOLETE. Please use diploma/download or diploma/mail instead
-
-
-
-
-
read
—
Lists all your course packages
-
findById
—
Shows all the info on a specified course package
-
create
—
Creates a course package
-
update
—
Updates a course package
-
delete
—
Deletes a course package
-
joinForFree
—
Join a course package now and for free if it's allowed by store rules
-
-
-
read
—
Lists all the courses that you can read
-
-
mail
—
Current user gets a diploma mailed to his inbox
-
download
—
Current user gets a diploma downloaded, served as base64
-
-
-
read
—
Lists all your discounts
-
findById
—
Shows all the info on a specified discount
-
-
-
-
-
-
-
-
find
—
Finds a file considering filters. This function requires pagination.
-
import
—
Imports a file by its URL. Function is synchronous!
-
getJobId
—
Retrieves the job ID (e.g. ZenCoder) for the file.
-
-
delete
—
Deletes a file completely. You will not be able to restore it. Ever.
-
-
-
move
—
Moves file(s) to a new directory.
-
-
-
-
-
-
-
emailBasedCall
—
Call a method in a sandbox with a session established for a user with a given email account
-
-
create
—
Creates an invitation link
-
delete
—
Deletes an invitation
-
showInfo
—
Shows various useful info on an invitation and objects related to it
-
findByCircleId
—
Finds invitation links associated with a certain circle
-
findByCourseId
—
Finds invitation links associated with a certain course
-
-
resend
—
Resends one of your invitations
-
-
-
-
-
-
bySms
—
Invites users to courses and/or a circle by SMS.
-
byEmails
—
Invites users to courses and/or a circle.
-
-
-
pageModule
—
Adds/updates/removes note from a Page Module
-
-
read
—
Lists notifications. Newest first.
-
count
—
Counts unread notifications
-
-
-
selfNotify
—
Send a custom notification to yourself.
-
-
-
update
—
Updates the page object
-
-
-
findById
—
Retrieves the page structure with data.
-
findBySlug
—
Finds a page by related slugs. This function is relatively resource-demanding.
-
markViewed
—
Marks the page viewed by the current user.
-
moveToSection
—
Safely moves page to another section. To move a page within a section use section/reorderPages().
-
merge
—
Merges pages. First page goes first.
-
-
create
—
Creates a page module
-
update
—
Updates a page module
-
delete
—
Deletes a page module
-
moveToNewPageRow
—
Creates a new page row on the same page and moves a page module to that page row.
-
findById
—
Returns a page module structure
-
-
note
—
WILL BE DEPRECATED! Use note/pageModule() instead
-
-
-
getProviders
—
Returns the list of available payment providers
-
start
—
Starts the payments process
-
-
read
—
Lists all the payments you have done
-
findById
—
Shows info on a specific made payment
-
-
-
refund
—
Refunds an incoming payment
-
-
export
—
Exports payments and sends them to owner's email.
-
read
—
Lists all the incoming payments
-
findById
—
Shows info on a specific incoming payment
-
-
create
—
Posts a message into an existing thread.
-
-
-
follow
—
Follow updates in the thread associated with a given post.
-
unfollow
—
Stop following updates in the thread associated with a given post.
-
getParticipants
—
List all the participants in the thread. May be used for mentioning.
-
-
-
-
-
read
—
Returns a list of quiz-tasks associated with a reader within your courses
-
reset
—
Resets a Quiz for a User
-
export
—
Exports all user's Quizzes
-
-
filterUsers
—
Filters users. It's recommended not to use this function as it is experimental and may be removed.
-
filterCircles
—
Filters circles. It's recommended not to use this function as it is experimental and may be removed.
-
filterCourses
—
Filters courses. It's recommended not to use this function as it is experimental and may be removed.
-
auto
—
Find user, circle or course by its associated name.
-
content
—
Searches for a particular text content and returns it position.
-
-
-
update
—
Updates the section object
-
-
-
-
-
-
read
—
Returns all your settings
-
update
—
Updates your settings you specify
-
-
-
sales
—
Generates sales statistics
-
-
-
progress
—
Generates user-course progress statistics
-
interaction
—
Generates interaction statistics for one or more courses
-
exportSales
—
Provides an overview of user progress per course
-
-
-
-
-
-
read
—
Shows a store from your perspective
-
findById
—
Shows a store item from your perspective
-
findBySlug
—
Shows a store item from your perspective
-
saveLayout
—
Saves store layout for future rendering
-
-
-
-
addToUser
—
Obsolete soon, use addLink() Adds a tag to a user
-
removeFromUser
—
Obsolete soon, use removeLink() Removes a tag from a user
-
-
create
—
Simple Task creator, no input for now, takes defaults
-
-
answer
—
Captures a Task answer from user
-
-
-
findByUserId
—
Returns a list of tasks associated with a reader within your courses
-
read
—
Returns a list of tasks associated with a reader within your courses
-
-
update
—
Updates a task result
-
assess
—
Assesses someone's task result
-
removeUploaded
—
Unlinks any uploaded files from a specific Task Result
-
-
read
—
Lists all your triggers
-
findById
—
Shows all the info on a specified trigger
-
-
-
-
-
-
issueCdk
—
Issues CDKs for specified Users.
-
-
-
-
-
-
findById
—
Finds a user by ID. Only your readers are available.
-
-
-
-
findByEmail
—
Finds a user by his email. User must be one of your readers.
-
expel
—
Removes the user from all your courses and circles.
-
findReaders
—
Returns all your readers. Usage of 'showCourses' or 'showCircles' will switch on pagination.
-
export
—
Exports your users and emails a file with statistics.
-
update
—
Change user properties.
-
-
-
importFromList
—
Uses a list of emails to create users and connect them to your material
-
listPwned
—
Lists all the user accounts you own
-
-
-
-
-
-
init
—
Creates a webinar room