{"_id":"5436b176b7cf0e1c0020dabb","sync_unique":"","title":"Getting Started","updates":[],"category":"5436b175b7cf0e1c0020dab9","createdAt":"2014-10-09T16:01:58.002Z","isReference":false,"link_url":"","slug":"getting-started","__v":18,"githubsync":"","type":"basic","user":"5436b11ed0ffee0e00f19049","version":"5436b175b7cf0e1c0020dab8","api":{"auth":"never","basic_auth":false,"params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"code":"{}","name":"","status":400,"language":"json"}]},"settings":"","try":true,"url":""},"body":"In order to access the BetterLesson API endpoints, clients will need to get an authorization code. This code should be then used to retrieve an access token and a refresh token. Client will be able to use the access token to access all endpoints until the token expires, at which point, clients will need to use the refresh token to get a new access token to continue to have access to the API endpoints. All these steps are explained in detail below.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Retrieving the Authorization Code\"\n}\n[/block]\nThe URL used when authenticating a user is https://api.betterlesson.com/oauth2/auth. This endpoint is accessible over SSL. Non-secure HTTP connections are refused.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"https://api.betterlesson.com/oauth2/auth\",\n    \"0-1\": \"This endpoint is the target of the initial request. It will return an authorization code for the client_id provided, and it can also authenticate users and get their consent. The result of requests to this endpoint will be authorization codes.\",\n    \"h-1\": \"Description\",\n    \"h-0\": \"Endpoint\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\nThe set of query string parameters supported are:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameters\",\n    \"h-1\": \"Values\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"client_id\",\n    \"0-1\": \"The client ID you obtain from BetterLesson.\",\n    \"0-2\": \"Identifies the client that is making the request.\",\n    \"1-0\": \"access_type\",\n    \"1-1\": \"public (default) or\\nprivate\",\n    \"1-2\": \"Determine if the client can access the grantor’s private data.\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]\nAn example URL is shown below:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"https://api.betterlesson.com/oauth2/auth?client_id=dio32fiocg09j4g\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\nIf the access_type requested is public, the authorization code or any error messages will be in the response to the /oauth2/auth endpoint request. \n\nAn example response for a 'public' access_type:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n   \\\"code\\\":\\\"1/sdiojvaerjq3jf34verveoioijnw\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nIf, however, the access_type requested is private, the authorization request or any error messages will be sent to the redirect_uri set when your client credentials were created. You may change this uri by contacting BetterLesson support. All responses are returned to the web server on the query string, as shown below:\n\nAn example response for a 'private' access_type:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"https://demo.app.com/code?code=1%2Favoi49joqierjv9q0483uf\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\nAuthorization codes expire in 10 minutes. Make sure to retrieve your access token before the expiration.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Retrieving an Access Token\"\n}\n[/block]\nAfter the client receives the authorization code, it may exchange the authorization code for an access token and a refresh token. This request is an HTTPS POST, and includes the following parameters:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"code\",\n    \"0-1\": \"The authorization code returned from the initial request.\",\n    \"1-0\": \"client_id\",\n    \"1-1\": \"The client ID obtained from BetterLesson.\",\n    \"2-0\": \"client_secret\",\n    \"2-1\": \"The client secret obtained from BetterLesson.\",\n    \"3-0\": \"grant_type\",\n    \"3-1\": \"As defined in the OAuth 2.0 specification, this field must contain a value of ‘authorization_code’.\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]\nThe actual request might look like the following:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /oauth2/token HTTP/1.1\\nHost: api.betterlesson.com\\nContent-Type: application/x-www-form-urlencoded\\n \\ncode=1%2Favoi49joqierjv9q0483uf&client_id=do32fiocg09j4g&client_secret{client_secret}&grant_type=authorization_code\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\nA successful response to this request contains the following fields:\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"access_token\",\n    \"0-1\": \"The token that can be sent to a BetterLesson API endpoint.\",\n    \"1-0\": \"refresh_token\",\n    \"1-1\": \"A token that may be used to obtain a new access token. Refresh tokens are always valid for public access, and for private access they are valid until the user revokes access.\",\n    \"2-0\": \"expires\",\n    \"2-1\": \"UTC timestamp of when the access_token will expire.\",\n    \"h-0\": \"Field\",\n    \"h-1\": \"Description\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]\nA successful response is returned as a JSON array, similar to the following:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n   \\\"access_token\\\":\\\"1/fFAGRNJru1FTz70BzhT3Zg\\\",\\n   \\\"refresh_token\\\":\\\"1/ijoiwejqpeorjv209u3jp32EWCe9\\\",\\n   \\\"expires\\\": <datetime>\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nAccess tokens expire one week after being issued. Make sure to use the refresh token to retrieve a new token upon expiration.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Calling a BetterLesson API Endpoint\"\n}\n[/block]\nAfter your application obtains an access token, you can use the token to make calls to a BetterLesson API endpoint. To do this, include the access token in a request to the API by including either an access_token query parameter or an Authorization: Bearer HTTP header. When possible, the HTTP header is preferable, because query strings tend to be visible in server logs.\n\n\n**Examples** \n\nA call to the search endpoint using the access_token query string parameter might look like the following, though you'll need to specify your own access token:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET https://api.betterlesson.com/search?keyword=algebra&access_token=1%2FfFBGRNJru1FQd44AzqT3Zg\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\nHere is a call to the same API using the access_token ‘Authorization: Bearer’ HTTP header:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET /search?keyword=algebra HTTP/1.1\\nAuthorization: Bearer 1/fFBGRNJru1FQd44AzqT3Zg\\nHost: api.betterlesson.com\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Using a Refresh Token\"\n}\n[/block]\nYour application may obtain a new access token by sending a refresh token to the BetterLesson Authorization server.\n\nTo obtain a new access token this way, your application sends an HTTPS POST request to https://api.betterlesson.com/oauth2/token. The request must include the following parameters:\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"refresh_token\",\n    \"0-1\": \"The refresh token returned from the authorization code exchange.\",\n    \"1-0\": \"client_id\",\n    \"1-1\": \"The client ID obtained from BetterLesson.\",\n    \"2-0\": \"client_secret\",\n    \"2-1\": \"The client secret obtained from BetterLesson.\",\n    \"3-0\": \"grant_type\",\n    \"3-1\": \"As defined in the OAuth 2.0 specification, this field must contain a value of ‘refresh_token’.\",\n    \"h-0\": \"Field\",\n    \"h-1\": \"Description\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]\nSuch a request will look similar to the following:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /oauth2/token HTTP/1.1\\nHost: api.betterlesson.com\\nContent-Type: application/x-www-form-urlencoded\\n\\nclient_id=do32fiocg09j4g&client_secret={client_secret}&refresh_token=1%2Fijoiwejqpeorjv209u3jp32EWCe9&grant_type=refresh_token\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\nAs long as the access granted to your application has not been revoked by BetterLesson or by the user, the response includes a new access token. A response from such a request is shown below:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n   \\\"access_token\\\":\\\"1/fFAGRNJru1FTz70BzhT3Zg\\\",\\n   \\\"refresh_token\\\":\\\"1/ijoiwejqpeorjv209u3jp32EWCe9\\\",\\n   \\\"expires\\\": <datetime>\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nYou should save refresh tokens in long-term storage and continue to use them as long as they remain valid.","hidden":false,"link_external":false,"project":"5436b175b7cf0e1c0020dab5","excerpt":"This page will help you get started with the BetterLesson API.","is_link":false,"order":999,"childrenPages":[]}

Getting Started

This page will help you get started with the BetterLesson API.

In order to access the BetterLesson API endpoints, clients will need to get an authorization code. This code should be then used to retrieve an access token and a refresh token. Client will be able to use the access token to access all endpoints until the token expires, at which point, clients will need to use the refresh token to get a new access token to continue to have access to the API endpoints. All these steps are explained in detail below. [block:api-header] { "type": "basic", "title": "Retrieving the Authorization Code" } [/block] The URL used when authenticating a user is https://api.betterlesson.com/oauth2/auth. This endpoint is accessible over SSL. Non-secure HTTP connections are refused. [block:parameters] { "data": { "0-0": "https://api.betterlesson.com/oauth2/auth", "0-1": "This endpoint is the target of the initial request. It will return an authorization code for the client_id provided, and it can also authenticate users and get their consent. The result of requests to this endpoint will be authorization codes.", "h-1": "Description", "h-0": "Endpoint" }, "cols": 2, "rows": 1 } [/block] The set of query string parameters supported are: [block:parameters] { "data": { "h-0": "Parameters", "h-1": "Values", "h-2": "Description", "0-0": "client_id", "0-1": "The client ID you obtain from BetterLesson.", "0-2": "Identifies the client that is making the request.", "1-0": "access_type", "1-1": "public (default) or\nprivate", "1-2": "Determine if the client can access the grantor’s private data." }, "cols": 3, "rows": 2 } [/block] An example URL is shown below: [block:code] { "codes": [ { "code": "https://api.betterlesson.com/oauth2/auth?client_id=dio32fiocg09j4g", "language": "http" } ] } [/block] If the access_type requested is public, the authorization code or any error messages will be in the response to the /oauth2/auth endpoint request. An example response for a 'public' access_type: [block:code] { "codes": [ { "code": "{\n \"code\":\"1/sdiojvaerjq3jf34verveoioijnw\"\n}", "language": "json" } ] } [/block] If, however, the access_type requested is private, the authorization request or any error messages will be sent to the redirect_uri set when your client credentials were created. You may change this uri by contacting BetterLesson support. All responses are returned to the web server on the query string, as shown below: An example response for a 'private' access_type: [block:code] { "codes": [ { "code": "https://demo.app.com/code?code=1%2Favoi49joqierjv9q0483uf", "language": "http" } ] } [/block] Authorization codes expire in 10 minutes. Make sure to retrieve your access token before the expiration. [block:api-header] { "type": "basic", "title": "Retrieving an Access Token" } [/block] After the client receives the authorization code, it may exchange the authorization code for an access token and a refresh token. This request is an HTTPS POST, and includes the following parameters: [block:parameters] { "data": { "h-0": "Field", "h-1": "Description", "0-0": "code", "0-1": "The authorization code returned from the initial request.", "1-0": "client_id", "1-1": "The client ID obtained from BetterLesson.", "2-0": "client_secret", "2-1": "The client secret obtained from BetterLesson.", "3-0": "grant_type", "3-1": "As defined in the OAuth 2.0 specification, this field must contain a value of ‘authorization_code’." }, "cols": 2, "rows": 4 } [/block] The actual request might look like the following: [block:code] { "codes": [ { "code": "POST /oauth2/token HTTP/1.1\nHost: api.betterlesson.com\nContent-Type: application/x-www-form-urlencoded\n \ncode=1%2Favoi49joqierjv9q0483uf&client_id=do32fiocg09j4g&client_secret{client_secret}&grant_type=authorization_code", "language": "http" } ] } [/block] A successful response to this request contains the following fields: [block:parameters] { "data": { "0-0": "access_token", "0-1": "The token that can be sent to a BetterLesson API endpoint.", "1-0": "refresh_token", "1-1": "A token that may be used to obtain a new access token. Refresh tokens are always valid for public access, and for private access they are valid until the user revokes access.", "2-0": "expires", "2-1": "UTC timestamp of when the access_token will expire.", "h-0": "Field", "h-1": "Description" }, "cols": 2, "rows": 3 } [/block] A successful response is returned as a JSON array, similar to the following: [block:code] { "codes": [ { "code": "{\n \"access_token\":\"1/fFAGRNJru1FTz70BzhT3Zg\",\n \"refresh_token\":\"1/ijoiwejqpeorjv209u3jp32EWCe9\",\n \"expires\": <datetime>\n}", "language": "json" } ] } [/block] Access tokens expire one week after being issued. Make sure to use the refresh token to retrieve a new token upon expiration. [block:api-header] { "type": "basic", "title": "Calling a BetterLesson API Endpoint" } [/block] After your application obtains an access token, you can use the token to make calls to a BetterLesson API endpoint. To do this, include the access token in a request to the API by including either an access_token query parameter or an Authorization: Bearer HTTP header. When possible, the HTTP header is preferable, because query strings tend to be visible in server logs. **Examples** A call to the search endpoint using the access_token query string parameter might look like the following, though you'll need to specify your own access token: [block:code] { "codes": [ { "code": "GET https://api.betterlesson.com/search?keyword=algebra&access_token=1%2FfFBGRNJru1FQd44AzqT3Zg", "language": "http" } ] } [/block] Here is a call to the same API using the access_token ‘Authorization: Bearer’ HTTP header: [block:code] { "codes": [ { "code": "GET /search?keyword=algebra HTTP/1.1\nAuthorization: Bearer 1/fFBGRNJru1FQd44AzqT3Zg\nHost: api.betterlesson.com", "language": "http" } ] } [/block] [block:api-header] { "type": "basic", "title": "Using a Refresh Token" } [/block] Your application may obtain a new access token by sending a refresh token to the BetterLesson Authorization server. To obtain a new access token this way, your application sends an HTTPS POST request to https://api.betterlesson.com/oauth2/token. The request must include the following parameters: [block:parameters] { "data": { "0-0": "refresh_token", "0-1": "The refresh token returned from the authorization code exchange.", "1-0": "client_id", "1-1": "The client ID obtained from BetterLesson.", "2-0": "client_secret", "2-1": "The client secret obtained from BetterLesson.", "3-0": "grant_type", "3-1": "As defined in the OAuth 2.0 specification, this field must contain a value of ‘refresh_token’.", "h-0": "Field", "h-1": "Description" }, "cols": 2, "rows": 4 } [/block] Such a request will look similar to the following: [block:code] { "codes": [ { "code": "POST /oauth2/token HTTP/1.1\nHost: api.betterlesson.com\nContent-Type: application/x-www-form-urlencoded\n\nclient_id=do32fiocg09j4g&client_secret={client_secret}&refresh_token=1%2Fijoiwejqpeorjv209u3jp32EWCe9&grant_type=refresh_token", "language": "http" } ] } [/block] As long as the access granted to your application has not been revoked by BetterLesson or by the user, the response includes a new access token. A response from such a request is shown below: [block:code] { "codes": [ { "code": "{\n \"access_token\":\"1/fFAGRNJru1FTz70BzhT3Zg\",\n \"refresh_token\":\"1/ijoiwejqpeorjv209u3jp32EWCe9\",\n \"expires\": <datetime>\n}", "language": "json" } ] } [/block] You should save refresh tokens in long-term storage and continue to use them as long as they remain valid.
In order to access the BetterLesson API endpoints, clients will need to get an authorization code. This code should be then used to retrieve an access token and a refresh token. Client will be able to use the access token to access all endpoints until the token expires, at which point, clients will need to use the refresh token to get a new access token to continue to have access to the API endpoints. All these steps are explained in detail below. [block:api-header] { "type": "basic", "title": "Retrieving the Authorization Code" } [/block] The URL used when authenticating a user is https://api.betterlesson.com/oauth2/auth. This endpoint is accessible over SSL. Non-secure HTTP connections are refused. [block:parameters] { "data": { "0-0": "https://api.betterlesson.com/oauth2/auth", "0-1": "This endpoint is the target of the initial request. It will return an authorization code for the client_id provided, and it can also authenticate users and get their consent. The result of requests to this endpoint will be authorization codes.", "h-1": "Description", "h-0": "Endpoint" }, "cols": 2, "rows": 1 } [/block] The set of query string parameters supported are: [block:parameters] { "data": { "h-0": "Parameters", "h-1": "Values", "h-2": "Description", "0-0": "client_id", "0-1": "The client ID you obtain from BetterLesson.", "0-2": "Identifies the client that is making the request.", "1-0": "access_type", "1-1": "public (default) or\nprivate", "1-2": "Determine if the client can access the grantor’s private data." }, "cols": 3, "rows": 2 } [/block] An example URL is shown below: [block:code] { "codes": [ { "code": "https://api.betterlesson.com/oauth2/auth?client_id=dio32fiocg09j4g", "language": "http" } ] } [/block] If the access_type requested is public, the authorization code or any error messages will be in the response to the /oauth2/auth endpoint request. An example response for a 'public' access_type: [block:code] { "codes": [ { "code": "{\n \"code\":\"1/sdiojvaerjq3jf34verveoioijnw\"\n}", "language": "json" } ] } [/block] If, however, the access_type requested is private, the authorization request or any error messages will be sent to the redirect_uri set when your client credentials were created. You may change this uri by contacting BetterLesson support. All responses are returned to the web server on the query string, as shown below: An example response for a 'private' access_type: [block:code] { "codes": [ { "code": "https://demo.app.com/code?code=1%2Favoi49joqierjv9q0483uf", "language": "http" } ] } [/block] Authorization codes expire in 10 minutes. Make sure to retrieve your access token before the expiration. [block:api-header] { "type": "basic", "title": "Retrieving an Access Token" } [/block] After the client receives the authorization code, it may exchange the authorization code for an access token and a refresh token. This request is an HTTPS POST, and includes the following parameters: [block:parameters] { "data": { "h-0": "Field", "h-1": "Description", "0-0": "code", "0-1": "The authorization code returned from the initial request.", "1-0": "client_id", "1-1": "The client ID obtained from BetterLesson.", "2-0": "client_secret", "2-1": "The client secret obtained from BetterLesson.", "3-0": "grant_type", "3-1": "As defined in the OAuth 2.0 specification, this field must contain a value of ‘authorization_code’." }, "cols": 2, "rows": 4 } [/block] The actual request might look like the following: [block:code] { "codes": [ { "code": "POST /oauth2/token HTTP/1.1\nHost: api.betterlesson.com\nContent-Type: application/x-www-form-urlencoded\n \ncode=1%2Favoi49joqierjv9q0483uf&client_id=do32fiocg09j4g&client_secret{client_secret}&grant_type=authorization_code", "language": "http" } ] } [/block] A successful response to this request contains the following fields: [block:parameters] { "data": { "0-0": "access_token", "0-1": "The token that can be sent to a BetterLesson API endpoint.", "1-0": "refresh_token", "1-1": "A token that may be used to obtain a new access token. Refresh tokens are always valid for public access, and for private access they are valid until the user revokes access.", "2-0": "expires", "2-1": "UTC timestamp of when the access_token will expire.", "h-0": "Field", "h-1": "Description" }, "cols": 2, "rows": 3 } [/block] A successful response is returned as a JSON array, similar to the following: [block:code] { "codes": [ { "code": "{\n \"access_token\":\"1/fFAGRNJru1FTz70BzhT3Zg\",\n \"refresh_token\":\"1/ijoiwejqpeorjv209u3jp32EWCe9\",\n \"expires\": <datetime>\n}", "language": "json" } ] } [/block] Access tokens expire one week after being issued. Make sure to use the refresh token to retrieve a new token upon expiration. [block:api-header] { "type": "basic", "title": "Calling a BetterLesson API Endpoint" } [/block] After your application obtains an access token, you can use the token to make calls to a BetterLesson API endpoint. To do this, include the access token in a request to the API by including either an access_token query parameter or an Authorization: Bearer HTTP header. When possible, the HTTP header is preferable, because query strings tend to be visible in server logs. **Examples** A call to the search endpoint using the access_token query string parameter might look like the following, though you'll need to specify your own access token: [block:code] { "codes": [ { "code": "GET https://api.betterlesson.com/search?keyword=algebra&access_token=1%2FfFBGRNJru1FQd44AzqT3Zg", "language": "http" } ] } [/block] Here is a call to the same API using the access_token ‘Authorization: Bearer’ HTTP header: [block:code] { "codes": [ { "code": "GET /search?keyword=algebra HTTP/1.1\nAuthorization: Bearer 1/fFBGRNJru1FQd44AzqT3Zg\nHost: api.betterlesson.com", "language": "http" } ] } [/block] [block:api-header] { "type": "basic", "title": "Using a Refresh Token" } [/block] Your application may obtain a new access token by sending a refresh token to the BetterLesson Authorization server. To obtain a new access token this way, your application sends an HTTPS POST request to https://api.betterlesson.com/oauth2/token. The request must include the following parameters: [block:parameters] { "data": { "0-0": "refresh_token", "0-1": "The refresh token returned from the authorization code exchange.", "1-0": "client_id", "1-1": "The client ID obtained from BetterLesson.", "2-0": "client_secret", "2-1": "The client secret obtained from BetterLesson.", "3-0": "grant_type", "3-1": "As defined in the OAuth 2.0 specification, this field must contain a value of ‘refresh_token’.", "h-0": "Field", "h-1": "Description" }, "cols": 2, "rows": 4 } [/block] Such a request will look similar to the following: [block:code] { "codes": [ { "code": "POST /oauth2/token HTTP/1.1\nHost: api.betterlesson.com\nContent-Type: application/x-www-form-urlencoded\n\nclient_id=do32fiocg09j4g&client_secret={client_secret}&refresh_token=1%2Fijoiwejqpeorjv209u3jp32EWCe9&grant_type=refresh_token", "language": "http" } ] } [/block] As long as the access granted to your application has not been revoked by BetterLesson or by the user, the response includes a new access token. A response from such a request is shown below: [block:code] { "codes": [ { "code": "{\n \"access_token\":\"1/fFAGRNJru1FTz70BzhT3Zg\",\n \"refresh_token\":\"1/ijoiwejqpeorjv209u3jp32EWCe9\",\n \"expires\": <datetime>\n}", "language": "json" } ] } [/block] You should save refresh tokens in long-term storage and continue to use them as long as they remain valid.
{"_id":"5436e9d8b7cf0e1c0020dc78","type":"get","__v":0,"githubsync":"","is_link":false,"title":"/search","project":"5436b175b7cf0e1c0020dab5","updates":[],"category":"5436cca4d0ffee0e00f19132","editedParams2":true,"link_url":"","order":999,"sync_unique":"","api":{"results":{"codes":[{"language":"json","code":"{\n  'page' : <int>, // page currently on\n  'number_of_results' : <int>, // total lessons for common core identifier\n  'number_of_pages' : <int>, // number of pages of results\n  'number_of_results_per_page' : <int>, // number of lessons per page\n  'time_taken_in_seconds' : <float>, // time taken to get the results\n  'results' : [ // an array of lessons\n  \t{\n  \t\t'id' : <int>,\n      'title' : <string>,\n  \t\t'big_idea' : <string>,\n  \t\t'link' : <string>,\n  \t\t'image' : <string>,\n  \t\t'duration' : <string>,\n  \t\t'course_title' : <string>,\n  \t\t'unit_title' : <string>,\n  \t\t'author_first_name' : <string>,\n  \t\t'author_last_name' : <string>,\n  \t\t'author_image' : <string>,\n  \t\t'author_link' : <string>,\n      'common_core_tags' : [\n  \t\t\t{\n          'identifier' : <string>,\n          'description' : <string>\n\t\t\t\t},\n\t\t\t\t// ...\n  \t\t],\n      'subjects' : [\n  \t\t\t{\n          'name' : <string>\n\t\t\t\t}\n  \t\t],\n      'tags' : [\n  \t\t\t{\n          'name' : <string>\n\t\t\t\t},\n        // ...\n  \t\t],\n  \t},\n    // ...\n  ]\n}","name":"Success"},{"language":"json","code":"{}","name":"Failure"}]},"try":false,"url":"/search","auth":"never","basic_auth":false,"method":"get","params":[{"_id":"5436e9d8b7cf0e1c0020dc7c","required":true,"desc":"Access token.","default":"","type":"string","name":"access_token","in":"query"},{"_id":"5436e9d8b7cf0e1c0020dc7b","required":false,"desc":"Search keyword.","default":"","type":"string","name":"keyword","in":"query"},{"required":false,"desc":"Common Core identifier.","default":"","type":"string","name":"cc_identifier","in":"query","_id":"5436e9d8b7cf0e1c0020dc7a"},{"name":"page","in":"query","_id":"5436e9d8b7cf0e1c0020dc79","required":false,"desc":"Page number.","default":"","type":"int"}]},"excerpt":"","slug":"testinput","version":"5436b175b7cf0e1c0020dab8","body":"Retrieves Master Teacher lessons by keyword, and/or standard identifier. You may use the page parameter to get further results.","createdAt":"2014-10-09T20:02:32.674Z","editedParams":true,"user":"5436b11ed0ffee0e00f19049","childrenPages":[]}

get/search


Query Params

access_token:
required
string
Access token.
keyword:
string
Search keyword.
cc_identifier:
string
Common Core identifier.
page:
integer
Page number.
Retrieves Master Teacher lessons by keyword, and/or standard identifier. You may use the page parameter to get further results.

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Retrieves Master Teacher lessons by keyword, and/or standard identifier. You may use the page parameter to get further results.
{"_id":"5436eb3d775c241600f97fcf","__v":0,"editedParams2":true,"link_url":"","type":"get","user":"5436b11ed0ffee0e00f19049","editedParams":true,"githubsync":"","sync_unique":"","updates":[],"version":"5436b175b7cf0e1c0020dab8","api":{"auth":"never","basic_auth":false,"method":"get","params":[{"_id":"5436eb3d775c241600f97fd0","required":true,"desc":"Lesson ID","default":"","type":"string","name":"id","in":"path"}],"results":{"codes":[{"language":"json","code":"{\n  'time_taken_in_seconds' : <float>, // time taken to get the results\n  'lesson' : {\n    'id' : <int>,\n    'title' : <string>,\n    'big_idea' : <string>,\n    'link' : <string>,\n    'image' : <string>,\n    'duration' : <string>,\n    'course_title' : <string>,\n    'unit_title' : <string>,\n    'author_first_name' : <string>,\n    'author_last_name' : <string>,\n    'author_image' : <string>,\n    'author_link' : <string>,\n    'common_core_tags' : [\n      {\n        'identifier' : <string>,\n        'description' : <string>\n      },\n      // ...\n    ],\n    'subjects' : [\n      {\n        'name' : <string>\n      }\n    ],\n    'tags' : [\n      {\n        'name' : <string>\n      },\n      // ...\n    ],\n  },\n  'prev_lesson : {\n    'id' : <int>, // can be used to fetch the previous lesson\n    'title' : <string>, // previous lesson's title\n    'link' : <string> // previous lesson's link\n  },\n  'next_lesson : {\n    'id' : <int>, // can be used to fetch the next lesson\n    'title' : <string>, // next lesson's title\n    'link' : <string> // next lesson's link\n  }\n}","name":"Success"},{"language":"json","code":"{}","name":"Failure"}]},"try":false,"url":"/lesson/:id"},"body":"Retrieve a Master Teacher lesson's information, including previous and next lesson in the same unit.","order":999,"project":"5436b175b7cf0e1c0020dab5","category":"5436cca4d0ffee0e00f19132","createdAt":"2014-10-09T20:08:29.422Z","excerpt":"","is_link":false,"slug":"lessonid","title":"/lesson/:id","childrenPages":[]}

get/lesson/:id


Path Params

id:
required
string
Lesson ID
Retrieve a Master Teacher lesson's information, including previous and next lesson in the same unit.

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Retrieve a Master Teacher lesson's information, including previous and next lesson in the same unit.