> 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 # GetRolesCustomFieldApplications # Package: customFields # Namespace: CustomFieldApplications # Method link: https://dev.wix.com/docs/api-reference/crm/members-contacts/members/member-management/custom-fields/custom-field-applications/get-roles-custom-field-applications.md ## Introduction Retrieves a list of fields that are applied to specified roles. --- ## REST API ### Schema ``` Method: getRolesCustomFieldApplications Description: Retrieves a list of fields that are applied to specified roles. URL: https://www.wixapis.com/members/v1/custom-fields-applications/roles Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: roleIds Method parameters: param name: roleIds | type: array | description: IDs of roles with custom field applications to retrieve. | required: true Return type: GetRolesCustomFieldApplicationsResponse - name: results | type: array | description: Retrieved list of custom field applications. - name: roleId | type: string | description: Role GUID. - name: applications | type: array | description: Custom field applications for the role. - name: customFieldKey | type: string | description: Custom field key. - name: applies | type: boolean | description: Whether the custom field applies to the member. - name: customField | type: CustomField | description: Custom field details. - name: id | type: string | description: Custom field GUID. - name: name | type: string | description: Custom field title. - name: key | type: string | description: Custom field key. - name: defaultPrivacy | type: Privacy | description: Privacy level of the custom field. - enum: - UNKNOWN: Unknown privacy. This value isn't used. - PUBLIC: The information appears on the members' public profile pages. - PRIVATE: Only the member can see this information. - name: fieldType | type: Type | description: Type of information to provide for members. - enum: - UNKNOWN: Unknown field type. This value isn't used. - TEXT: A text box to write text. - NUMBER: Only a number can be entered into the field. - DATE: Only a date can be entered into the field. - URL: Only a URL can be entered into the field. - SOCIAL: Only a link from the selected social media platform can be entered into the field. - name: socialType | type: Type | description: Social network type. - enum: - UNKNOWN: Unknown social type. This value isn't used. - FACEBOOK: Facebook social media platform. - INSTAGRAM: Instagram social media platform. - LINKEDIN: LinkedIn social media platform. - TWITTER: X (formerly Twitter) social media platform. - YOUTUBE: Youtube social media platform. - PINTEREST: Pinterest social media platform. - TIKTOK: TikTok social media platform. - DEVIANTART: DeviantArt social media platform. - SOUNDCLOUD: SoundCloud social media platform. - TUMBLR: Tumblr social media platform. - VIMEO: Vimeo social media platform. - VKONTAKTE: VKontakte social media platform. - ODNOKLASSNIKI: Odnoklassniki social media platform. - OTHER: Other social media platform. - name: fieldOrigin | type: Origin | description: Field origin. - enum: - UNKNOWN: Unknown field origin. This value isn't used. - CUSTOM: Custom field created by a Wix user. - CONTACT: Contact type of field. These are default fields that are already provided by Members Area, such as: "birth date", "position", "company". - SYSTEM: System fields, such as: "first name", "last name", "email", "phone", "address", and "title". Some system fields are only available from the dashboard. - name: appliesTo | type: AppliesTo | description: Which members will have the custom field in their profile. - enum: - ALL_MEMBERS: Everyone will have this field. - SELECTED_MEMBERS: Only selected members will have this field. See the [Custom Field Application API](https://dev.wix.com/docs/rest/crm/members-contacts/members/custom-fields/custom-field-applications/introduction.md) for more information. - name: section | type: Section | description: A section which the field belongs to. - enum: - GENERAL: General section. All custom fields and the following default fields are assigned to this section: "first name", "last name", "email", "phone", "birth date", "position", "company". - SOCIAL: Social media section. The "social media" field is assigned to this section. - DISPLAY_INFO: Display info section. The default "title" field is assigned to this section. - ADDRESS: Address section. The default "address" field is assigned to this section. - name: createdDate | type: string | description: Date and time when the field was created. - name: updatedDate | type: string | description: Date and time when the field was updated. - name: revision | type: string | description: Revision number, which increments by 1 each time the custom field is updated. To prevent conflicting changes, the existing revision must be used when updating a custom field. ``` ### Examples ### Get roles custom field applications ```curl curl -X POST \ https://www.wixapis.com/members/v1/members/custom-fields-applications/roles \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Authorization: ' -d '{ "roleIds": [ "a7c33e4e-d769-4954-ab87-b3d0492703b4" ] }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.customFields.CustomFieldApplications.getRolesCustomFieldApplications(roleIds) Description: Retrieves a list of fields that are applied to specified roles. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: roleIds Method parameters: param name: roleIds | type: array | description: IDs of roles with custom field applications to retrieve. | required: true Return type: PROMISE - name: results | type: array | description: Retrieved list of custom field applications. - name: roleId | type: string | description: Role GUID. - name: applications | type: array | description: Custom field applications for the role. - name: customFieldKey | type: string | description: Custom field key. - name: applies | type: boolean | description: Whether the custom field applies to the member. - name: customField | type: CustomField | description: Custom field details. - name: _id | type: string | description: Custom field GUID. - name: name | type: string | description: Custom field title. - name: key | type: string | description: Custom field key. - name: defaultPrivacy | type: Privacy | description: Privacy level of the custom field. - enum: - UNKNOWN: Unknown privacy. This value isn't used. - PUBLIC: The information appears on the members' public profile pages. - PRIVATE: Only the member can see this information. - name: fieldType | type: Type | description: Type of information to provide for members. - enum: - UNKNOWN: Unknown field type. This value isn't used. - TEXT: A text box to write text. - NUMBER: Only a number can be entered into the field. - DATE: Only a date can be entered into the field. - URL: Only a URL can be entered into the field. - SOCIAL: Only a link from the selected social media platform can be entered into the field. - name: socialType | type: Type | description: Social network type. - enum: - UNKNOWN: Unknown social type. This value isn't used. - FACEBOOK: Facebook social media platform. - INSTAGRAM: Instagram social media platform. - LINKEDIN: LinkedIn social media platform. - TWITTER: X (formerly Twitter) social media platform. - YOUTUBE: Youtube social media platform. - PINTEREST: Pinterest social media platform. - TIKTOK: TikTok social media platform. - DEVIANTART: DeviantArt social media platform. - SOUNDCLOUD: SoundCloud social media platform. - TUMBLR: Tumblr social media platform. - VIMEO: Vimeo social media platform. - VKONTAKTE: VKontakte social media platform. - ODNOKLASSNIKI: Odnoklassniki social media platform. - OTHER: Other social media platform. - name: fieldOrigin | type: Origin | description: Field origin. - enum: - UNKNOWN: Unknown field origin. This value isn't used. - CUSTOM: Custom field created by a Wix user. - CONTACT: Contact type of field. These are default fields that are already provided by Members Area, such as: "birth date", "position", "company". - SYSTEM: System fields, such as: "first name", "last name", "email", "phone", "address", and "title". Some system fields are only available from the dashboard. - name: appliesTo | type: AppliesTo | description: Which members will have the custom field in their profile. - enum: - ALL_MEMBERS: Everyone will have this field. - SELECTED_MEMBERS: Only selected members will have this field. See the [Custom Field Application API](https://dev.wix.com/docs/rest/crm/members-contacts/members/custom-fields/custom-field-applications/introduction.md) for more information. - name: section | type: Section | description: A section which the field belongs to. - enum: - GENERAL: General section. All custom fields and the following default fields are assigned to this section: "first name", "last name", "email", "phone", "birth date", "position", "company". - SOCIAL: Social media section. The "social media" field is assigned to this section. - DISPLAY_INFO: Display info section. The default "title" field is assigned to this section. - ADDRESS: Address section. The default "address" field is assigned to this section. - name: _createdDate | type: Date | description: Date and time when the field was created. - name: _updatedDate | type: Date | description: Date and time when the field was updated. - name: revision | type: string | description: Revision number, which increments by 1 each time the custom field is updated. To prevent conflicting changes, the existing revision must be used when updating a custom field. ``` ### Examples ### getRolesCustomFieldApplications ```javascript import { customFieldApplications } from '@wix/members'; async function getRolesCustomFieldApplications(roleIds) { const response = await customFieldApplications.getRolesCustomFieldApplications(roleIds); }; ``` ### getRolesCustomFieldApplications (with elevated permissions) ```javascript import { customFieldApplications } from '@wix/members'; import { auth } from '@wix/essentials'; async function myGetRolesCustomFieldApplicationsMethod(roleIds) { const elevatedGetRolesCustomFieldApplications = auth.elevate(customFieldApplications.getRolesCustomFieldApplications); const response = await elevatedGetRolesCustomFieldApplications(roleIds); } ``` ### getRolesCustomFieldApplications (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 { customFieldApplications } from '@wix/members'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { customFieldApplications }, // Include the auth strategy and host as relevant }); async function getRolesCustomFieldApplications(roleIds) { const response = await myWixClient.customFieldApplications.getRolesCustomFieldApplications(roleIds); }; ``` ---