{"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/users","id":"users","api_url":"/api","name":"Users","short_description":"A human user of OpenStax Exercises.","full_description":"\n<p>Users have the following String attributes: username first_name last_name full_name title</p>\n","version":"v1","formats":null,"metadata":null,"methods":[{"doc_url":"/api/docs/v1/users/index","name":"index","apis":[{"api_url":"/api/users","http_method":"GET","short_description":"Return a set of Users 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 Users. Some User data may be filtered out depending on the caller’s status and privileges in the system. The schema for the returned JSON result is shown below.</p>\n\n<h2 id=\"bf921a2e\" 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 accounts matching the query; can be more than the number returned\"\n    },\n    \"items\": {\n      \"type\": \"array\",\n      \"description\": \"The accounts 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 users will match all of the conditions (boolean ‘and’). Each condition will produce a list of users where those users 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>username</code> – Matches usernames, case insensitive. (uses wildcard matching)</li>\n\n<li><code>first_name</code> – Matches users’ first names, case insensitive. (uses wildcard matching)</li>\n\n<li><code>last_name</code> – Matches users’ last names, case insensitive. (uses wildcard matching)</li>\n\n<li><code>name</code> – Matches users’ first, last, or full names, case insenstive. (uses wildcard matching)</li>\n\n<li><code>id</code> – Matches users’ IDs exactly.</li>\n\n<li><code>email</code> – Matches users’ emails 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 users will be returned. When combined with prefixed search terms, the final results will contain users matching any of the non prefixed terms and all of the prefixed terms.</p>\n\n<p>Examples:</p>\n\n<p><code>username:ric</code> – returns ‘richb’ and ‘ricardo’ users.</p>\n\n<p><code>username:ric name:&quot;Van Buren&quot;</code> – returns the ‘Ricardo Van Buren’ user.</p>\n\n<p><code>ric</code> – returns ‘richb’, ‘ricardo’, and ‘Jimmy Rich’ users.</p>\n","required":true,"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>username</code>, <code>first_name</code>, <code>last_name</code>, <code>full_name</code>, <code>id</code>, <code>created_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>username ASC</code>)</p>\n\n<p>Example:</p>\n\n<p><code>last_name, username DESC</code> – sorts by last name ascending, then by username 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://users.openstax.org/api/users/?q=username:bob%20name=Jones"],"metadata":null,"see":[],"headers":[],"show":true},{"doc_url":"/api/docs/v1/users/show","name":"show","apis":[{"api_url":"/api/user","http_method":"GET","short_description":"Gets the current user's profile","deprecated":null}],"formats":null,"full_description":"\n<p>Gets the current user’s profile.</p>\n\n<h2 id=\"03412a65\" class=\"schema\">Schema</h2>\n<pre class='code'>\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"id\": {\n      \"type\": \"integer\"\n    },\n    \"username\": {\n      \"type\": \"string\"\n    },\n    \"first_name\": {\n      \"type\": \"string\"\n    },\n    \"last_name\": {\n      \"type\": \"string\"\n    },\n    \"full_name\": {\n      \"type\": \"string\"\n    },\n    \"title\": {\n      \"type\": \"string\"\n    },\n    \"faculty_status\": {\n      \"type\": \"string\"\n    },\n    \"self_reported_role\": {\n      \"type\": \"string\"\n    },\n    \"uuid\": {\n      \"type\": \"string\"\n    },\n    \"support_identifier\": {\n      \"type\": \"string\"\n    }\n  },\n  \"additionalProperties\": false\n}\n</pre>","errors":[],"params":[],"returns":[],"examples":[],"metadata":null,"see":[],"headers":[],"show":true},{"doc_url":"/api/docs/v1/users/update","name":"update","apis":[{"api_url":"/api/user","http_method":"PATCH","short_description":"Updates the current user's profile","deprecated":null}],"formats":null,"full_description":"\n<p>Updates the current user’s profile.</p>\n\n<h2 id=\"15e7c813\" class=\"schema\">Schema</h2>\n<pre class='code'>\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"first_name\": {\n      \"type\": \"string\"\n    },\n    \"last_name\": {\n      \"type\": \"string\"\n    },\n    \"full_name\": {\n      \"type\": \"string\"\n    },\n    \"title\": {\n      \"type\": \"string\"\n    }\n  },\n  \"additionalProperties\": false\n}\n</pre>","errors":[],"params":[],"returns":[],"examples":[],"metadata":null,"see":[],"headers":[],"show":true},{"doc_url":"/api/docs/v1/users/destroy","name":"destroy","apis":[{"api_url":"/api/user","http_method":"DELETE","short_description":"Disables the current user's account","deprecated":null}],"formats":null,"full_description":"\n<p>Disables the current user’s account.</p>\n","errors":[],"params":[],"returns":[],"examples":[],"metadata":null,"see":[],"headers":[],"show":true}],"headers":[],"deprecated":false}]}}