Digital Downloads Query
Note: The Teachify Admin API is currently under development and not yet available for public use. This documentation is provided for preview purposes only.
Overview
Section titled “Overview”The Digital Downloads API allows you to retrieve digital products for your school. Each digital product represents a downloadable item with pricing, metadata, and associated file attachments.
Available Queries
Section titled “Available Queries”digitalDownloads
Section titled “digitalDownloads”Returns a paginated list of digital downloads for the authenticated school. Soft-deleted products are excluded.
Required scope: This query accepts any of the following scopes: digital_products:read (the canonical scope) or digital_downloads:read (a legacy scope name still issued to Console admin preview tokens). A request presenting either scope is authorized.
Parameters:
| Parameter | Type | Description |
|---|---|---|
filter | DigitalProductFilter | Filter criteria (see Filtering) |
page | Int | Page number for pagination |
perPage | Int | Number of items per page (default: 20, max: 50) |
limit | Int | Alternative to perPage |
Returns:
- AdminDigitalProductPage object with:
nodes: Array of AdminDigitalProduct objectscurrentPage: Current page numberhasNextPage: Whether there are more pageshasPreviousPage: Whether there are previous pagesnodesCount: Total number of items matching the querytotalPages: Total number of pages
Example:
query { digitalDownloads( page: 1, perPage: 10 ) { nodes { id name description slug currency amount productType coverPhotoUrl published invisible isRatingActive createdAt updatedAt authors { id name } attachments { id name contentUrl } } currentPage hasNextPage hasPreviousPage nodesCount totalPages }}Digital Product Object
Section titled “Digital Product Object”The AdminDigitalProduct object contains the following fields:
| Field | Type | Description |
|---|---|---|
id | String! | Unique identifier |
name | String! | The name of the digital product |
description | String | A description of the digital product |
slug | String! | The URL-friendly identifier for the product |
currency | String! | The currency code for the product price |
amount | Float! | The price of the product |
productType | String! | The type of digital product |
coverPhotoUrl | String | The URL of the product’s cover photo |
isRatingActive | Boolean! | Whether ratings are enabled for the product |
published | Boolean! | Whether the product is published |
invisible | Boolean! | Whether the product is hidden from listings |
createdAt | Int! | Unix Timestamp (seconds since epoch). When the product was created |
updatedAt | Int! | Unix Timestamp (seconds since epoch). When the product was last updated |
authors | [Lecturer] | The authors associated with this product |
attachments | [Attachment] | The file attachments associated with this product |
Filtering
Section titled “Filtering”The digitalDownloads query accepts a filter parameter of type DigitalProductFilter. This allows you to narrow down results based on various criteria.
Available Filters
Section titled “Available Filters”| Filter Field | Type | Description |
|---|---|---|
id | StringOperator | Filter by digital product ID |
name | StringOperator | Filter by digital product name |
slug | StringOperator | Filter by product slug |
categoryIds | [String] | Return products in the given categories |
categorySlugs | [String] | Return products in the categories with the given slugs |
StringOperator
Section titled “StringOperator”The StringOperator used in filters has these operations:
| Operation | Description |
|---|---|
eq | Equal to |
neq | Not equal to |
in | In a list of values |
nin | Not in a list of values |
like | Match text values against a pattern using wildcards (case-sensitive) |
contains | Contains substring (case-insensitive) |
Filter Examples
Section titled “Filter Examples”Find a digital product by slug:
query { digitalDownloads( filter: { slug: { eq: "my-ebook" } } ) { nodes { id name slug amount } nodesCount }}Search products by name:
query { digitalDownloads( filter: { name: { contains: "guide" } } ) { nodes { id name } nodesCount }}Find products in specific categories:
query { digitalDownloads( filter: { categorySlugs: ["ebooks", "templates"] } ) { nodes { id name slug } nodesCount }}