Documentation ¶
Index ¶
Constants ¶
const ( // IDKey is for notification UUIDs IDKey = "id" // BasePath is the base path for serving the notification API, minus the 'api' prefix. BasePath = "/v1/notifications" // BasePathWithID is just the base path with the ID key in it. // Use this anywhere you need to know the ID of the notification being queried. BasePathWithID = BasePath + "/:" + IDKey BasePathWithClear = BasePath + "/clear" // ExcludeTypes is an array specifying notification types to exclude ExcludeTypesKey = "exclude_types[]" MaxIDKey = "max_id" LimitKey = "limit" SinceIDKey = "since_id" MinIDKey = "min_id" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func New ¶
func New(processor *processing.Processor) *Module
func (*Module) NotificationGETHandler ¶ added in v0.9.0
NotificationGETHandler swagger:operation GET /api/v1/notification/{id} notification
Get a single notification with the given ID.
--- tags: - notifications produces: - application/json parameters: - name: id type: string description: The ID of the notification. in: path required: true security: - OAuth2 Bearer: - read:notifications responses: '200': name: notifications description: Requested notification. schema: "$ref": "#/definitions/notification" '400': description: bad request '401': description: unauthorized '404': description: not found '406': description: not acceptable '500': description: internal server error
func (*Module) NotificationsClearPOSTHandler ¶
NotificationsClearPOSTHandler swagger:operation POST /api/v1/notifications/clear clearNotifications
Clear/delete all notifications for currently authorized user.
Will return an empty object `{}` to indicate success.
--- tags: - notifications produces: - application/json security: - OAuth2 Bearer: - read:notifications responses: '200': schema: type: object '400': description: bad request '401': description: unauthorized '404': description: not found '406': description: not acceptable '500': description: internal server error
func (*Module) NotificationsGETHandler ¶
NotificationsGETHandler swagger:operation GET /api/v1/notifications notifications
Get notifications for currently authorized user.
The notifications will be returned in descending chronological order (newest first), with sequential IDs (bigger = newer).
The next and previous queries can be parsed from the returned Link header. Example:
``` <https://example.org/api/v1/notifications?limit=80&max_id=01FC0SKA48HNSVR6YKZCQGS2V8>; rel="next", <https://example.org/api/v1/notifications?limit=80&since_id=01FC0SKW5JK2Q4EVAV2B462YY0>; rel="prev" ````
--- tags: - notifications produces: - application/json parameters: - name: max_id type: string description: >- Return only notifications *OLDER* than the given max notification ID. The notification with the specified ID will not be included in the response. in: query required: false - name: since_id type: string description: >- Return only notifications *newer* than the given since notification ID. The notification with the specified ID will not be included in the response. in: query - name: min_id type: string description: >- Return only notifications *immediately newer* than the given since notification ID. The notification with the specified ID will not be included in the response. in: query required: false - name: limit type: integer description: Number of notifications to return. default: 20 in: query required: false - name: exclude_types type: array items: type: string description: Array of types of notifications to exclude (follow, favourite, reblog, mention, poll, follow_request) in: query required: false security: - OAuth2 Bearer: - read:notifications responses: '200': headers: Link: type: string description: Links to the next and previous queries. name: notifications description: Array of notifications. schema: type: array items: "$ref": "#/definitions/notification" '400': description: bad request '401': description: unauthorized '404': description: not found '406': description: not acceptable '500': description: internal server error