-
Notifications
You must be signed in to change notification settings - Fork 15
API Endpoints
OpenStax CMS makes use of API Endpoints to allow other OpenStax services to communicate with our content management service. Most of these endpoints are used by our front-end, but all OpenStax services can make use of the following API endpoints.
Wagtails main API. This endpoint serves Wagtails elements like pages, images, and documents.
Returns lists of all pages with their url for details and slug.
Returns details for the given page.
Returns list of available roles for a user.
Returns the text for the sticky note.
Returns the text for the footer.
Returns details for a piece of Errata
Returns a list of books, with their slug and some information needed to render the subjects page.
Sends mail through Amazon SES. We prevent spamming by only having a limited set of subjects that it will accept and go to a particular email address.
Returns all documents with their Cloudfront url.
Returns all images with their Cloudfront url.
Allows writing user progress through the instructor process. This takes an account_id
and progress
(integer representation of the users progress, 1-5). Can be queried using ?account_id=<id>
to retrieve progress.
Returns a list of adoption schools from Salesforce. Results can be filtered on this API by the following fields:
-
name
[string] -
id
[int] -
type
[string] -
physical_country
[string] -
physical_state_province
[string] -
physical_city
[string] -
key_institutional_partner
[bool] -
achieving_the_dream_school
[bool] -
saved_one_million
[bool] -
testimonial
[bool]
Returns the list of all available feature flags.
Returns the conditions for the given flag.
Returns data for donation popup. Includes flag to hide the popup
Creates thank you note entry. Example payload (user information can be blank): {"thank_you_note":"OpenStax is the best! Loved not paying for a book","first_name": "Jessica","last_name": "Drew", "institution": "Rice University", "created": "2021-10-21", "consent_to_share_or_contact": "True","contact_email_address": "[email protected]"}
Returns data for fundraiser. Sample Json
[
{
"color_scheme":"red",
"message_type":"message",
"headline":"Pay it <span class=\"color\">forward.</span>",
"message":"Messaging that talks about how OpenStax free resources help students graduate, and how OpenStax relies on charitable contributions.",
"button_text":"Give today",
"button_url":"/give",
"box_headline":"Lorem ipsum dolor sit amet lorem ipsum dolor lorem sit amet.",
"box_html":"Even donations of just <b>$1, $5, or $10</b> can lorem ipsum dolor sit amet.",
"fundraiser_image":"http://localhost:8000/media/sample-blue-200x200.jpg",
"goal_amount":1234,
"goal_time":"2022-01-12T09:07:01-06:00"
}
]
Returns list of all partners
Returns Give Banner Json
Returns Give Today Json
Returns list of Webinars
Returns list of Webinars filtered by Subject
Returns list of snippets by name
Returns form headings for adoption and interest forms
The following are convenience endpoints. They all make use of Wagtail API v2 endpoints at /apps/cms/api/v2/pages/[id]
with parameters.
Returns a list of books, with their slug and some information needed to render the subjects page. Redirects to /api/v2/pages/?slug=subjects
Returns details about a book. Redirects to /api/v2/pages/?slug=<book-slug>
Returns the content of the news pages and a list of articles. Redirects to /api/v2/pages/?slug=openstax-news
Returns the content of a news article. Redirects to /api/v2/pages/?slug=<news-article-slug>
.
Returns a page based on slug. Redirects to /api/v2/pages/?slug=<slug>