Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
chatbot-jeff/DataAPIInfo.txt
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
30 lines (20 sloc)
721 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Functions | |
### getQuestion | |
-Input (category, difficulty, nrQuestions = 1) | |
To get a random category or difficulty ("" or "Any" or "Random") | |
-Output (questionsSet) | |
A dictionary if one question, a list of dictionaries if more than one | |
### getCategories | |
-Input (onlyCategories = False, , nrCat = 0) | |
True returns categories without ID numbers | |
nrCat returns a set number of random categories | |
-Output (categories) | |
#### Error Codes | |
0 - There was an error opening the URL | |
1 - Error reading JSON data | |
2 - The number of questions requested not valid | |
3 - Category not valid | |
4 - Difficulty not valid | |
5 - No results were found | |
6 - Invalid parameter | |
7 - Token not found or all available question were used |