> 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 # GetFunctionType # Package: functions # Namespace: FunctionTypes # Method link: https://dev.wix.com/docs/api-reference/business-management/functions/function-types/get-function-type.md ## Permission Scopes: Manage Functions: SCOPE.DC-FUNCTIONS.MANAGE-FUNCTIONS ## Introduction Retrieves a function type. --- ## REST API ### Schema ``` Method: getFunctionType Description: Retrieves a function type. URL: https://www.wixapis.com/functions/v1/function-types/{appDefId}/{functionTypeId} Method: GET # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: functionTypeId, appDefId Method parameters: param name: appDefId | type: none | required: true param name: functionTypeId | type: none | required: true Return type: GetFunctionTypeResponse - name: functionType | type: FunctionType | description: Retrieved function type. - name: id | type: string | description: Function type GUID. - name: function | type: Function | description: Settings for functions created from this function type. - name: definitions | type: array | description: Function method definitions that specify when and how the function executes. - name: method | type: string | description: Method name. - name: input | type: Input | description: Function input schema and UI definition. - name: schema | type: object | description: JSON schema that defines the function input. - name: ui | type: object | description: Defines how the function input is displayed in a site dashboard's function builder. - name: displayDescription | type: string | description: Input description displayed in a site dashboard's function builder. - name: builderServicePlugin | type: BuilderServicePlugin | description: Service plugin configuration for dynamic input schema fetching. - name: baseUri | type: string | description: The function type's associated service plugin's URL. - name: dynamicSchemaFetchingEnabled | type: boolean | description: Whether the associated service plugin supports appending the input schema dynamically. - name: output | type: Output | description: Function output schema and UI definition. - name: schema | type: object | description: JSON schema that defines the function output. - name: ui | type: object | description: Defines how the function output is displayed in a site dashboard's function builder. - name: defined | type: State | description: Message for when the logic returns a result. - name: description | type: string | description: Description displayed in a site dashboard's function builder. - name: empty | type: State | description: Message for when the logic returns no result. - name: staticContent | type: StaticContent | description: Static content for the output - name: title | type: string | description: Static content title - name: description | type: string | description: Static content description - name: triggerId | type: string | description: GUID of the [trigger](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/about-triggers.md) that activates this function definition. - name: configuration | type: Configuration | description: Function configuration including service plugin settings and behavior options. - name: multipleInstancesAllowed | type: boolean | description: Whether the function can be implemented multiple times on a single site. - name: customInitialPreset | type: CustomInitialPreset | description: Initial preset to apply when building a function from scratch. - name: functionTemplateExtensionId | type: string | description: GUID of the template to apply. - name: enabled | type: boolean | description: Whether to apply the template to functions created from scratch. - name: scope | type: Scope | description: Scope of the function when multiple_instances_allowed is false - enum: - SITE: One function instance is allowed per site - ENTITY: One function instance is allowed per entity - name: entityScopeErrorMessage | type: string | description: Error message to display when entity scope validation fails. - name: servicePlugin | type: ServicePlugin | description: Service plugin configuration for function integration with business solutions. - name: fqdn | type: string | description: Service plugin fqdn. - name: schema | type: object | description: Service plugin configuration schema. - name: ui | type: object | description: How the service plugin is displayed in a site dashboard's function builder. - name: description | type: Description | description: Function descriptions, such as text to display in a site dashboard's function builder. - name: aboutDescription | type: string | description: Explains what the function does. - name: howItWorksDescription | type: string | description: Explains how the function works. - name: outcomeDescription | type: string | description: Expected outcome when the function runs. - name: representativeImage | type: Image | description: Function type's image displayed in the function catalog and builder. - name: id | type: string | description: WixMedia image GUID. - name: url | type: string | description: Image URL. - name: height | type: integer | description: Original image height. - name: width | type: integer | description: Original image width. - name: altText | type: string | description: Image alt text. - name: filename | type: string | description: Image filename. - name: builderlessTemplateSelectionModalTitle | type: string | description: Title of the builderless function template selection modal. - name: builderlessTemplateSelectionModalSubtitle | type: string | description: Subtitle of the builderless function template selection modal. - name: appDefId | type: string | description: GUID of the Wix app that defines this function type. - name: appName | type: string | description: Display name of the Wix app that defines this function type. - name: functionExtensionName | type: string | description: Display name of the function type. ``` ### Examples ### Get Function Type ```curl curl -X GET \ https://www.wixapis.com/functions/v1/types/d1a528f3-ee9b-4a58-82af-7c61ca127e3a/3099fa19-a7cc-4905-990f-480181918459 \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Authorization: ' -d '{ "functionTypeId": "d1a528f3-ee9b-4a58-82af-7c61ca127e3a", "appDefId": "553c79f3-5625-4f38-b14b-ef7c0d1e87df" }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.functions.FunctionTypes.getFunctionType(identifiers) Description: Retrieves a function type. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: identifiers.appDefId, identifiers.functionTypeId, identifiers Method parameters: param name: identifiers | type: GetFunctionTypeIdentifiers none | required: true - name: appDefId | type: string | description: GUID of the Wix app that defines the function type. | required: true - name: functionTypeId | type: string | description: Function type GUID. | required: true Return type: PROMISE - name: _id | type: string | description: Function type GUID. - name: function | type: Function | description: Settings for functions created from this function type. - name: definitions | type: array | description: Function method definitions that specify when and how the function executes. - name: method | type: string | description: Method name. - name: input | type: Input | description: Function input schema and UI definition. - name: schema | type: object | description: JSON schema that defines the function input. - name: ui | type: object | description: Defines how the function input is displayed in a site dashboard's function builder. - name: displayDescription | type: string | description: Input description displayed in a site dashboard's function builder. - name: builderServicePlugin | type: BuilderServicePlugin | description: Service plugin configuration for dynamic input schema fetching. - name: baseUri | type: string | description: The function type's associated service plugin's URL. - name: dynamicSchemaFetchingEnabled | type: boolean | description: Whether the associated service plugin supports appending the input schema dynamically. - name: output | type: Output | description: Function output schema and UI definition. - name: schema | type: object | description: JSON schema that defines the function output. - name: ui | type: object | description: Defines how the function output is displayed in a site dashboard's function builder. - name: defined | type: State | description: Message for when the logic returns a result. - name: description | type: string | description: Description displayed in a site dashboard's function builder. - name: empty | type: State | description: Message for when the logic returns no result. - name: staticContent | type: StaticContent | description: Static content for the output - name: title | type: string | description: Static content title - name: description | type: string | description: Static content description - name: triggerId | type: string | description: GUID of the [trigger](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/about-triggers.md) that activates this function definition. - name: configuration | type: Configuration | description: Function configuration including service plugin settings and behavior options. - name: multipleInstancesAllowed | type: boolean | description: Whether the function can be implemented multiple times on a single site. - name: customInitialPreset | type: CustomInitialPreset | description: Initial preset to apply when building a function from scratch. - name: functionTemplateExtensionId | type: string | description: GUID of the template to apply. - name: enabled | type: boolean | description: Whether to apply the template to functions created from scratch. - name: scope | type: Scope | description: Scope of the function when multiple_instances_allowed is false - enum: - SITE: One function instance is allowed per site - ENTITY: One function instance is allowed per entity - name: entityScopeErrorMessage | type: string | description: Error message to display when entity scope validation fails. - name: servicePlugin | type: ServicePlugin | description: Service plugin configuration for function integration with business solutions. - name: fqdn | type: string | description: Service plugin fqdn. - name: schema | type: object | description: Service plugin configuration schema. - name: ui | type: object | description: How the service plugin is displayed in a site dashboard's function builder. - name: description | type: Description | description: Function descriptions, such as text to display in a site dashboard's function builder. - name: aboutDescription | type: string | description: Explains what the function does. - name: howItWorksDescription | type: string | description: Explains how the function works. - name: outcomeDescription | type: string | description: Expected outcome when the function runs. - name: representativeImage | type: string | description: Function type's image displayed in the function catalog and builder. - name: builderlessTemplateSelectionModalTitle | type: string | description: Title of the builderless function template selection modal. - name: builderlessTemplateSelectionModalSubtitle | type: string | description: Subtitle of the builderless function template selection modal. - name: appDefId | type: string | description: GUID of the Wix app that defines this function type. - name: appName | type: string | description: Display name of the Wix app that defines this function type. - name: functionExtensionName | type: string | description: Display name of the function type. ``` ### Examples ### Get function type ```javascript import { functionTypes } from "@wix/functions"; async function getFunctionType() { const response = await functionTypes.getFunctionType({ functionTypeId: "d1a528f3-ee9b-4a58-82af-7c61ca127e3a", appDefId: "3099fa19-a7cc-4905-990f-480181918459", }); } /* Promise resolves to: * { * "functionType": { * "id": "d1a528f3-ee9b-4a58-82af-7c61ca127e3a", * "function": { "definitions": [...], "configuration": {...} }, * "appDefId": "553c79f3-5625-4f38-b14b-ef7c0d1e87df", * "functionExtensionName": "Loyalty rewards", * "version": "20", * "appName": "Wix Loyalty Program" * } * } */ ``` ### getFunctionType (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 { functionTypes } from '@wix/functions'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { functionTypes }, // Include the auth strategy and host as relevant }); async function getFunctionType(identifiers) { const response = await myWixClient.functionTypes.getFunctionType(identifiers); }; ``` ---