لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/notifications/confirm.md فهرس التوثيق — /llms.txt
مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.
Execute a notification button
POST /v1/notifications/:id/confirm
Presses a button on a request notification on behalf of the token owner: runs the button action, such as accepting an invitation or confirming a request, and deletes the notification.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionNotification identifier — the data.notifications[].id field in the notification feed GET /v1/notifications. A positive integer |
Request fields (body)
| Field | Type | Required | Description |
|---|---|---|---|
Fieldvalue |
Typestring, number | Requiredyes | DescriptionValue of the pressed button from the data.notifications[].notifyButtons field of the notification feed — the part of the button's COMMAND_PARAMS after the | character. For "38959|Y" it is Y. An empty string, 0 and "0" are not accepted |
Examples
curl — personal key
curl -X POST "https://vibecode.bitrix24.com/v1/notifications/38959/confirm" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "value": "Y" }'
curl — OAuth application
curl -X POST "https://vibecode.bitrix24.com/v1/notifications/38959/confirm" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "value": "Y" }'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/notifications/38959/confirm', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ value: 'Y' }),
})
const { data } = await res.json()
console.log(data.resultMessage[0])
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/notifications/38959/confirm', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({ value: 'Y' }),
})
const { data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | Descriptiontrue on success |
Fielddata.resultMessage |
Typestring[] | DescriptionResult messages. Bitrix24 writes the text — escape it before displaying it in a UI |
Response example
HTTP 200:
{
"success": true,
"data": {
"resultMessage": ["Invitation accepted"]
}
}
Error response example
422 — the notification has no buttons, or the token owner has no such notification:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "Notification is absent, unavailable to the token owner, or cannot perform this action.",
"b24Code": "NOTIFICATION_ACTION_FAILED"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_PARAMS |
DescriptionThe path id is not a positive integer |
| HTTP400 | CodeINVALID_PARAMS |
Descriptionvalue is missing, is neither a string nor a number, is empty or equals 0 / "0" |
| HTTP400 | CodeINVALID_PARAMS |
DescriptionAnother body field or a query string parameter was passed, or the body is not a JSON object. The field is named in the message. Checked before the Bitrix24 call |
| HTTP400 | CodeFST_ERR_CTP_EMPTY_JSON_BODY |
DescriptionThe Content-Type: application/json header was sent with an empty body |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionThe notification does not exist, is unavailable to the token owner or does not perform this action — including a notification without buttons. The Bitrix24 error code NOTIFICATION_ACTION_FAILED is in the error.b24Code field |
| HTTP502 | CodeBITRIX_UNAVAILABLE |
DescriptionBitrix24 returned a response without the list of result messages |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe key lacks the im scope |
| HTTP403 | CodeWRITE_BLOCKED_READONLY_KEY |
DescriptionThe key is in read-only mode. Checked before the Bitrix24 call |
| HTTP403 | CodeBITRIX_ACCESS_DENIED |
DescriptionBitrix24 denied access |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe key has no configured tokens |
| HTTP401 | CodeMISSING_API_KEY |
DescriptionThe X-Api-Key header was not sent |
Full list of common API errors — Errors.
Known specifics
notifyButtonsin the feed is a JSON string. Parse the string before reading the buttons'COMMAND_PARAMS.- After the button is pressed, the notification is gone from the feed, and pressing it again returns
422 BITRIX_ERROR. - A notification without buttons has no
notifyButtonsfield in the feed, and pressing returns422 BITRIX_ERROR. The notification stays in the feed. - The button is pressed on behalf of the token owner: with a personal key, the key owner; with an OAuth application key and the
Authorization: Bearerheader, the session user.