1
0
mirror of https://github.com/mastodon/documentation synced 2025-04-11 22:56:17 +02:00
Emelia Smith cb3aa4de10
Document new OAuth changes for 4.3.0 (#1445)
* Improve deprecation messaging for Application#vapid_key

* Format JSON examples in Instance methods

* Remove vapid_key from Apps API examples, since this property is deprecated on Application entity

* Add documentation for new OAuth 2.0 features added in 4.3.0

* Improve documentation for oauth-scopes

* Update content/en/api/oauth-scopes.md

Co-authored-by: Matt Jankowski <matt@jankowski.online>

* Update content/en/api/oauth-scopes.md

Co-authored-by: Matt Jankowski <matt@jankowski.online>

* Update content/en/api/oauth-scopes.md

Co-authored-by: Matt Jankowski <matt@jankowski.online>

* Update content/en/api/oauth-scopes.md

Co-authored-by: Matt Jankowski <matt@jankowski.online>

* Add deprecated and removed shortcode labels

* Use deprecated and removed shortcodes

* Improve OAuth documentation

* More OAuth documentation improvements

* Correct streaming API documentation after 4.2.0 changes

* Add note about improved Push Subscription API validation in 4.3.0

* Fix inconsistent OAuth label formatting

* Add note that there is a relationship between Accounts and the Application used to create them

* Add note that application registration endpoint also supports JSON bodies

* Be consistent in the formatting of placeholder values for Bearer tokens

* code review changes

* Slight changes in wording

* Add documentation for PKCE

* Removal of crypto oauth scope

* Cross-link authorization's scope with the OAuth Scopes documentation

* Update content/en/methods/oauth.md

* Update content/en/api/oauth-scopes.md

---------

Co-authored-by: Matt Jankowski <matt@jankowski.online>
Co-authored-by: David Roetzel <david@roetzel.de>
2024-10-10 14:44:19 +02:00

3.0 KiB

title description menu aliases
markers API methods Save and restore your position in timelines.
docs
weight name parent identifier
30 markers methods-timelines methods-markers
/methods/markers
/api/methods/markers
/methods/timelines/markers

Get saved timeline positions

GET /api/v1/markers HTTP/1.1

Get current positions in timelines.

Returns: Hash of timeline key and associated [Marker]({{< relref "entities/Marker" >}})
OAuth: User token + read:statuses
Version history:
3.0.0 - added

Request

Headers
Authorization
{{}} Provide this header with Bearer <user_token> to gain authorized access to this API method.
Query parameters
timeline[]
Array of String. Specify the timeline(s) for which markers should be fetched. Possible values: home, notifications. If not provided, an empty object will be returned.

Response

200: OK

A request with ?timeline[]=home&timeline[]=notifications

{
  "notifications": {
    "last_read_id": "35098814",
    "version": 361,
    "updated_at": "2019-11-26T22:37:25.239Z"
  },
  "home": {
    "last_read_id": "103206604258487607",
    "version": 468,
    "updated_at": "2019-11-26T22:37:25.235Z"
  }
}
401: Unauthorized

Invalid or missing Authorization header.

{
  "error": "The access token is invalid"
}

Save your position in a timeline

POST /api/v1/markers HTTP/1.1

Save current position in timeline.

Returns: [Marker]({{< relref "entities/marker" >}})
OAuth: User token + write:statuses
Version history:
3.0.0 - added

Request

Headers
Authorization
{{}} Provide this header with Bearer <user_token> to gain authorized access to this API method.
Form data parameters
home[last_read_id]
String. ID of the last status read in the home timeline.
notifications[last_read_id]
String. ID of the last notification read.

Response

200: OK

Calling this API with home[last_read_id] causes a marker to be created for the home timeline.

{
  "home": {
    "last_read_id": "103194548672408537",
    "version": 462,
    "updated_at": "2019-11-24T19:39:39.337Z"
  }
}
401: Unauthorized

Invalid or missing Authorization header.

{
  "error": "The access token is invalid"
}

409: Conflict

If object is stale while being updated, an error will occur.

{
  "error": "Conflict during update, please try again"
}

See also

{{< page-relref ref="methods/timelines#home" caption="GET /api/v1/timelines/home (with min_id or since_id parameter)" >}}

{{< page-relref ref="methods/notifications#get" caption="GET /api/v1/notifications (with min_id or since_id parameter)" >}}

{{< caption-link url="https://github.com/mastodon/mastodon/blob/main/app/controllers/api/v1/markers_controller.rb" caption="app/controllers/api/v1/markers_controller.rb" >}}