foliolib.folio.api.notify.Notify
- class foliolib.folio.api.notify.Notify(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)
Bases:
foliolib.folio.FolioApimod-notify API
This documents the API calls that can be made to post notifications for users, and to get them
- Parameters
tenant (str) – Tenant id
okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.
Methods
DELETE /notify/user/_selfDELETE /notifydelete_notify(notifyId)Delete notify item with given {notifyId}
get__selves(**kwargs)Retrieve a list of _self items.
get_notifies(**kwargs)Retrieve a list of notify items.
get_notify(notifyId)Retrieve notify item with given {notifyId}
modify_notify(notifyId, notify)Update notify item with given {notifyId}
set__self(_self)Create a new _self item.
set__username(username, _username, **kwargs)Send notification to the user by user name
set_notify(notify)Create a new notify item.
- delete__selves()
DELETE /notify/user/_self
- delete_notifies()
DELETE /notify
- delete_notify(notifyId: str)
Delete notify item with given {notifyId}
DELETE /notify/{notifyId}- Parameters
notifyId (str) –
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
- get__selves(**kwargs)
Retrieve a list of _self items.
GET /notify/user/_self- Parameters
**kwargs (properties) – Keyword Arguments
- Keyword Arguments
query (str) –
A query expressed as a CQL string (see [dev.folio.org/reference/glossary#cql](https://dev.folio.org/reference/glossary#cql)) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.
with valid searchable fields: for example link = 1234
Example
(username==”ab*” or personal.firstName==”ab*” or personal.lastName==”ab*”) and active==”true” sortby personal.lastName personal.firstName barcode
link=/users/1234
offset (int) –
(default=0) Skip over a number of elements by specifying an offset value for the query
Example
0
limit (int) –
(default=10) Limit the number of elements returned in the response
Example
10
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestError – Bad Request
OkapiRequestUnauthorized – Authentication is required
OkapiFatalError – Server Error
OkapiRequestUnprocessableEntity – Unprocessable Entity
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "description": "Collection of notifications", "properties": { "notifications": { "description": "List of notifications", "type": "array", "items": { "type": "object", "$ref": "notify.json" } }, "totalRecords": { "type": "integer" } }, "required": [ "notifications", "totalRecords" ] }
- get_notifies(**kwargs)
Retrieve a list of notify items.
GET /notify- Parameters
**kwargs (properties) – Keyword Arguments
- Keyword Arguments
query (str) –
A query expressed as a CQL string (see [dev.folio.org/reference/glossary#cql](https://dev.folio.org/reference/glossary#cql)) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.
with valid searchable fields: for example link = 1234
Example
(username==”ab*” or personal.firstName==”ab*” or personal.lastName==”ab*”) and active==”true” sortby personal.lastName personal.firstName barcode
link=/users/1234
offset (int) –
(default=0) Skip over a number of elements by specifying an offset value for the query
Example
0
limit (int) –
(default=10) Limit the number of elements returned in the response
Example
10
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestError – Bad Request
OkapiRequestUnauthorized – Authentication is required
OkapiFatalError – Server Error
OkapiRequestUnprocessableEntity – Unprocessable Entity
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "description": "Collection of notifications", "properties": { "notifications": { "description": "List of notifications", "type": "array", "items": { "type": "object", "$ref": "notify.json" } }, "totalRecords": { "type": "integer" } }, "required": [ "notifications", "totalRecords" ] }
- get_notify(notifyId: str)
Retrieve notify item with given {notifyId}
GET /notify/{notifyId}- Parameters
notifyId (str) –
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestNotFound – Not Found
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "description": "A notification to a user", "additionalProperties": false, "properties": { "id": { "description": "The UUID of this notification", "type": "string" }, "recipientId": { "description": "The UUID of the receiving user", "type": "string" }, "senderId": { "description": "The UUID of the sender", "type": "string" }, "text": { "description": "The text of this notification", "type": "string" }, "link": { "description": "Link to the relevant item for this notification", "type": "string" }, "eventConfigName": { "description": "Unique event config name", "type": "string" }, "lang": { "description": "Notification language", "type": "string" }, "context": { "type": "object", "description": "Context object" }, "seen": { "description": "Whether the user has seen this notification", "type": "boolean", "default": false }, "metadata": { "type": "object", "$ref": "raml-util/schemas/metadata.schema" } }, "required": [ "text" ] }
- modify_notify(notifyId: str, notify: dict)
Update notify item with given {notifyId}
PUT /notify/{notifyId}- Parameters
notifyId (str) –
notify (dict) – See Schema below
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
OkapiRequestUnprocessableEntity – Unprocessable Entity
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "description": "A notification to a user", "additionalProperties": false, "properties": { "id": { "description": "The UUID of this notification", "type": "string" }, "recipientId": { "description": "The UUID of the receiving user", "type": "string" }, "senderId": { "description": "The UUID of the sender", "type": "string" }, "text": { "description": "The text of this notification", "type": "string" }, "link": { "description": "Link to the relevant item for this notification", "type": "string" }, "eventConfigName": { "description": "Unique event config name", "type": "string" }, "lang": { "description": "Notification language", "type": "string" }, "context": { "type": "object", "description": "Context object" }, "seen": { "description": "Whether the user has seen this notification", "type": "boolean", "default": false }, "metadata": { "type": "object", "$ref": "raml-util/schemas/metadata.schema" } }, "required": [ "text" ] }
- set__self(_self: dict)
Create a new _self item.
POST /notify/user/_self- Parameters
_self (dict) – See Schema below
- Raises
OkapiRequestError – Bad Request
OkapiRequestUnauthorized – Authentication is required
OkapiFatalError – Server Error
Headers
Location - URI to the created _self item
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "description": "A notification to a user", "additionalProperties": false, "properties": { "id": { "description": "The UUID of this notification", "type": "string" }, "recipientId": { "description": "The UUID of the receiving user", "type": "string" }, "senderId": { "description": "The UUID of the sender", "type": "string" }, "text": { "description": "The text of this notification", "type": "string" }, "link": { "description": "Link to the relevant item for this notification", "type": "string" }, "eventConfigName": { "description": "Unique event config name", "type": "string" }, "lang": { "description": "Notification language", "type": "string" }, "context": { "type": "object", "description": "Context object" }, "seen": { "description": "Whether the user has seen this notification", "type": "boolean", "default": false }, "metadata": { "type": "object", "$ref": "raml-util/schemas/metadata.schema" } }, "required": [ "text" ] }
- set__username(username: str, _username: dict, **kwargs)
Send notification to the user by user name
POST /notify/_username/{username}- Parameters
username (str) –
_username (dict) –
**kwargs (properties) – Keyword Arguments: See Schema below
- Keyword Arguments
lang (str) – (default=en) Requested language. Optional. [lang=en]
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
OkapiRequestUnprocessableEntity – Unprocessable Entity
Headers
Location - URI to the notification - X-Okapi-Trace - Okapi trace and timing
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "description": "A notification to a user", "additionalProperties": false, "properties": { "id": { "description": "The UUID of this notification", "type": "string" }, "recipientId": { "description": "The UUID of the receiving user", "type": "string" }, "senderId": { "description": "The UUID of the sender", "type": "string" }, "text": { "description": "The text of this notification", "type": "string" }, "link": { "description": "Link to the relevant item for this notification", "type": "string" }, "eventConfigName": { "description": "Unique event config name", "type": "string" }, "lang": { "description": "Notification language", "type": "string" }, "context": { "type": "object", "description": "Context object" }, "seen": { "description": "Whether the user has seen this notification", "type": "boolean", "default": false }, "metadata": { "type": "object", "$ref": "raml-util/schemas/metadata.schema" } }, "required": [ "text" ] }
- set_notify(notify: dict)
Create a new notify item.
POST /notify- Parameters
notify (dict) – See Schema below
- Raises
OkapiRequestError – Bad Request
OkapiRequestUnauthorized – Authentication is required
OkapiFatalError – Server Error
OkapiRequestUnprocessableEntity – Unprocessable Entity
Headers
Location - URI to the created notify item
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "description": "A notification to a user", "additionalProperties": false, "properties": { "id": { "description": "The UUID of this notification", "type": "string" }, "recipientId": { "description": "The UUID of the receiving user", "type": "string" }, "senderId": { "description": "The UUID of the sender", "type": "string" }, "text": { "description": "The text of this notification", "type": "string" }, "link": { "description": "Link to the relevant item for this notification", "type": "string" }, "eventConfigName": { "description": "Unique event config name", "type": "string" }, "lang": { "description": "Notification language", "type": "string" }, "context": { "type": "object", "description": "Context object" }, "seen": { "description": "Whether the user has seen this notification", "type": "boolean", "default": false }, "metadata": { "type": "object", "$ref": "raml-util/schemas/metadata.schema" } }, "required": [ "text" ] }