@trivia-api/fetch
Version:
Functions to fetch data from The Trivia API.
21 lines (20 loc) • 699 B
TypeScript
export interface CreateQuizParams {
apiKey: string;
title: string;
questionIds: string[];
}
/**
* Creates a quiz, allowing you to group questions together and present the same
* set of questions to multiple users.
*
* @param params - Parameters for creating a quiz
* @param params.apiKey - API key with access to sessions
* @param params.title - Title of the quiz
* @param params.questionIds - IDs of the questions to include in the quiz
* @param host - Optional parameter to send to a different API host
*
* @returns ID of the created quiz
*/
export declare const createQuiz: ({ apiKey, questionIds, title }: CreateQuizParams, host?: string) => Promise<{
id: string;
}>;