{"docs":{"name":"OpenStax Exercises API","info":"\n<p>Access to the API must be achieved through an OAuth flow or by having a user that is logged in to the system (with a session, etc).</p>\n\n<p>When communicating with the API, developers must set a header in the HTTP request to specify which version of the API they want to use:</p>\n<table class='std-list-1' style='width: 80%; margin: 15px auto'>\n  <tr>\n    <th>Header Name</th>\n    <th>Value</th>\n    <th>Version Accessed</th>\n  </tr>\n  <tr>\n    <td><code>'Accept'</code></td>\n    <td><code>'application/vnd.exercises.openstax.v1'</code></td>\n    <td>v1</td>\n  </tr>\n</table>\n<p>Many of the API specifications provide a related JSON schema. These schemas are based on the standard defined at <a href=\"http://json-schema.org/\">http://json-schema.org/</a>. A lot of these schemas aren’t overly specific to the actions they are listed under, e.g. they always say that an <code>id</code> is required but that isn’t the case when new data is being posted to a <code>create</code> call.</p>\n","copyright":"Copyright &copy; 2011-2026 Rice University","doc_url":"/api/docs/v1","api_url":"/api","resources":[{"doc_url":"/api/docs/v1/vocab_terms","id":"vocab_terms","api_url":"/api","name":"Vocab_terms","short_description":"A vocabulary term, its definition and distractors","full_description":"\n<p>Vocabulary terms represent a word or phrase, its definition and related distractor terms or definitions.</p>\n","version":"v1","formats":null,"metadata":null,"methods":[{"doc_url":"/api/docs/v1/vocab_terms/index","name":"index","apis":[{"api_url":"/api/vocab_terms","http_method":"GET","short_description":"Return a set of VocabTerms matching query terms","deprecated":null},{"api_url":"/api/vocab_terms/search","http_method":"GET","short_description":"Return a set of VocabTerms matching query terms","deprecated":null},{"api_url":"/api/vocab_terms/search","http_method":"POST","short_description":"Return a set of VocabTerms matching query terms","deprecated":null}],"formats":null,"full_description":"\n<p>Accepts a query string along with options and returns a JSON representation of the matching VocabTerms. Only VocabTerms visible to the caller will be returned. The schema for the returned JSON result is shown below.</p>\n\n<h2 id=\"afb9fa1e\" class=\"schema\">Schema</h2>\n<pre class='code'>\n{\n  \"type\": \"object\",\n  \"required\": [\n    \"total_count\",\n    \"items\"\n  ],\n  \"properties\": {\n    \"total_count\": {\n      \"type\": \"integer\",\n      \"description\": \"The number of items matching the query; can be more than the number returned if paginating\"\n    },\n    \"items\": {\n      \"type\": \"array\",\n      \"description\": \"The items matching the query or a subset thereof when paginating\",\n      \"items\": {}\n    }\n  },\n  \"additionalProperties\": false\n}\n</pre>","errors":[],"params":[{"name":"q","full_name":"q","description":"\n<p>The search query string, built up as a space-separated collection of search conditions on different fields. Each condition is formatted as “field_name:comma-separated-values”. The resulting list of vocab_terms will match all of the conditions (boolean ‘and’). Each condition will produce a list of vocab terms where those vocab terms must match any of the comma-separated-values (boolean ‘or’). The fields_names and their characteristics are given below. When a field is listed as using wildcard matching, it means that any fields that start with a comma-separated-value will be matched.</p>\n\n<ul>\n<li><code>name</code> – Matches the vocab term itself. (uses wildcard matching)</li>\n\n<li><code>definition</code> – Matches the vocab term definition. (uses wildcard matching)</li>\n\n<li><code>content</code> – Matches the vocab term or its definition. (uses wildcard matching)</li>\n\n<li><code>author</code> – Matches authors’ and copyright holders’ first, last, or full names. (uses wildcard matching)</li>\n\n<li><code>number</code> – Matches the vocab term number exactly.</li>\n\n<li><code>version</code> – Matches the vocab term version exactly.</li>\n\n<li><code>id</code> – Matches the vocab term ID or UID exactly.</li>\n</ul>\n\n<p>You can also add search terms without prefixes, separated by spaces. These terms will be searched for in all of the prefix categories. Any matching vocab terms will be returned. When combined with prefixed search terms, the final results will contain vocab terms matching any of the non prefixed terms and all of the prefixed terms.</p>\n\n<p>Examples:</p>\n\n<p><code>content:DTFT</code> – returns vocab terms containing the DTFT word.</p>\n\n<p><code>number:1 version:2</code> – returns vocab term 1@2.</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be a String","expected_type":"string","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"order_by","full_name":"order_by","description":"\n<p>A string that indicates how to sort the results of the query. The string is a comma-separated list of fields with an optional sort direction. The sort will be performed in the order the fields are given. The fields can be one of <code>number</code>, <code>uuid</code>, <code>version</code>, <code>name</code>, <code>definition</code>, <code>created_at</code>, <code>updated_at</code>, <code>published_at</code>. Sort directions can either be <code>ASC</code> for an ascending sort, or <code>DESC</code> for a descending sort. If not provided, an ascending sort is assumed. Sort directions should be separated from the fields by a space. (default: <code>number ASC</code>)</p>\n\n<p>Example:</p>\n\n<p><code>number, version DESC</code> – sorts by number ascending, then by version descending</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be a String","expected_type":"string","metadata":null,"show":true,"validations":[],"deprecated":false}],"returns":[],"examples":["https://exercises.openstax.org/api/vocab_terms/?q=name:\"term\" definition:\"def\""],"metadata":null,"see":[],"headers":[],"show":true},{"doc_url":"/api/docs/v1/vocab_terms/create","name":"create","apis":[{"api_url":"/api/vocab_terms","http_method":"POST","short_description":"Creates a VocabTerm","deprecated":null}],"formats":null,"full_description":"\n<p>Creates a VocabTerm with the given attributes.</p>\n\n<h2 id=\"fd38b7d5\" class=\"schema\">Schema</h2>\n<pre class='code'>\n{\n  \"type\": \"object\",\n  \"required\": [\n    \"term\",\n    \"definition\",\n    \"distractor_terms\",\n    \"distractor_literals\",\n    \"exercise_uuids\",\n    \"exercise_uids\"\n  ],\n  \"properties\": {\n    \"tags\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    },\n    \"nickname\": {\n      \"type\": \"string\"\n    },\n    \"license\": {},\n    \"solutions_are_public\": {\n      \"type\": \"string\"\n    },\n    \"derived_from\": {\n      \"type\": \"array\",\n      \"items\": {}\n    },\n    \"term\": {\n      \"type\": \"string\"\n    },\n    \"definition\": {\n      \"type\": \"string\"\n    },\n    \"distractor_terms\": {\n      \"type\": \"array\",\n      \"items\": {}\n    },\n    \"distractor_literals\": {\n      \"type\": \"array\"\n    },\n    \"exercise_uuids\": {\n      \"type\": \"array\"\n    },\n    \"exercise_uids\": {\n      \"type\": \"array\"\n    }\n  },\n  \"additionalProperties\": false\n}\n</pre>","errors":[],"params":[],"returns":[],"examples":[],"metadata":null,"see":[],"headers":[],"show":true},{"doc_url":"/api/docs/v1/vocab_terms/show","name":"show","apis":[{"api_url":"/api/vocab_terms/:uid","http_method":"GET","short_description":"Gets the specified VocabTerm","deprecated":null}],"formats":null,"full_description":"\n<p>Gets the VocabTerm that matches the provided UID.</p>\n\n<h2 id=\"4c50e9d2\" class=\"schema\">Schema</h2>\n<pre class='code'>\n{\n  \"type\": \"object\",\n  \"required\": [\n    \"term\",\n    \"definition\",\n    \"distractor_terms\",\n    \"distractor_literals\",\n    \"exercise_uuids\",\n    \"exercise_uids\"\n  ],\n  \"properties\": {\n    \"tags\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    },\n    \"uuid\": {\n      \"type\": \"string\"\n    },\n    \"group_uuid\": {\n      \"type\": \"string\"\n    },\n    \"number\": {\n      \"type\": \"integer\"\n    },\n    \"version\": {\n      \"type\": \"integer\"\n    },\n    \"uid\": {\n      \"type\": \"string\"\n    },\n    \"published_at\": {\n      \"type\": \"string\"\n    },\n    \"nickname\": {\n      \"type\": \"string\"\n    },\n    \"license\": {},\n    \"solutions_are_public\": {\n      \"type\": \"string\"\n    },\n    \"authors\": {\n      \"type\": \"array\",\n      \"items\": {}\n    },\n    \"copyright_holders\": {\n      \"type\": \"array\",\n      \"items\": {}\n    },\n    \"delegations\": {\n      \"type\": \"array\",\n      \"items\": {}\n    },\n    \"derived_from\": {\n      \"type\": \"array\",\n      \"items\": {}\n    },\n    \"term\": {\n      \"type\": \"string\"\n    },\n    \"definition\": {\n      \"type\": \"string\"\n    },\n    \"distractor_terms\": {\n      \"type\": \"array\",\n      \"items\": {}\n    },\n    \"distractor_literals\": {\n      \"type\": \"array\"\n    },\n    \"exercise_uuids\": {\n      \"type\": \"array\"\n    },\n    \"exercise_uids\": {\n      \"type\": \"array\"\n    }\n  },\n  \"additionalProperties\": false\n}\n</pre>","errors":[],"params":[],"returns":[],"examples":[],"metadata":null,"see":[],"headers":[],"show":true},{"doc_url":"/api/docs/v1/vocab_terms/update","name":"update","apis":[{"api_url":"/api/vocab_terms/:uid","http_method":"PUT","short_description":"Updates the specified VocabTerm","deprecated":null}],"formats":null,"full_description":"\n<p>Updates the VocabTerm that matches the provided UID with the given attributes.</p>\n\n<h2 id=\"2c01e2b8\" class=\"schema\">Schema</h2>\n<pre class='code'>\n{\n  \"type\": \"object\",\n  \"required\": [\n    \"term\",\n    \"definition\",\n    \"distractor_terms\",\n    \"distractor_literals\",\n    \"exercise_uuids\",\n    \"exercise_uids\"\n  ],\n  \"properties\": {\n    \"tags\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    },\n    \"nickname\": {\n      \"type\": \"string\"\n    },\n    \"license\": {},\n    \"solutions_are_public\": {\n      \"type\": \"string\"\n    },\n    \"derived_from\": {\n      \"type\": \"array\",\n      \"items\": {}\n    },\n    \"term\": {\n      \"type\": \"string\"\n    },\n    \"definition\": {\n      \"type\": \"string\"\n    },\n    \"distractor_terms\": {\n      \"type\": \"array\",\n      \"items\": {}\n    },\n    \"distractor_literals\": {\n      \"type\": \"array\"\n    },\n    \"exercise_uuids\": {\n      \"type\": \"array\"\n    },\n    \"exercise_uids\": {\n      \"type\": \"array\"\n    }\n  },\n  \"additionalProperties\": false\n}\n</pre>","errors":[],"params":[],"returns":[],"examples":[],"metadata":null,"see":[],"headers":[],"show":true},{"doc_url":"/api/docs/v1/vocab_terms/destroy","name":"destroy","apis":[{"api_url":"/api/vocab_terms/:uid","http_method":"DELETE","short_description":"Deletes the specified VocabTerm","deprecated":null}],"formats":null,"full_description":"\n<p>Deletes the VocabTerm that matches the provided UID.</p>\n","errors":[],"params":[],"returns":[],"examples":[],"metadata":null,"see":[],"headers":[],"show":true}],"headers":[],"deprecated":false}]}}