2018-02-23 23:58:32 +03:00
|
|
|
API Documentation
|
|
|
|
---
|
|
|
|
|
|
|
|
This is the API Documentation for Octobox. With this API, you can access and manage your Github notifications and user profile.
|
|
|
|
|
|
|
|
## Authentication
|
|
|
|
|
|
|
|
Every user has an API Token that you can see on [your settings page](/settings). Octobox uses standard API Token-based authentication.
|
|
|
|
|
2018-08-01 22:51:17 +03:00
|
|
|
To use this authentication, send Authentication and X-Octobox-API headers to Octobox:
|
2018-02-23 23:58:32 +03:00
|
|
|
|
|
|
|
```
|
2018-08-01 22:51:17 +03:00
|
|
|
Authorization: Bearer <token>
|
|
|
|
X-Octobox-API: 1
|
2018-02-23 23:58:32 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
For example, here is a basic Ruby example to get notifications:
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
require "net/http"
|
|
|
|
require "uri"
|
|
|
|
|
|
|
|
base_url = "https://<url>"
|
|
|
|
url = URI.parse("#{base_url}/notifications.json")
|
|
|
|
|
|
|
|
req = Net::HTTP::Get.new(url.path)
|
|
|
|
req.add_field("Authorization", "Bearer #{token}")
|
2018-08-01 22:51:17 +03:00
|
|
|
req.add_field("X-Octobox-API", "1")
|
2018-02-23 23:58:32 +03:00
|
|
|
res = Net::HTTP.new(url.host, url.port).start do |http|
|
|
|
|
http.request(req)
|
|
|
|
end
|
|
|
|
|
|
|
|
puts res.body
|
|
|
|
```
|
|
|
|
|
|
|
|
## Endpoints
|
|
|
|
|
|
|
|
The endpoints are listed by controller down the left hand side of these docs.
|
|
|
|
|
|
|
|
## Questions?
|
|
|
|
|
|
|
|
Please refer to the repository for this app. [You can find the repo here](https://github.com/octobox/octobox).
|