> 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 # QueryInstructors # Package: onlinePrograms # Namespace: InstructorsService # Method link: https://dev.wix.com/docs/api-reference/business-management/online-programs/instructor-v2/query-instructors.md ## Permission Scopes: Manage Challenges: SCOPE.CHALLENGES.MANAGE ## Introduction Query instructors --- ## REST API ### Schema ``` Method: queryInstructors Description: Query instructors URL: https://www.wixapis.com/v2/instructors/query Method: POST Method parameters: param name: query | type: CursorQuery - name: cursorPaging | type: CursorPaging | description: Cursor paging options. Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#cursor-paging). - name: limit | type: integer | description: Maximum number of items to return in the results. - name: cursor | type: string | description: Pointer to the next or previous page in the list of results. Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request. - name: filter | type: object | description: Filter object. Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#filters). - name: sort | type: array | description: Sort object. Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#sorting). - name: fieldName | type: string | description: Name of the field to sort by. - name: order | type: SortOrder | description: Sort order. - enum: ASC, DESC Return type: QueryInstructorsResponse - name: instructors | type: array | description: The retrieved Categories - name: id | type: string | description: GUID of the instructor that equals to memberId - name: userId | type: string | description: User GUID for real instructors (will be filled only for real instructors) - name: name | type: string | description: The name of the instructor - name: description | type: string | description: A description of the instructor - name: photo | type: Image | description: URL of profile photo - name: id | type: string | description: Wix Media image GUID, set when the member selects an image from Wix Media. - name: url | type: string | description: Image URL. - name: height | type: integer | description: Original image width. - name: width | type: integer | description: Original image height. - name: offsetX | type: integer | description: X-axis offset. Default: `0`. - name: offsetY | type: integer | description: Y-axis offset. Default: `0`. - name: photoAltText | type: string | description: Alt text for profile photo (needed for a11y) - name: slug | type: string | description: Slug that determines the instructor's profile page URL. - name: role | type: Role | description: Role of the instructor - enum: - DEFAULT: VIRTUAL instructor - OWNER: REAL instructor who is the owner of the site - INSTRUCTOR: REAL instructor who has access to specified list of programs - MANAGER: REAL instructor who has the same rights as program owner - name: programIds | type: array | description: IDs of programs instructor is assigned to - name: createdDate | type: string | description: Date and time when the instructor was created - name: pagingMetadata | type: CursorPagingMetadata | description: Metadata for paging - name: count | type: integer | description: Number of items returned in current page. - name: cursors | type: Cursors | description: Cursor strings that point to the next page, previous page, or both. - name: next | type: string | description: Cursor string pointing to the next page in the list of results. - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page. + `true`: Another page of results can be retrieved. + `false`: This is the last page. ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.onlinePrograms.InstructorsService.queryInstructors(query) Description: Query instructors # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: query Method parameters: param name: query | type: InstructorQuery | required: true - name: cursorPaging | type: CursorPaging | description: Cursor paging options. Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#cursor-paging). - name: limit | type: integer | description: Maximum number of items to return in the results. - name: cursor | type: string | description: Pointer to the next or previous page in the list of results. Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request. - name: filter | type: object | description: Filter object. Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#filters). - name: sort | type: array | description: Sort object. Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#sorting). - name: fieldName | type: string | description: Name of the field to sort by. - name: order | type: SortOrder | description: Sort order. - enum: ASC, DESC Return type: PROMISE - name: instructors | type: array | description: The retrieved Categories - name: _id | type: string | description: GUID of the instructor that equals to memberId - name: userId | type: string | description: User GUID for real instructors (will be filled only for real instructors) - name: name | type: string | description: The name of the instructor - name: description | type: string | description: A description of the instructor - name: photo | type: Image | description: URL of profile photo - name: _id | type: string | description: Wix Media image GUID, set when the member selects an image from Wix Media. - name: url | type: string | description: Image URL. - name: height | type: integer | description: Original image width. - name: width | type: integer | description: Original image height. - name: offsetX | type: integer | description: X-axis offset. Default: `0`. - name: offsetY | type: integer | description: Y-axis offset. Default: `0`. - name: photoAltText | type: string | description: Alt text for profile photo (needed for a11y) - name: slug | type: string | description: Slug that determines the instructor's profile page URL. - name: role | type: Role | description: Role of the instructor - enum: - DEFAULT: VIRTUAL instructor - OWNER: REAL instructor who is the owner of the site - INSTRUCTOR: REAL instructor who has access to specified list of programs - MANAGER: REAL instructor who has the same rights as program owner - name: programIds | type: array | description: IDs of programs instructor is assigned to - name: _createdDate | type: Date | description: Date and time when the instructor was created - name: pagingMetadata | type: CursorPagingMetadata | description: Metadata for paging - name: count | type: integer | description: Number of items returned in current page. - name: cursors | type: Cursors | description: Cursor strings that point to the next page, previous page, or both. - name: next | type: string | description: Cursor string pointing to the next page in the list of results. - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page. + `true`: Another page of results can be retrieved. + `false`: This is the last page. ``` ### Examples ### queryInstructors ```javascript import { instructors } from '@wix/online-programs'; async function queryInstructors(query) { const response = await instructors.queryInstructors(query); }; ``` ### queryInstructors (with elevated permissions) ```javascript import { instructors } from '@wix/online-programs'; import { auth } from '@wix/essentials'; async function myQueryInstructorsMethod(query) { const elevatedQueryInstructors = auth.elevate(instructors.queryInstructors); const response = await elevatedQueryInstructors(query); } ``` ### queryInstructors (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 { instructors } from '@wix/online-programs'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { instructors }, // Include the auth strategy and host as relevant }); async function queryInstructors(query) { const response = await myWixClient.instructors.queryInstructors(query); }; ``` ---