> 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 # GetAsyncJob # Package: asyncJob # Namespace: AsyncJobService # Method link: https://dev.wix.com/docs/api-reference/business-management/async-job/get-async-job.md ## Permission Scopes: READ ASYNC JOBS: SCOPE.ASYNC_JOB.READ ## Introduction Retrieves a job. --- ## REST API ### Schema ``` Method: getAsyncJob Description: Retrieves a job. URL: https://www.wixapis.com/v1/async-jobs/{jobId} Method: GET # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: jobId Method parameters: param name: jobId | type: none | required: true Return type: GetAsyncJobResponse - name: job | type: AsyncJob | description: Returned job. - name: id | type: string | description: Job GUID. - name: metadata | type: object | description: Optional job metadata, used to store any parameters used during job execution, user-defined statuses, etc. - name: status | type: Status | description: Current job execution status. - enum: - UNKNOWN: - INITIALIZED: Job is created, but hasn't started yet. - PROCESSING: Job has started and is in progress. - FINISHED: Job is finished. - FAILED: Job has failed. - name: createdDate | type: string | description: Date and time the job was created in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format. - name: updatedDate | type: string | description: Date and time the job was last updated in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format. - name: createdBy | type: CreatedBy | description: Job creator. - ONE-OF: - name: anonymousVisitorIdOptions | type: AnonymousVisitorIdOptions | description: Visitor GUID - when the job is created by a site visitor that was **not** logged in. - name: anonymousVisitorId | type: string | description: Visitor GUID - When the job is owned by a site visitor that was **not** logged in. - name: memberIdOptions | type: MemberIdOptions | description: Member GUID - When the job is created by a by a **logged in** site visitor. - name: memberId | type: string | description: Member GUID - When the job is owned by a by a **logged in** site visitor. - name: wixUserIdOptions | type: WixUserIdOptions | description: User GUID - When the job is created by a Wix user. - name: wixUserId | type: string | description: User GUID - When the job is owned by a site owner or contributor. - name: appIdOptions | type: AppIdOptions | description: App GUID - When the job is created by an external app or app by Wix. - name: appId | type: string | description: App GUID - When the job is owned by an external app. or app by Wix. - name: type | type: Type | description: The type of the creator. - enum: - UNKNOWN_TYPE: - ANONYMOUS_VISITOR_ID: Job was created by a site visitor that was **not** logged in. - MEMBER_ID: Job was created by a **logged in** site visitor. - WIX_USER_ID: Job was created by a Wix user. - APP_ID: Job was created by an external app or app by Wix. - name: counts | type: Counts | description: Current execution counts. - name: total | type: integer | description: Optional count of the dataset size, specified during job creation. Can be used for progress bars, etc. - name: successCount | type: integer | description: Amount of items that were successfully processed. - name: failCount | type: integer | description: Amount of items whose processing failed. - name: errorByCodeCount | type: object | description: Mapping between an error code and the number of failures associated with it. ``` ### Examples ### Get Async Job ```curl curl -X GET \ 'https://www.wixapis.com/async-jobs/v1/async-jobs/076e0505-6944-4645-a248-80b197ee9cfd' \ -H 'Authorization: ' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.asyncJob.AsyncJobService.getAsyncJob(jobId) Description: Retrieves a job. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: jobId Method parameters: param name: jobId | type: string | description: Job GUID. | required: true Return type: PROMISE - name: _id | type: string | description: Job GUID. - name: metadata | type: object | description: Optional job metadata, used to store any parameters used during job execution, user-defined statuses, etc. - name: status | type: Status | description: Current job execution status. - enum: - UNKNOWN: - INITIALIZED: Job is created, but hasn't started yet. - PROCESSING: Job has started and is in progress. - FINISHED: Job is finished. - FAILED: Job has failed. - name: _createdDate | type: Date | description: Date and time the job was created in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format. - name: _updatedDate | type: Date | description: Date and time the job was last updated in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format. - name: createdBy | type: CreatedBy | description: Job creator. - ONE-OF: - name: anonymousVisitorIdOptions | type: AnonymousVisitorIdOptions | description: Visitor GUID - when the job is created by a site visitor that was **not** logged in. - name: anonymousVisitorId | type: string | description: Visitor GUID - When the job is owned by a site visitor that was **not** logged in. - name: memberIdOptions | type: MemberIdOptions | description: Member GUID - When the job is created by a by a **logged in** site visitor. - name: memberId | type: string | description: Member GUID - When the job is owned by a by a **logged in** site visitor. - name: wixUserIdOptions | type: WixUserIdOptions | description: User GUID - When the job is created by a Wix user. - name: wixUserId | type: string | description: User GUID - When the job is owned by a site owner or contributor. - name: appIdOptions | type: AppIdOptions | description: App GUID - When the job is created by an external app or app by Wix. - name: appId | type: string | description: App GUID - When the job is owned by an external app. or app by Wix. - name: type | type: Type | description: The type of the creator. - enum: - UNKNOWN_TYPE: - ANONYMOUS_VISITOR_ID: Job was created by a site visitor that was **not** logged in. - MEMBER_ID: Job was created by a **logged in** site visitor. - WIX_USER_ID: Job was created by a Wix user. - APP_ID: Job was created by an external app or app by Wix. - name: counts | type: Counts | description: Current execution counts. - name: total | type: integer | description: Optional count of the dataset size, specified during job creation. Can be used for progress bars, etc. - name: successCount | type: integer | description: Amount of items that were successfully processed. - name: failCount | type: integer | description: Amount of items whose processing failed. - name: errorByCodeCount | type: object | description: Mapping between an error code and the number of failures associated with it. ``` ### Examples ### getAsyncJob ```javascript import { asyncJobs } from '@wix/async-jobs'; async function getAsyncJob(jobId) { const response = await asyncJobs.getAsyncJob(jobId); }; ``` ### getAsyncJob (with elevated permissions) ```javascript import { asyncJobs } from '@wix/async-jobs'; import { auth } from '@wix/essentials'; async function myGetAsyncJobMethod(jobId) { const elevatedGetAsyncJob = auth.elevate(asyncJobs.getAsyncJob); const response = await elevatedGetAsyncJob(jobId); } ``` ### getAsyncJob (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { asyncJobs } from '@wix/async-jobs'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { asyncJobs }, // Include the auth strategy and host as relevant }); async function getAsyncJob(jobId) { const response = await myWixClient.asyncJobs.getAsyncJob(jobId); }; ``` ---