UTP+Class Query
AI-generatedSummary
Fetch various types of data from the UTP+Class API by selecting a specific query and providing required parameters such as User ID. Supports queries like dashboard courses, academic periods, chats, messages, pending activities, user searches, and sponsor banners.
Inputs
- Query (required) — Select the type of data to retrieve from options including Academic Periods, Dashboard Course, Get Chats, Get Messages, Pending Activities, Search Users, Sponsor Banners.
- User ID (required) — The UUID of the user making the request; must be a 36-character string.
- Query User ID — Used for 'Academic Periods' and 'Get Messages' queries. If set to 'me', uses the User ID; otherwise, uses this value as the user ID to query.
- Page — Page number for paginated results; applicable for 'Get Messages' and 'Search Users' queries, default is '1'.
- Search Name or User Code (required) — Required for 'Search Users' query; the name or user code (e.g., U12345678) to search for.
- Section — Optional section UUID filter for the 'Search Users' query.
- Filter (required) — Filter for the 'Get Chats' query, with options 'all', 'unread', or 'read'.
Output shape
a single JSON object containing the data returned by the selected UTP+Class API query
Returns the direct response from the API under the 'data' property; the shape varies depending on the chosen query. Throws an error if the User ID is not a valid 36-character UUID.
Examples
Example 1: Retrieve the dashboard courses for a student.
Set Query to 'Dashboard Course' and provide the user's 36-character User ID.
Example 2: Search users by name or code within a section.
Choose 'Search Users' as the Query, input User ID, specify page number, enter the search string in 'Search Name or User Code', and optionally provide a section UUID.