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.
Raw command
GET
POST
PUT
PATCH
DELETE
Run code
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
/api/access
circle
—
Checks user's access to a circle. User must be one of your readers or you.
course
—
Checks user's access to a course. User must be one of your readers or you. Pass 'expires' to set expiration date.
/api/auth
incarnate
—
Admin method to incarnate as another user by User ID
loginCdk
—
Login using Coursio Disposable Key
loginHmac
—
Logs you in via HMAC authentication. Use either HTTP headers or method variables.
restorePassword
—
Allows you to set a new password using a password restoration code
status
—
Returns current status
/api/business-invite
accept
—
Accepts a business invite
delete
—
Deletes a business invite completely
list
—
Lists all existing business invites, use pagination
loadTerms
—
Loads the most recent terms and user info
send
—
Sends an emails with an invitation
/api/category
read
—
Returns a list of available course categories
/api/circle
addToCourse
—
Adds a circle to a course. Gives course access rights to all the circle users.
getExpiry
—
Retrieves the circle expiry interval.
removeFromCourse
—
Removes a circle from a course. Removes course access rights for all the circle users.
/api/content
reportTypo
—
Reports an error in module content to its owner
/api/course
create
—
Creates an empty course (with 1 section and 1 page)
delete
—
Performs a course soft-deletion
fetchDiploma
—
OBSOLETE. Please use diploma/download or diploma/mail instead
getToc
—
Retrieves the table of contents
joinForFree
—
Join a course now and for free if it's allowed by store rules
update
—
Updates the course object
/api/course-package
create
—
Creates a course package
delete
—
Deletes a course package
findById
—
Shows all the info on a specified course package
joinForFree
—
Join a course package now and for free if it's allowed by store rules
read
—
Lists all your course packages
update
—
Updates a course package
/api/coursio-ui
/api/dashboard
read
—
Lists all the courses that you can read
/api/diploma
download
—
Current user gets a diploma downloaded, served as base64
list
—
Get the available diplomas
mail
—
Current user gets a diploma mailed to his inbox
/api/discount
findById
—
Shows all the info on a specified discount
read
—
Lists all your discounts
save
—
Edit / Save a discount
/api/file
checkAndReUse
—
Check if the file exists and reuse it on the specified Course ID
delete
—
Soft deletes a file, purges after 14 days.
getJobId
—
Retrieves the job ID for the file (DEPRECATED).
getVideoStatusByHash
—
Get video upload job status by the supplied Hash, Status 1 = Encoding, 2 = Prevew clip, 3 = Upload done
getVideoStatusById
—
Get video upload job status by the supplied file ID, Status 1 = Encoding, 2 = Prevew clip, 3 = Upload done
import
—
Imports a file by its URL. Function is synchronous!
move
—
Moves file(s) to a new directory.
find
—
Finds a file considering filters. This function requires pagination.
/api/guest
disableSecure
—
Disables secure mode for a user (only for development)
emailBasedCall
—
Call a method in a sandbox with a session established for a user with a given email account
getGuestInfo
—
Get basic user information for a guest created user
/api/invitation
create
—
Creates an invitation link
delete
—
Deletes an invitation
findByCircleId
—
Finds invitation links associated with a certain circle
findByCourseId
—
Finds invitation links associated with a certain course
resend
—
Resends one of your invitations
showInfo
—
Shows various useful info on an invitation and objects related to it
/api/invite
byEmails
—
Invites users to courses and/or a circle.
bySms
—
Invites users to courses and/or a circle by SMS.
/api/note
pageModule
—
Adds/updates/removes note from a Page Module
/api/notifications
count
—
Counts unread notifications
read
—
Lists notifications. Newest first.
selfNotify
—
Send a custom notification to yourself.
/api/page
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.
merge
—
Merges pages. First page goes first.
moveToSection
—
Safely moves page to another section. To move a page within a section use section/reorderPages().
update
—
Updates the page object
/api/page-module
create
—
Creates a page module
delete
—
Deletes a page module
findById
—
Returns a page module structure
moveToNewPageRow
—
Creates a new page row on the same page and moves a page module to that page row.
note
—
WILL BE DEPRECATED! Use note/pageModule() instead
update
—
Updates a page module
/api/page-row
/api/payment
getProviders
—
Returns the list of available payment providers
start
—
Starts the payments process
/api/payment/incoming
export
—
Exports payments and sends them to owner's email.
findById
—
Shows info on a specific incoming payment
read
—
Lists all the incoming payments
refund
—
Refunds an incoming payment
/api/post
create
—
Posts a message into an existing thread.
follow
—
Follow updates in the thread associated with a given post.
getParticipants
—
List all the participants in the thread. May be used for mentioning.
unfollow
—
Stop following updates in the thread associated with a given post.
/api/quiz
export
—
Exports all user's Quizzes
read
—
Returns a list of quiz-tasks associated with a reader within your courses
reset
—
Resets a Quiz for a User
save
—
Save or edit a Quiz
/api/search
auto
—
Find user, circle or course by its associated name.
content
—
Searches for a particular text content and returns it position.
/api/section
update
—
Updates the section object
/api/self-service
charges
—
Exports payments history and returns it as an array.
/api/settings
read
—
Returns all your settings
update
—
Updates your settings you specify
/api/statistics
interaction
—
Generates interaction statistics for one or more courses
progress
—
Generates user-course progress statistics
sales
—
Generates sales statistics
user
—
Provides an overview of user progress per course
/api/store
findAllUsers
—
Find all users below your rank, so builder can just see users but owners can also see teachers
findById
—
Shows a store item from your perspective
findBySlug
—
Shows a store item from your perspective
read
—
Shows a store from your perspective
saveLayout
—
Saves store layout for future rendering
sellable
—
Show a list of sellable courses
/api/tag
addToUser
—
Obsolete soon, use addLink() Adds a tag to a user
removeFromUser
—
Obsolete soon, use removeLink() Removes a tag from a user
/api/task
answer
—
Captures a Task answer from user
create
—
Simple Task creator, no input for now, takes defaults
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
/api/task-result
assess
—
Assesses someone's task result
removeUploaded
—
Unlinks any uploaded files from a specific Task Result
update
—
Updates a task result
/api/trigger
findById
—
Shows all the info on a specified trigger
read
—
Lists all your triggers
/api/user
expel
—
Removes the user from all your courses and circles.
export
—
Exports your users and emails a file with statistics.
findByEmail
—
Finds a user by his email. User must be one of your readers.
findById
—
Finds a user by ID. Only your readers are available.
findReaders
—
Returns all your readers. Usage of 'showCourses' or 'showCircles' will switch on pagination.
freeze
—
Freezes a user profile.
importFromList
—
Uses a list of emails to create users and connect them to your material
issueCdk
—
Issues CDKs for specified Users.
listPwned
—
Lists all the user accounts you own
thaw
—
Thaws a frozen user profile.
update
—
Change user properties.
updateOwnedEmail
—
Allows the changing of an e-mail if you have access to the e-mail changing of your students. Returns errorId 0 on success.
/api/webhook
/api/vendor/mandrill
/api/vendor/xroom
init
—
Creates a webinar room