> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: getTask(taskId: string) # Method package: wixCrmV2 # Method menu location: wixCrmV2 --> tasks --> getTask # Method Link: https://dev.wix.com/docs/velo/apis/wix-crm-v2/tasks/get-task.md # Method Description: Retrieves a task by ID. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Get a task (dashboard page code) ```javascript import { tasks } from 'wix-crm.v2'; /* Sample taskId value: * '3194f3f2-945f-4810-8905-d02b24f9e790' */ export async function myGetTaskFunction(taskId) { try { const task = await tasks.getTask(taskId); return task; } catch(error){ console.log(error); // Handle the error } } /* Promise resolves to: * { * "revision": "1", * "title": "Follow up", * "description": "Send a follow up email", * "status": "ACTION_NEEDED", * "source": { * "sourceType": "APP", * "appId": "151e476a-715e-ec33-db9a-a7ff4d51f70a" * }, * "contact": { * "firstName": "Sally", * "lastName": "Smith", * "email": "sally.smith@example.com", * "phone": "+1 524-624-2486", * "_id": "5518ee7f-270e-40c4-b756-dad56e8f0ffc" * }, * "_id": "3194f3f2-945f-4810-8905-d02b24f9e790", * "_createdDate": "2024-01-18T11:35:29.092Z", * "_updatedDate": "2024-01-18T11:35:29.092Z" * } */ ``` ## Get a task (export from backend code) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { tasks } from 'wix-crm.v2'; import { elevate } from 'wix-auth'; /* Sample taskId value: * '3194f3f2-945f-4810-8905-d02b24f9e790' */ export const myGetTaskFunction = webMethod(Permissions.Anyone, async (taskId) => { try { const elevatedGetTask = elevate(tasks.getTask); const task = await elevatedGetTask(taskId); return task; } catch(error){ console.log(error); // Handle the error } }); /* Promise resolves to: * { * "revision": "1", * "title": "Follow up", * "description": "Send a follow up email", * "status": "ACTION_NEEDED", * "source": { * "sourceType": "APP", * "appId": "151e476a-715e-ec33-db9a-a7ff4d51f70a" * }, * "contact": { * "firstName": "Sally", * "lastName": "Smith", * "email": "sally.smith@example.com", * "phone": "+1 524-624-2486", * "_id": "5518ee7f-270e-40c4-b756-dad56e8f0ffc" * }, * "_id": "3194f3f2-945f-4810-8905-d02b24f9e790", * "_createdDate": "2024-01-18T11:35:29.092Z", * "_updatedDate": "2024-01-18T11:35:29.092Z" * } */ ``` ---