{"openapi":"3.0.0","info":{"description":"Below is the documentation for the API calls. You can try them out right here. \n","title":"Fun Generators API","version":"1.5","x-apisguru-categories":["text"],"x-origin":[{"format":"swagger","url":"https://fungenerators.com/yaml/trivia.yaml","version":"2.0"}],"x-providerName":"fungenerators.com","x-serviceName":"trivia"},"tags":[{"description":"Trivia API","externalDocs":{"description":"Find out more","url":"http://fungenerators.com/api/trivia"},"name":"Trivia"}],"paths":{"/trivia":{"delete":{"description":"Create a random Trivia entry.","parameters":[{"description":"Trivia ID","in":"query","name":"id","required":true,"schema":{"type":"string","format":"string"}}],"responses":{"200":{"description":"200  response","content":{"application/json":{"examples":{"response":{"value":"{\n    \"success\": {\n        \"total\": 1\n    },\n    \"contents\": {\n        \"mesg\": \"Trivia 62D6iKM9GSlJxK5nrMf9XwrE is deleted\"\n    }\n}"}}}}},"401":{"description":"401  response","content":{"application/json":{"examples":{"response":{"value":"{\n    \"error\": {\n        \"code\": 401,\n        \"message\": \"Unauthorized\"\n    }\n}"}}}}}},"security":[{"X-Fungenerators-Api-Secret":[]}],"tags":["Trivia"]},"get":{"description":"Get a Trivia entry for a given id. Retrieves a trivia question and answer based on the id.","parameters":[{"description":"ID of the trivia to fetch","in":"query","name":"id","required":false,"schema":{"type":"string","format":"string"}}],"responses":{"200":{"description":"200  response","content":{"application/json":{"examples":{"response":{"value":"{\n    \"success\": {\n        \"total\": 1\n    },\n    \"contents\": [\n        {\n            \"id\": \"VO_foToeaTPvaDn_utYcOweF\",\n            \"question\": \"What is the unit of currency in the United States of America\",\n            \"category\": \"usa\",\n            \"category_name\": \"USA\",\n            \"answer\": [\n                \"Dollar\"\n            ]\n        }\n    ]\n}"}}}}},"401":{"description":"401  response","content":{"application/json":{"examples":{"response":{"value":"{\n    \"error\": {\n        \"code\": 401,\n        \"message\": \"Unauthorized\"\n    }\n}"}}}}}},"security":[{"X-Fungenerators-Api-Secret":[]}],"tags":["Trivia"]},"put":{"description":"Create a random Trivia entry.","parameters":[{"description":"Trivia Question","in":"query","name":"question","required":true,"schema":{"type":"string","format":"string"}},{"description":"Category of the trivia","in":"query","name":"category","required":true,"schema":{"type":"string","format":"string"}},{"description":"Answer(s) to the trivia question","in":"query","name":"answer","required":true,"schema":{"type":"string","format":"string"}}],"responses":{"200":{"description":"200  response","content":{"application/json":{"examples":{"response":{"value":"{\n    \"success\": {\n        \"total\": 1\n    },\n    \"contents\": {\n        \"id\": \"62D6iKM9GSlJxK5nrMf9XwrE\"\n    }\n}"}}}}},"401":{"description":"401  response","content":{"application/json":{"examples":{"response":{"value":"{\n    \"error\": {\n        \"code\": 401,\n        \"message\": \"Unauthorized\"\n    }\n}"}}}}}},"security":[{"X-Fungenerators-Api-Secret":[]}],"tags":["Trivia"]}},"/trivia/categories":{"get":{"description":"Get a random Trivia.","parameters":[{"description":"start","in":"query","name":"start","required":false,"schema":{"type":"integer","format":"integer"}}],"responses":{"200":{"description":"200  response","content":{"application/json":{"examples":{"response":{"value":"{\n    \"success\": {\n        \"total\": 1\n    },\n    \"contents\": [\n        {\n            \"id\": \"VO_foToeaTPvaDn_utYcOweF\",\n            \"question\": \"What is the unit of currency in the United States of America\",\n            \"category\": \"usa\",\n            \"category_name\": \"USA\",\n            \"answer\": [\n                \"Dollar\"\n            ]\n        }\n    ]\n}"}}}}},"401":{"description":"401  response","content":{"application/json":{"examples":{"response":{"value":"{\n    \"error\": {\n        \"code\": 401,\n        \"message\": \"Unauthorized\"\n    }\n}"}}}}}},"security":[{"X-Fungenerators-Api-Secret":[]}],"tags":["Trivia"]}},"/trivia/random":{"get":{"description":"Get a random trivia for a given category(optional)","parameters":[{"description":"Category to get the trivia from","in":"query","name":"category","required":false,"schema":{"type":"string","format":"string"}}],"responses":{"200":{"description":"200  response","content":{"application/json":{"examples":{"response":{"value":"{\n  \"success\": {\n    \"total\": 1\n  },\n  \"contents\": [\n    {\n      \"id\": \"YYUsmCE2ztoACb_smt0PrgeF\",\n      \"question\": \"Which country won the World Cup of Soccer in 1982\",\n      \"category\": \"sports\",\n      \"category_name\": \"Sports\",\n      \"answer\": [\n        \"Italy\"\n      ]\n    }\n  ]\n}"}}}}},"401":{"description":"401  response","content":{"application/json":{"examples":{"response":{"value":"{\n    \"error\": {\n        \"code\": 401,\n        \"message\": \"Unauthorized\"\n    }\n}                    "}}}}}},"security":[{"X-Fungenerators-Api-Secret":[]}],"tags":["Trivia"]}},"/trivia/search":{"get":{"description":"Search for random trivia which has the text in the query, for a given category(optional).","parameters":[{"description":"Text to search for in the trivia","in":"query","name":"query","required":false,"schema":{"type":"string","format":"string"}},{"description":"Category to get the trivia from","in":"query","name":"category","required":false,"schema":{"type":"string","format":"string"}}],"responses":{"200":{"description":"200  response","content":{"application/json":{"examples":{"response":{"value":"{\n  \"success\": {\n    \"total\": 1\n  },\n  \"contents\": {\n    \"trivia\": \"What natural hydrocarbon polymer comes from the hevea brasiliensis tree\",\n    \"id\": \"DFoazRj5O7x8PAVib9wROweF\",\n    \"category\": \"Whatnot\",\n    \"subcategory\": null\n  }\n}"}}}}},"401":{"description":"401  response","content":{"application/json":{"examples":{"response":{"value":"{\n    \"error\": {\n        \"code\": 401,\n        \"message\": \"Unauthorized\"\n    }\n}                                   "}}}}}},"security":[{"X-Fungenerators-Api-Secret":[]}],"tags":["Trivia"]}}},"servers":[{"url":"https://api.fungenerators.com"},{"url":"http://api.fungenerators.com"}],"components":{"securitySchemes":{"X-Fungenerators-Api-Secret":{"in":"header","name":"X-Fungenerators-Api-Secret","type":"apiKey"}}}}