> 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 # QueryPrograms # Package: programs # Namespace: ProgramsService # Method link: https://dev.wix.com/docs/api-reference/business-management/online-programs/programs/program/query-programs.md ## Permission Scopes: Wix Multilingual - Nile Wrapper Domain Events Read: SCOPE.MULTILINGUAL.NILE_WRAPPER_DOMAIN_EVENTS_READ ## Introduction Retrieves a list of Programs --- ## REST API ### Schema ``` Method: queryPrograms Description: Retrieves a list of Programs URL: https://www.wixapis.com/v3/programs/query Method: POST Method parameters: param name: query | type: QueryV2 - ONE-OF: - name: paging | type: Paging | description: Paging options to limit and skip the number of items. - name: limit | type: integer | description: Number of items to load. - name: offset | type: integer | description: - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. - 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 the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-filter-section). - name: sort | type: array | description: Sort object. Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-sort-section). - name: fieldName | type: string | description: Name of the field to sort by. - name: order | type: SortOrder | description: Sort order. - enum: ASC, DESC - name: fields | type: array | description: Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. - name: fieldsets | type: array | description: Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. Return type: QueryProgramsResponse - name: programs | type: array | description: Found programs - name: id | type: string | description: Program GUID. - name: revision | type: string | description: - name: createdDate | type: string | description: - name: updatedDate | type: string | description: - name: status | type: Status | description: current program state in v2 format - enum: - DRAFT: not published program, visible only on BM - PUBLISHED: program visible regarding to restrictions - ENDED: program isn't available to join. - ARCHIVED: closed program. Joins and sections/steps are not available for participants. - name: categoryIds | type: array | description: assigned categories - name: description | type: Description | description: general program info. - ONE-OF: - name: image | type: Image | description: WixMedia image - 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: video | type: VideoV2 | description: WixMedia video - name: id | type: string | description: WixMedia GUID. - name: resolutions | type: array | description: Available resolutions for the video, starting with the optimal resolution. - name: url | type: string | description: Video URL. - name: height | type: integer | description: Video height. - name: width | type: integer | description: Video width. - name: format | type: string | description: Video format for example, mp4, hls. - name: filename | type: string | description: Video filename. - name: title | type: string | description: - name: details | type: string | description: - name: timeline | type: Timeline | description: timeline type -> Self-paced, time-restricted. - name: selfPaced | type: boolean | description: are sections/steps evaluated every day? Or can UoU participate in a self paced mode? - name: startDate | type: string | description: everyone starts on this day - name: durationInDays | type: integer | description: duration of program in days (if applicable). - name: restrictions | type: Restrictions | description: participant limitation, step-completion pace and etc. - name: maxParticipants | type: integer | description: limit of active participants in the program. - name: hideFutureSteps | type: boolean | description: hide steps in the Pending state. - name: resolveStepsInOrder | type: boolean | description: allow participants complete steps in the certain order. - name: shareProgress | type: boolean | description: allow program participants to share their progress in group - name: accessType | type: AccessType | description: access restrictions options regarding visibility. - enum: - PUBLIC: join without approvals - PRIVATE: send a join request to the owner and get an approval from him. - SECRET: join possible only after owner invite. - name: price | type: Money | description: single-payment price. - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). - name: currency | type: string | description: Currency code. Must be valid ISO 4217 currency code (e.g., USD). - name: seo | type: Seo | description: seo settings. - name: slug | type: string | description: program slug expression - name: seoData | type: SeoSchema | description: schema used by Seo team - name: tags | type: array | description: SEO tag information. - name: type | type: string | description: SEO tag type. Supported values: `title`, `meta`, `script`, `link`. - name: props | type: object | description: A `{"key": "value"}` pair object where each SEO tag property (`"name"`, `"content"`, `"rel"`, `"href"`) contains a value. For example: `{"name": "description", "content": "the description itself"}`. - name: meta | type: object | description: SEO tag metadata. For example, `{"height": 300, "width": 240}`. - name: children | type: string | description: SEO tag inner content. For example, ` inner content `. - name: custom | type: boolean | description: Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages). - name: disabled | type: boolean | description: Whether the tag is disabled. If the tag is disabled, people can't find your page when searching for this phrase in search engines. - name: settings | type: Settings | description: SEO general settings. - name: preventAutoRedirect | type: boolean | description: Whether the [automatical redirect visits](https://support.wix.com/en/article/customizing-your-pages-seo-settings-in-the-seo-panel) from the old URL to the new one is enabled. Default: `false` (automatical redirect is enabled). - name: keywords | type: array | description: User-selected keyword terms for a specific page. - name: term | type: string | description: Keyword value. - name: isMain | type: boolean | description: Whether the keyword is the main focus keyword. - name: origin | type: string | description: The source that added the keyword terms to the SEO settings. - name: url | type: PageUrl | description: program url - name: base | type: string | description: The base URL. For premium sites, this is the domain. For free sites, this is the site URL. For example, `mysite.wixsite.com/mysite`. - name: path | type: string | description: The relative path for the page within the site. For example, `/product-page/a-product`. - name: imageUrl | type: string | description: image url from description media - name: imageAlt | type: string | description: alt text of image - name: courseWorkload | type: string | description: Approximate SEO program duration in Iso-8601 - name: rewards | type: array | description: rewards to be assigned after reaching some of the program milestones. - name: trigger | type: Trigger | description: on which action rewards must be assigned. - enum: - JOINED_TO_PROGRAM: member joins the program - STEP_COMPLETED: at least one step completed - ALL_STEPS_COMPLETED: all steps are completed. - name: badgeIds | type: array | description: badges participant will get on program complete - name: certificate | type: Certificate | description: certificate for program. Currently is program GUID - name: id | type: string | description: Certificate for program completion. Currently is program GUID - name: connectedDate | type: string | description: date it was connected to program - name: socialGroupId | type: string | description: connected social group. - name: extendedFields | type: ExtendedFields | description: extensible field - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: shouldSendInvoice | type: boolean | description: if true -> invoice is sent to the customer who purchased the program via single payment; else -> payment confirmation email is sent - name: videoStepsSettings | type: VideoStepsSettings | description: settings related to video steps in programs - name: autoNavigate | type: boolean | description: automatically switch to next video step after finishing current one - name: requiredCompletionPercentage | type: number | description: how many percents of video need to be watched to complete step - name: contentSummary | type: ContentSummary | description: number of content entities in program - name: stepCount | type: integer | description: number of steps in program - name: sectionCount | type: integer | description: number of sections in program - name: ownerUserId | type: string | description: user id of owner, who created this program - name: pagingMetadata | type: PagingMetadataV2 | description: paging - name: count | type: integer | description: Number of items returned in the response. - name: offset | type: integer | description: Offset that was requested. - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field. - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. - 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. ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.programs.ProgramsService.queryPrograms(query) Description: Retrieves a list of Programs # 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: ProgramQuery | required: true - ONE-OF: - required: true - name: paging | type: Paging | description: Paging options to limit and skip the number of items. - name: limit | type: integer | description: Number of items to load. - name: offset | type: integer | description: - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. - 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 the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-filter-section). - name: sort | type: array | description: Sort object. Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-sort-section). - 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: programs | type: array | description: Found programs - name: _id | type: string | description: Program GUID. - name: revision | type: string | description: - name: _createdDate | type: Date | description: - name: _updatedDate | type: Date | description: - name: status | type: Status | description: current program state in v2 format - enum: - DRAFT: not published program, visible only on BM - PUBLISHED: program visible regarding to restrictions - ENDED: program isn't available to join. - ARCHIVED: closed program. Joins and sections/steps are not available for participants. - name: categoryIds | type: array | description: assigned categories - name: description | type: Description | description: general program info. - ONE-OF: - name: image | type: string | description: WixMedia image - name: video | type: string | description: WixMedia video - name: title | type: string | description: - name: details | type: string | description: - name: timeline | type: Timeline | description: timeline type -> Self-paced, time-restricted. - name: selfPaced | type: boolean | description: are sections/steps evaluated every day? Or can UoU participate in a self paced mode? - name: startDate | type: string | description: everyone starts on this day - name: durationInDays | type: integer | description: duration of program in days (if applicable). - name: restrictions | type: Restrictions | description: participant limitation, step-completion pace and etc. - name: maxParticipants | type: integer | description: limit of active participants in the program. - name: hideFutureSteps | type: boolean | description: hide steps in the Pending state. - name: resolveStepsInOrder | type: boolean | description: allow participants complete steps in the certain order. - name: shareProgress | type: boolean | description: allow program participants to share their progress in group - name: accessType | type: AccessType | description: access restrictions options regarding visibility. - enum: - PUBLIC: join without approvals - PRIVATE: send a join request to the owner and get an approval from him. - SECRET: join possible only after owner invite. - name: price | type: Money | description: single-payment price. - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). - name: currency | type: string | description: Currency code. Must be valid ISO 4217 currency code (e.g., USD). - name: seo | type: Seo | description: seo settings. - name: slug | type: string | description: program slug expression - name: seoData | type: SeoSchema | description: schema used by Seo team - name: tags | type: array | description: SEO tag information. - name: type | type: string | description: SEO tag type. Supported values: `title`, `meta`, `script`, `link`. - name: props | type: object | description: A `{"key": "value"}` pair object where each SEO tag property (`"name"`, `"content"`, `"rel"`, `"href"`) contains a value. For example: `{"name": "description", "content": "the description itself"}`. - name: meta | type: object | description: SEO tag metadata. For example, `{"height": 300, "width": 240}`. - name: children | type: string | description: SEO tag inner content. For example, ` inner content `. - name: custom | type: boolean | description: Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages). - name: disabled | type: boolean | description: Whether the tag is disabled. If the tag is disabled, people can't find your page when searching for this phrase in search engines. - name: settings | type: Settings | description: SEO general settings. - name: preventAutoRedirect | type: boolean | description: Whether the [automatical redirect visits](https://support.wix.com/en/article/customizing-your-pages-seo-settings-in-the-seo-panel) from the old URL to the new one is enabled. Default: `false` (automatical redirect is enabled). - name: keywords | type: array | description: User-selected keyword terms for a specific page. - name: term | type: string | description: Keyword value. - name: isMain | type: boolean | description: Whether the keyword is the main focus keyword. - name: origin | type: string | description: The source that added the keyword terms to the SEO settings. - name: url | type: string | description: program url - name: imageUrl | type: string | description: image url from description media - name: imageAlt | type: string | description: alt text of image - name: courseWorkload | type: string | description: Approximate SEO program duration in Iso-8601 - name: rewards | type: array | description: rewards to be assigned after reaching some of the program milestones. - name: trigger | type: Trigger | description: on which action rewards must be assigned. - enum: - JOINED_TO_PROGRAM: member joins the program - STEP_COMPLETED: at least one step completed - ALL_STEPS_COMPLETED: all steps are completed. - name: badgeIds | type: array | description: badges participant will get on program complete - name: certificate | type: Certificate | description: certificate for program. Currently is program GUID - name: _id | type: string | description: Certificate for program completion. Currently is program GUID - name: connectedDate | type: Date | description: date it was connected to program - name: socialGroupId | type: string | description: connected social group. - name: extendedFields | type: ExtendedFields | description: extensible field - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: shouldSendInvoice | type: boolean | description: if true -> invoice is sent to the customer who purchased the program via single payment; else -> payment confirmation email is sent - name: videoStepsSettings | type: VideoStepsSettings | description: settings related to video steps in programs - name: autoNavigate | type: boolean | description: automatically switch to next video step after finishing current one - name: requiredCompletionPercentage | type: number | description: how many percents of video need to be watched to complete step - name: contentSummary | type: ContentSummary | description: number of content entities in program - name: stepCount | type: integer | description: number of steps in program - name: sectionCount | type: integer | description: number of sections in program - name: ownerUserId | type: string | description: user id of owner, who created this program - name: pagingMetadata | type: PagingMetadataV2 | description: paging - name: count | type: integer | description: Number of items returned in the response. - name: offset | type: integer | description: Offset that was requested. - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field. - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. - 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. ``` ### Examples ### queryPrograms ```javascript import { programs } from '@wix/online-programs'; async function queryPrograms(query) { const response = await programs.queryPrograms(query); }; ``` ### queryPrograms (with elevated permissions) ```javascript import { programs } from '@wix/online-programs'; import { auth } from '@wix/essentials'; async function myQueryProgramsMethod(query) { const elevatedQueryPrograms = auth.elevate(programs.queryPrograms); const response = await elevatedQueryPrograms(query); } ``` ### queryPrograms (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 { programs } from '@wix/online-programs'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { programs }, // Include the auth strategy and host as relevant }); async function queryPrograms(query) { const response = await myWixClient.programs.queryPrograms(query); }; ``` ---