| Oct | NOV | Dec |
| 27 | ||
| 2019 | 2020 | 2021 |
COLLECTED BY
Collection: Common Crawl
https://lab.github.com/api receive the v0 version of the REST API.
This API is still in an early stage of development, so most aspects are still subject to change.
https://lab.github.com/api/v0. All data is sent and received as JSON.
$ curl -i https://lab.github.com/api/v0
HTTP/1.1 200 OK
Server: Cowboy
Date: Mon, 05 Aug 2019 18:55:49 GMT
Content-Type: application/json; charset=utf-8
Connection: Keep-alive
Etag: W/"2-vyGp6PvFo4RvsFtPoIWeCReyIC8"
Blank fields are included as null instead of being omitted.
All timestamps return in ISO 8601 format:
YYYY-MM-DDTHH:MM:SSZ
For more information about timezones in timestamps, see this section.
404 Not Found, instead of 403 Forbidden in some places. This is to prevent the accidental leakage of private data to unauthorized users.
curl -H "Authorization: token YOUR-TOKEN" https://lab.github.com/api/v0
Learning Lab only accepts sending tokens in request headers.
401 Unauthorized:
$ curl -H "Authorization: token YOUR-TOKEN" https://lab.github.com/api/v0
HTTP/1.1 401 Unauthorized
{
"message": "Bad credentials",
"documentation_url": "https://developer.github.com/v3"
}
Note: Personal access tokens generated for use with the Learning Lab API will not work with the GitHub API and vice versa. These tokens can only be used to authenticate via Learning Lab's API.
curl -i "https://lab.github.com/api/v0/courses/githubtraining?limit=50"
In this example, the githubtraining value is provided in the path, while limit is passed in the query string.
GET request to the root endpoint to get more information about what the REST API v0 supports:
curl https://lab.github.com/api/v0
| Error Code | Description |
|---|---|
400 |
The querystring contained invalid parameters. For example, if you passed a 'limit' parameter a string instead of a number. |
401 |
When the requester has not authenticated with the API |
403 |
When the course data is public, but it's not yours. If you tried to update someone else's progress in a course they're taking. |
404 |
Page not found. We may send this instead of a 400or403 even if what you're requesting is valid but you need credentials to access it. |
405 |
You're accessing a valid route, but the HTTP verb isn't supported. For example if you tried POST /courses |
408 |
The request timed out. This often happens simply due to a slow network connection. |
422 |
Unprocessable Entity. You may have sent a string or object that could not be parsed or read. |
429 |
API rate limit exceeded. The default rate limit is 60 requests per hour. Authenticated requests get 5000 per hour. |
| Status Code | Description |
|---|---|
301 |
Permanent redirection. The URI you used to make the request has been superseded by the one specified in the Location header field. This and all future requests to this resource should be directed to the new URI. |
302, 307 |
Temporary redirection. The request should be repeated verbatim to the URI specified in the Location header field but clients should continue to use the original URI for future requests. |
| Verb | Description |
|---|---|
GET |
Used for retrieving resources. |
POST |
Used for creating resources. |
PATCH |
Used for updating resources with partial JSON data. For instance, an Issue resource has title and body attributes. A PATCH request may accept one or more of the attributes to update the resource. PATCH is a relatively new and uncommon HTTP verb, so resource endpoints also accept POST requests. |
PUT |
Used for replacing resources or collections. For PUT requests with no body attribute, be sure to set the Content-Length header to zero. |
DELETE |
Used for deleting resources. |
?offset parameter. For some resources, you can also set a custom page size up to 100 with the ?limit parameter. Note that for technical reasons some endpoints may not respect the ?limit parameter.
curl 'https://lab.github.com/api/v0/courses?offset=2&limit=100'
Note that page numbering is 1-based and that omitting the ?limit parameter will return the first page.
For more information on pagination, check out the GitHub API's guide on Traversing with Pagination.
●© 2020 GitHub, Inc.
●Contact GitHub
●Blog
●About
●Community
●Help Center
●API
●Terms