跳到主要内容

List message notifications for currently authenticated users

GET 

/api/v5/notifications

Request​

Query Parameters

    access_token stringrequired

    User authorization code; alternatively, authenticate using the Authorization: Bearer <access_token> request header.

    page integer

    Page number; Default: 1; Must be a positive integer

    per_page integer

    Items per page; Default 30; Range 1–100

    state string

    Read status; unread: Unread only (default); read: Read only; all: All (including read)

    type string

    Single-select message source; omitting this parameter indicates all types. pull_request: PR; issue: Issue; mention: @Me; invitation: Invitation messages; pipeline_alert: Pipeline alerts; system: System messages. Can be independently combined with state.

    since string

    Retrieve only messages created strictly after this time; format yyyy-MM-dd'T'HH:mm:ssXXX; when used with 'before', must be earlier than 'before'; '+' in URL must be encoded as '%2B'

    before string

    Only retrieve messages created strictly before this time; Format: yyyy-MM-dd'T'HH:mm:ssXXX; Encode '+' as %2B in URLs

Responses​

Response Headers
    Schema
      totalint64required

      Total number of messages matching the filter criteria, consistent with the total_count in the response header.

      list object[]required

      Message notifications for the current page; empty array when no data.

    • Array [
    • idstringrequired

      Message ID

      contentstringrequired

      Message content, consistent with the message center, may contain HTML.

      typestringrequired

      Message source: pull_request (PR), issue (Issue), mention (@me), invitation (Invitation), pipeline_alert (Pipeline Alert), system (System); other sources retain their original types.

      unreadbooleanrequired

      Unread status; true indicates unread, false indicates read.

      created_atdate-time

      Message creation time. Fixed to Beijing Time, format yyyy-MM-dd'T'HH:mm:ssXXX, without milliseconds.

      html_urlstring

      Resource Page URL for Triggered Message

      actor object

      The user who triggered the message; this field may be omitted for system messages.

      idstringrequired

      User Object ID

      loginstring

      username

      avatar_urlstring

      User Avatar URL; omit if not provided

      repository object

      Associated Warehouse; this field may be omitted for non-warehouse messages.

      idint64

      Warehouse ID

      full_namestring

      Full repository path, e.g., owner/repo

      human_namestring

      Full Warehouse Display Name

      urlstring

      Repository Page URL

    • ]