> 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 # GetErrorFileDownloadUrl # Package: accounts # Namespace: LoyaltyImports # Method link: https://dev.wix.com/docs/api-reference/crm/loyalty-program/accounts/imports/get-error-file-download-url.md ## Permission Scopes: Manage Loyalty: SCOPE.DC-LOYALTY.MANAGE-LOYALTY ## Introduction Retrieves the download URL for the error file of a failed loyalty import. If an import fails, the `importResult.errorFileExists` field in the `LoyaltyImport` object is set to `true`. Use this method to get the URL of the error file, which contains details about which items couldn't be imported and why. --- ## REST API ### Schema ``` Method: getErrorFileDownloadUrl Description: Retrieves the download URL for the error file of a failed loyalty import. If an import fails, the `importResult.errorFileExists` field in the `LoyaltyImport` object is set to `true`. Use this method to get the URL of the error file, which contains details about which items couldn't be imported and why. URL: https://www.wixapis.com/v1/loyalty-imports/error-file-download-url Method: GET # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: loyaltyImportId Method parameters: query param name: loyaltyImportId | type: loyaltyImportId | description: Loyalty import GUID. | required: true Return type: GetErrorFileDownloadUrlResponse - name: url | type: string | description: URL for downloading the error file. ``` ### Examples ### Get error file download URL ```curl curl -X GET \ 'https://www.wixapis.com/_api/loyalty-imports/v1/loyalty-imports/error-file-download-url?loyaltyImportId=bfc3f48e-4982-4977-a7a3-52bab9078a2d' \ -H 'Authorization: ' \ -H 'Content-Type: application/json' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.accounts.LoyaltyImports.getErrorFileDownloadUrl(loyaltyImportId) Description: Retrieves the download URL for the error file of a failed loyalty import. If an import fails, the `importResult.errorFileExists` field in the `LoyaltyImport` object is set to `true`. Use this method to get the URL of the error file, which contains details about which items couldn't be imported and why. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: loyaltyImportId Method parameters: param name: loyaltyImportId | type: string | description: Loyalty import GUID. | required: true Return type: PROMISE - name: url | type: string | description: URL for downloading the error file. ``` ### Examples ### getErrorFileDownloadUrl ```javascript import { imports } from '@wix/loyalty'; async function getErrorFileDownloadUrl(loyaltyImportId) { const response = await imports.getErrorFileDownloadUrl(loyaltyImportId); }; ``` ### getErrorFileDownloadUrl (with elevated permissions) ```javascript import { imports } from '@wix/loyalty'; import { auth } from '@wix/essentials'; async function myGetErrorFileDownloadUrlMethod(loyaltyImportId) { const elevatedGetErrorFileDownloadUrl = auth.elevate(imports.getErrorFileDownloadUrl); const response = await elevatedGetErrorFileDownloadUrl(loyaltyImportId); } ``` ### getErrorFileDownloadUrl (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 { imports } from '@wix/loyalty'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { imports }, // Include the auth strategy and host as relevant }); async function getErrorFileDownloadUrl(loyaltyImportId) { const response = await myWixClient.imports.getErrorFileDownloadUrl(loyaltyImportId); }; ``` ---