Add missing REST endpoints
As noted in #49, I made a list of the endpoints that (at the time) I believed were missing.
After finding some time to sit down and go through the document, I think I've made the relevant adjustments to cover a large number of missing endpoints.
I apologise for the massive wall of text that's about to follow, but it documents where I've got to with filling in the gaps.
Unfortunately, this only covers the REST endpoints, not streaming endpoints. Additionally, these changes lack tests, which is also my fault. However, I didn't feel justified in spamming mastodon.social with test runs. Where possible, I have tested the endpoints manually using botsin.space as a test instance, and using binding.irb calls.
If there is anything that you would like me to do to aid the closure of #49, I will make it a priority from my perspective so that the gem can get a new release.
I don't typically use GitHub for development, so I also apologise if this is not correct behaviour.
Endpoints I falsely stated were missing
- Accounts
- Main account methods
- Statuses
- Method:
GET - Route:
/api/v1/accounts/#{id}/statuses
- Method:
- Feature on Profile (pins)
- Method:
POST - Route:
/api/v1/accounts/#{id}/pin
- Method:
- Unfeature on Profile (unpin)
- Method:
POST - Route:
/api/v1/accounts/#{id}/unpin
- Method:
- Statuses
- Suggestions
- Follow suggestions
- Method:
GET - Route:
/api/v1/suggestions
- Method:
- Remove a suggestion
- Method:
DELETE - Route:
/api/v1/suggestions/#{account_id}
- Method:
- Follow suggestions
- Main account methods
- Reports
- Create a Report
- Method:
POST - Route:
/api/v1/reports
- Method:
- Create a Report
- Notifications
- Main notification methods
- Dismiss a single notification
- Method:
POST - Route:
/api/v1/notifications/#{id}/dismiss
- Method:
- Dismiss a single notification
- Main notification methods
Endpoints that I've implemented in the Gem
- Accounts
- Main account methods
- Lists
- Method:
GET - Route:
/api/v1/accounts/#{id}/lists
- Method:
- Identity Proofs
- Method:
GET - Route:
/api/v1/accounts/#{id}/identity_proofs
- Method:
- Lists
- Favourites
- Method:
GET - Route:
/api/v1/favourites
- Method:
- Featured Tags
- View your featured tags
- Method:
GET - Route:
/api/v1/featured_tags
- Method:
- Feature a tag
- Method:
POST - Route:
/api/v1/featured_tags
- Method:
- Unfeature a tag
- Method:
DELETE - Route:
/api/v1/featured_tags/#{id}
- Method:
- Suggested tags to feature
- Method:
GET - Route:
/api/v1/featured_tags/suggestions
- Method:
- View your featured tags
- Main account methods
- Apps
- OAuth
- Obtain a Token
- Method:
POST - Route:
/api/v1/oauth/token
- Method:
- Revoke token
- Method:
POST - Route:
/api/v1/oauth/revoke
- Method:
- Obtain a Token
- OAuth
- Statuses
- Polls
- View a poll
- Method:
GET - Route:
/api/v1/polls/#{id}
- Method:
- Vote on a poll
- Method:
POST - Route:
/api/v1/polls/#{id}/votes
- Method:
- View a poll
- Polls
- Notifications
- Main notification methods
- Get a single notification
- Method:
GET - Route:
/api/v1/notifications/#{id}
- Method:
- Get a single notification
- Main notification methods
- Notifications
- Push
- Subscribe to push notifications
- Method:
POST - Route:
/api/v1/push/subscription
- Method:
- Get current subscription
- Method:
GET - Route:
/api/v1/push/subscription
- Method:
- Change types of notifications
- Method:
PUT - Route:
/api/v1/push/subscription
- Method:
- Remove current subscription
- Method:
DELETE - Route:
/api/v1/push/subscription
- Method:
- Subscribe to push notifications
- Push
- Directory
- View profile directory
- Method:
GET - Route
/api/v1/directory
- Method:
- View profile directory
- Trends
- Trending tags
- Method:
GET - Route:
/api/v1/trends
- Method:
- Trending tags
- Announcements
- View all announcements
- Method:
GET - Route:
/api/v1/announcements
- Method:
- Dismiss an announcements
- Method:
POST - Route:
/api/v1/announcements/#{id}/dismiss
- Method:
- Add reaction
- Method:
PUT - Route:
/api/v1/announcements/#{id}/reactions/#{name}
- Method:
- Remove reaction
- Method:
DELETE - Route:
/api/v1/announcements/#{id}/reactions/#{name}
- Method:
- View all announcements
Endpoints I'm not sure about
- Accounts
- Bookmarks (might be deprecated, not sure whether to bother to implement for Bookmarks)
- Method:
GET - Route:
/api/v1/bookmarks
- Method:
- Reports (some of the documentation was missing, I think this API endpoint is missing/removed now)
- File a report
- Method:
GET - Route:
/api/v1/reports
- Method:
- File a report
- Preferences (I think I can implement this, but I'm not sure how to represent this, because of the weird shaping of the response keys (
<string>:<string>:<string>))- View user preferences
- Method:
GET - Route:
/api/v1/preferences
- Method:
- View user preferences
- Bookmarks (might be deprecated, not sure whether to bother to implement for Bookmarks)
- Apps
- OAuth
- Authorize (not sure about this, since the response is a string/page to fill in)
- Method:
GET - Route:
/api/v1/oauth/authorize
- Method:
- Authorize (not sure about this, since the response is a string/page to fill in)
- OAuth
- Statuses
- Media
- Update an attachment (Get an Attachment, before it is attached to a status and posted...) (Not sure how to represent this with the current object/request method calls - would have to have a
Filepassed through to request)- Method:
GET - Route:
/api/v1/media/#{id}
- Method:
- Focal points
- No direct API documentation exists for this
- Update an attachment (Get an Attachment, before it is attached to a status and posted...) (Not sure how to represent this with the current object/request method calls - would have to have a
- Media
- Timelines
- Markers (They return a hash -> object representation, not sure if this should return an object instead (
Mastodon::MarkerCollectionor similar), with sub-objects ofMastodon::Marker?)- Get saved timeline position
- Method:
GET - Route:
/api/v1/markers
- Method:
- Save position in timeline
- Method:
POST - Route:
/api/v1/markers
- Method:
- Get saved timeline position
- Markers (They return a hash -> object representation, not sure if this should return an object instead (
- Admin (not currently complete documentation for API, there's also an Admin CLI (though it would be useful to have Admin calls in a separate library))
- Proofs (not sure how to represent this, unless just to directly return the response)
- View identity proof
- Method:
GET - Route:
/api/proofs
- Method:
- View identity proof
- OEmbed (not sure how to represent this, unless just to directly return the response)
- OEmbed as JSON
- Method:
GET - Route:
/api/oembed
- Method:
- OEmbed as JSON