> 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 # GetCustomEmbed # Package: customEmbeds # Namespace: CustomEmbedsService # Method link: https://dev.wix.com/docs/api-reference/business-management/custom-embeds/get-custom-embed.md ## Permission Scopes: SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS: SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS ## Introduction Retrieves a custom embed. --- ## REST API ### Schema ``` Method: getCustomEmbed Description: Retrieves a custom embed. URL: https://www.wixapis.com/embeds/v1/custom-embeds/{customEmbedId} Method: GET # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: customEmbedId Method parameters: param name: customEmbedId | type: none | required: true Return type: GetCustomEmbedResponse - name: customEmbed | type: CustomEmbed | description: Requested custom embed. - name: id | type: string | description: Custom embed GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the custom embed is updated. To prevent conflicting changes, the current revision must be passed when updating a custom embed. - name: name | type: string | description: Custom embed name, as displayed to Wix users. - name: enabled | type: boolean | description: Whether the custom embed is enabled on the site. Default: `true`. - name: loadOnce | type: boolean | description: Whether to load the custom embed once during initial site rendering, rather than on each page navigation. This setting affects performance and should be chosen based on the embed's functionality. Default: `true`. - name: domain | type: string | description: Site domain that's connected to the site, if relevant. - name: position | type: PositionOnPage | description: Position where the custom embed code is placed on the page. - enum: - UNKNOWN_POSITION: Illegal value, exception will be thrown if used - HEAD: HEAD position - BODY_START: BODY_START position - BODY_END: BODY_END position - name: embedData | type: CustomEmbed | description: Custom embed data. - name: category | type: Category | description: CustomEmbed's category - enum: - UNKNOWN_CATEGORY: Illegal type, exception will be thrown if used - ESSENTIAL: Essential category - FUNCTIONAL: Functional category - ANALYTICS: Analytics category - ADVERTISING: Advertising category - DATA_TO_THIRD_PARTY: Data to third party category - name: html | type: string | description: CustomEmbed's html - name: pageFilter | type: PageFilter | description: Page GUIDs where the custom embed should be loaded. By default, custom embeds are applied to all site pages. - name: pageIds | type: array | description: Pages where the site embed will be loaded. Possible Errors: HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: CUSTOM_EMBED_NOT_FOUND | Description: Couldn't find the custom embed. ``` ### Examples ### Get Custom Embed ```curl curl -X GET \ 'https://www.wixapis.com/embeds/v1/custom-embeds/8046df3c-7575-4098-a5ab-c91ad8f33c47' \ -H 'Authorization: ' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.customEmbeds.CustomEmbedsService.getCustomEmbed(customEmbedId) Description: Retrieves a custom embed. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: customEmbedId Method parameters: param name: customEmbedId | type: string | description: Custom embed GUID. | required: true Return type: PROMISE - name: _id | type: string | description: Custom embed GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the custom embed is updated. To prevent conflicting changes, the current revision must be passed when updating a custom embed. - name: name | type: string | description: Custom embed name, as displayed to Wix users. - name: enabled | type: boolean | description: Whether the custom embed is enabled on the site. Default: `true`. - name: loadOnce | type: boolean | description: Whether to load the custom embed once during initial site rendering, rather than on each page navigation. This setting affects performance and should be chosen based on the embed's functionality. Default: `true`. - name: domain | type: string | description: Site domain that's connected to the site, if relevant. - name: position | type: PositionOnPage | description: Position where the custom embed code is placed on the page. - enum: - UNKNOWN_POSITION: Illegal value, exception will be thrown if used - HEAD: HEAD position - BODY_START: BODY_START position - BODY_END: BODY_END position - name: embedData | type: CustomEmbed | description: Custom embed data. - name: category | type: Category | description: CustomEmbed's category - enum: - UNKNOWN_CATEGORY: Illegal type, exception will be thrown if used - ESSENTIAL: Essential category - FUNCTIONAL: Functional category - ANALYTICS: Analytics category - ADVERTISING: Advertising category - DATA_TO_THIRD_PARTY: Data to third party category - name: html | type: string | description: CustomEmbed's html - name: pageFilter | type: PageFilter | description: Page GUIDs where the custom embed should be loaded. By default, custom embeds are applied to all site pages. - name: pageIds | type: array | description: Pages where the site embed will be loaded. Possible Errors: HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: CUSTOM_EMBED_NOT_FOUND | Description: Couldn't find the custom embed. ``` ### Examples ### getCustomEmbed ```javascript import { customEmbeds } from '@wix/embeds'; async function getCustomEmbed(customEmbedId) { const response = await customEmbeds.getCustomEmbed(customEmbedId); }; ``` ### getCustomEmbed (with elevated permissions) ```javascript import { customEmbeds } from '@wix/embeds'; import { auth } from '@wix/essentials'; async function myGetCustomEmbedMethod(customEmbedId) { const elevatedGetCustomEmbed = auth.elevate(customEmbeds.getCustomEmbed); const response = await elevatedGetCustomEmbed(customEmbedId); } ``` ### getCustomEmbed (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 { customEmbeds } from '@wix/embeds'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { customEmbeds }, // Include the auth strategy and host as relevant }); async function getCustomEmbed(customEmbedId) { const response = await myWixClient.customEmbeds.getCustomEmbed(customEmbedId); }; ``` ---