--- sidebar_position: 7 --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; # Approve task Approve task by ID `Function ApproveTask(Val URL, Val TaskID, Val Token = "") Export` | Parameter | CLI option | Type | Required | Description | |-|-|-|-|-| | URL | --url | String | ✔ | URL of webhook or a Bitrix24 domain, when token used | | TaskID | --task | Number, String | ✔ | Task ID | | Token | --token | String | ✖ | Access token, when app auth method used | Returns: Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API
:::tip Method at API documentation: [tasks.task.approve](https://dev.1c-bitrix.ru/rest_help/tasks/task/tasks/tasks_task_approve.php) :::
```bsl title="1C:Enterprise/OneScript code example" URL = "https://b24-ar17wx.bitrix24.by/rest/1/1o2..."; TaskID = "2526"; Result = OPI_Bitrix24.ApproveTask(URL, TaskID); URL = "b24-ar17wx.bitrix24.by"; Token = "f69b1367006e9f06006b12e400000001000..."; TaskID = "2528"; Result = OPI_Bitrix24.ApproveTask(URL, TaskID, Token); ``` ```json title="Result" { "result": { "task": { "id": "2398", "title": "Another task title", "description": "Another task description", "descriptionInBbcode": "Y", "declineReason": "", "priority": "1", "notViewed": "N", "statusComplete": "2", "multitask": "N", "stageId": "0", "responsibleId": "602", "responsibleName": "Oleg", "responsibleLastName": "Lama", "responsibleSecondName": null, "responsibleLogin": "c97e7aef-e5c1-4971-94a8-853cff3f0e5e@exepmple.org", "responsibleWorkPosition": null, "responsiblePhoto": null, "dateStart": null, "durationFact": null, "timeEstimate": "0", "timeSpentInLogs": null, "replicate": "N", "deadline": "2024-10-10T12:19:00+03:00", "deadlineOrig": "10.10.2024 12:19:00", "startDatePlan": "2024-10-09T09:19:28+03:00", "endDatePlan": "2024-10-10T00:00:00+03:00", "createdBy": "1", "createdByName": "Антон", "createdByLastName": "Титовец", "createdBySecondName": null, "createdByLogin": "VKuser657846756", "createdByWorkPosition": null, "createdByPhoto": "30", "createdDate": "2024-10-09T09:19:28+03:00", "changedBy": "1", "changedDate": "2024-10-09T09:19:39+03:00", "statusChangedBy": "1", "closedBy": "1", "closedDate": "2024-10-09T09:19:39+03:00", "activityDate": "2024-10-09T09:19:39+03:00", "guid": "{51464df0-4e32-4fbe-9e9c-5d7081eb0ffb}", "xmlId": null, "mark": null, "allowChangeDeadline": "N", "allowTimeTracking": "N", "matchWorkTime": "N", "taskControl": "N", "addInReport": "N", "forumTopicId": "1664", "parentId": null, "commentsCount": "2", "serviceCommentsCount": "2", "forumId": "11", "siteId": "s1", "subordinate": "N", "exchangeModified": null, "exchangeId": null, "outlookVersion": "6", "viewedDate": "2024-10-09T09:19:40+03:00", "deadlineCounted": "0", "forkedByTemplateId": null, "sorting": null, "durationPlanSeconds": null, "durationTypeAll": "days", "scenarioName": [ "default" ], "isRegular": "N", "flowId": null, "isMuted": "N", "isPinned": "N", "isPinnedInGroup": "N", "ufCrmTask": false, "ufTaskWebdavFiles": false, "ufMailMessage": null, "status": "5", "statusChangedDate": "2024-10-09T09:19:39+03:00", "durationPlan": null, "durationType": "days", "favorite": "N", "groupId": "0", "auditors": [], "accomplices": [], "tags": [], "checklist": [], "files": [], "dependsOn": [], "group": [], "creator": { "id": "1", "name": "Антон Титовец", "link": "/company/personal/user/1/", "icon": "https://b24-ar17wx.bitrix24.by/b28528874/resize_cache/30/c0120a8d7c10d63c83e32398d1ec4d9e/main/d7e/d7e99cf556e4ab676463dae2c00ddfbb/a7e0af6899300e3c684caeca5c334d81.jpg", "workPosition": null }, "responsible": { "id": "602", "name": "Oleg Lama", "link": "/company/personal/user/602/", "icon": "/bitrix/images/tasks/default_avatar.png", "workPosition": null }, "accomplicesData": [], "auditorsData": [], "newCommentsCount": 0, "action": { "accept": false, "decline": false, "complete": false, "approve": false, "disapprove": false, "start": false, "pause": false, "delegate": false, "remove": true, "edit": true, "defer": false, "renew": true, "create": true, "changeDeadline": true, "checklistAddItems": true, "addFavorite": true, "deleteFavorite": false, "rate": true, "edit.originator": false, "checklist.reorder": true, "elapsedtime.add": true, "dayplan.timer.toggle": false, "edit.plan": true, "checklist.add": true, "favorite.add": true, "favorite.delete": false }, "checkListTree": { "nodeId": 0, "fields": { "id": null, "copiedId": null, "entityId": null, "userId": 1, "createdBy": null, "parentId": null, "title": "", "sortIndex": null, "displaySortIndex": "", "isComplete": false, "isImportant": false, ... ```