Appearance
staff.notifications
1 method on staff.notifications. Each returns the answer's data and throws NoviqaError on a failed answer.
create
POST
/admin/v1/notificationsSend a notification to terminals
Sends a text message to the terminals of the accounts in logins: a comma separated list of logins and ranges ("1001, 1005-1010"), at most 1000 logins, repeats sent once. message is required, 1-1024 characters after trimming. Each message is stored (signed with the account group's company) so the terminal lists it later, then pushed to open terminals as a notification event. Each login is handled on its own: one out of scope or unknown gets sent false with its code. One journal line.
More details
Rights: the staff member needs every one of: notifications.
Request body
loginsstringcomma separated logins and ranges, e.g. "1001, 1005-1010"
messagestringthe text, 1-1024 characters
Returns
Promise<NotificationResult[]>The answer's
data.Errors
400
invalid_input: invalid input401
auth.session_expired: session expired, sign in again403
auth.csrf_invalid: request refused: reload the page and try again403
auth.invalid_terminal: this terminal cannot be used here403
auth.otp_enrol_required: your group requires one-time codes: set them up to continue403
auth.password_change_required: you must change your password first403
forbidden: you do not have access to this action500
internal: something went wrongts
import { staff } from "@/lib/noviqa"
const data = await staff.notifications.create({
logins: "100234, 100240-100245",
message: "Trading hours change on Friday."
})bash
curl -X POST "$NOVIQA_API_URL/admin/v1/notifications" \
-H "Authorization: Bearer $NOVIQA_TOKEN" \
-H "Content-Type: application/json" \
--data-raw '{
"logins": "100234, 100240-100245",
"message": "Trading hours change on Friday."
}'json
{
"success": true,
"code": "ok",
"message": "done",
"data": [
{
"code": "ok",
"id": 1,
"login": 1001,
"message": "string",
"sent": true
}
],
"request_id": "5b7f2c1e"
}ts
staff.notifications.create(body: http.docTradingNotify, options?: RequestOptions): Promise<account.NotificationResult[]>