Skip to Content
RpcNotifierv1

v1

NotificationService manages sending and receiving notifications.


Send UNARY

Send delivers a notification to a recipient.

Request: SendRequest

Name
recipientshared.notifications.v1.Recipient
shared.notifications.v1.Recipient
user_idstring
emailoptionalstring
phoneoptionalstring


recipient is who the notification should be delivered to.
subjectstring

subject is the short title of the notification.
bodystring

body is the full notification content.
scheduled_atoptional shared.notifications.v1.Timestamp
shared.notifications.v1.Timestamp
secondsint64
nanosint32


scheduled_at optionally schedules delivery for a future time.

Response: SendResponse

Name
notification_idstring

notification_id is the unique identifier assigned to the notification.
statusshared.notifications.v1.DeliveryStatus
shared.notifications.v1.DeliveryStatus
DELIVERY_STATUS_UNSPECIFIED
PENDING
DELIVERED
FAILED
READ


status is the initial delivery status.
queued_atshared.notifications.v1.Timestamp
shared.notifications.v1.Timestamp
secondsint64
nanosint32


queued_at is the time the notification was accepted.

Errors

INVALID_ARGUMENT

one or more fields failed validation.

Detail type: shared.notifications.v1.ValidationFailure

shared.notifications.v1.ValidationFailure
fieldstring
reasonstring

{ "field": "recipient.email | subject | body", "reason": "human-readable constraint violation" }

RESOURCE_EXHAUSTED

the caller has exceeded its notification quota.

Detail type: google.rpc.QuotaFailure

{ "violations": [ { "description": "daily send limit reached.", "subject": "notifications/day" }, { "description": "rate limit exceeded; back off and retry.", "subject": "notifications/second" } ] }

NOT_FOUND

the target resource could not be located.

Detail type: google.rpc.ResourceInfo

{ "resource_name": "recipient.user_id", "resource_type": "Recipient" }

NOT_FOUND

the recipient user does not exist.


FAILED_PRECONDITION

the account is not in a state that allows sending.

Detail type: google.rpc.PreconditionFailure

{ "violations": [ { "description": "the sending account has been suspended.", "type": "ACCOUNT_SUSPENDED" }, { "description": "the sender email has not been verified.", "type": "EMAIL_UNVERIFIED" } ] }

UNAUTHENTICATED

the request could not be authenticated.

Detail type: google.rpc.ErrorInfo

{ "domain": "notifier.example.com", "reason": "INVALID_TOKEN" }

UNAVAILABLE

the service is temporarily unavailable; retry after the indicated delay.

Detail type: google.rpc.RetryInfo

{ "retry_delay": "5s" }

Subscribe SERVER STREAM

Subscribe opens a live stream of incoming notifications for a user.

Request: SubscribeRequest

Name
user_idstring

user_id identifies the user whose notifications to stream.

Response: Notification

Name
notification_idstring

notification_id is the unique identifier of the notification.
subjectstring

subject is the short title of the notification.
bodystring

body is the full notification content.
statusshared.notifications.v1.DeliveryStatus
shared.notifications.v1.DeliveryStatus
DELIVERY_STATUS_UNSPECIFIED
PENDING
DELIVERED
FAILED
READ


status is the current delivery status.
sent_atshared.notifications.v1.Timestamp
shared.notifications.v1.Timestamp
secondsint64
nanosint32


sent_at is when the notification was originally sent.

Errors

NOT_FOUND

the user does not exist.


UNAUTHENTICATED

the request could not be authenticated.

Detail type: google.rpc.ErrorInfo

{ "domain": "notifier.example.com", "reason": "INVALID_TOKEN" }

UNAVAILABLE

the service is temporarily unavailable; retry after the indicated delay.

Detail type: google.rpc.RetryInfo

{ "retry_delay": "5s" }

Acknowledge CLIENT STREAM

Acknowledge bulk-acknowledges a stream of notification IDs.

Request: AcknowledgeRequest

Name
notification_idstring

notification_id is the ID of the notification to acknowledge.

Response: AcknowledgeResponse

Name
acknowledged_countint32

acknowledged_count is how many notifications were successfully acknowledged.
failed_idsstring[]

failed_ids contains IDs that could not be acknowledged.

Errors

NOT_FOUND

one or more notification IDs do not exist.


UNAUTHENTICATED

the request could not be authenticated.

Detail type: google.rpc.ErrorInfo

{ "domain": "notifier.example.com", "reason": "INVALID_TOKEN" }

Chat BIDI STREAM

Chat opens a bidirectional stream for real-time messaging.

Request: ChatMessage

Name
sender_idstring

sender_id is the user ID of the message author.
textstring

text is the content of the message.
sent_atshared.notifications.v1.Timestamp
shared.notifications.v1.Timestamp
secondsint64
nanosint32


sent_at is when the message was sent.

Response: ChatMessage

Name
sender_idstring

sender_id is the user ID of the message author.
textstring

text is the content of the message.
sent_atshared.notifications.v1.Timestamp
shared.notifications.v1.Timestamp
secondsint64
nanosint32


sent_at is when the message was sent.

Errors

NOT_FOUND

the target user for the chat session does not exist.


UNAUTHENTICATED

the request could not be authenticated.

Detail type: google.rpc.ErrorInfo

{ "domain": "notifier.example.com", "reason": "INVALID_TOKEN" }

RESOURCE_EXHAUSTED

the caller has exceeded its concurrent stream limit.

Detail type: google.rpc.QuotaFailure

{ "violations": [ { "description": "maximum concurrent chat streams reached.", "subject": "chat/concurrent_streams" } ] }