Skip to content

Instantly share code, notes, and snippets.

@sagarjethi
Last active January 3, 2019 11:28
Show Gist options
  • Save sagarjethi/9570181b47c11baff6ea8359f6b59449 to your computer and use it in GitHub Desktop.
Save sagarjethi/9570181b47c11baff6ea8359f6b59449 to your computer and use it in GitHub Desktop.
{
"swagger": "2.0",
"info": {
"description": "",
"version": "1.0.0",
"title": "Qureos api",
},
"host": "13.233.254.67:3000",
"basePath": "/api",
"tags": [
{
"name": "User",
"description": "Everything about your user"
},
{
"name": "Question",
"description": "Everything about your question"
},
{
"name": "Category",
"description": "Everything about your question"
},
{
"name": "Tutor",
"description": "Everything about your question"
}
],
"schemes": [
"http"
],
"paths": {
"/v1/user/login": {
"post": {
"tags": [
"user"
],
"summary": "Login user( Student, Tutor) into the system",
"description": " userType: student: 1,
tutor: 2,
parent: 3,
admin: 4
deviceType: android: 1,
iOS: 2,
web: 3,
other: 4
"
,
"operationId": "loginUser",
"produces": [
"application/json"
],
"parameters": [
{
"name": "usbodyer",
"in": "body",
"description": "The user ( Student, Tutor) for login",
"required": true,
"schema": {
"$ref": "#/definitions/User"
}
}
],
"responses": {
"200": {
"code": 200,
"data": {
"_id": "5c251fa9c228ea5e85de25f1",
"email": "sagar.jethi007@gmail.com",
"user_type": 1,
"is_user_exists": true,
"authToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiNWMyNTFmYTljMjI4ZWE1ZTg1ZGUyNWYxIiwiZW1haWwiOiJzYWdhci5qZXRoaTAwN0BnbWFpbC5jb20iLCJ0eXBlIjoxLCJpYXQiOjE1NDU5OTgxNDUsImV4cCI6MTU0NjA4NDU0NX0.xRmLnVlOahLFGUBm9LRqqcL8PKk9Th3KKAlwm2mrdJM"
},
"status": "OK",
"message": "LoggedIn successfully!"
},
"headers": {
"X-Rate-Limit": {
"type": "integer",
"format": "int32",
"description": "calls per hour allowed by the user"
},
"X-Expires-After": {
"type": "string",
"format": "date-time",
"description": "date in UTC when token expires"
}
}
},
"400": {
"description": "Invalid username/password supplied"
}
}
},
"/public/v1/category": {
"get": {
"tags": [
"category"
],
"summary": "Catehory list ",
"description": "",
"operationId": "loUser",
"produces": [
"application/json"
],
"parameters": [
],
"responses": {
"200": {
"code": 200,
"data": [
{
"parent_category": null,
"is_active": true,
"_id": "5c25eaae3f8efc68351c0419",
"name": "Maths"
},
{
"parent_category": null,
"is_active": true,
"_id": "5c25eabb3f8efc68351c041a",
"name": "English"
}
],
"status": "OK",
"message": "Categories list."
},
"headers": {
"X-Rate-Limit": {
"type": "integer",
"format": "int32",
"description": "calls per hour allowed by the user"
},
"X-Expires-After": {
"type": "string",
"format": "date-time",
"description": "date in UTC when token expires"
}
}
},
"400":{
"description": "Invalid username/password supplied"
}
}
},
"/v1/category": {
"post": {
"tags": [
"category"
],
"summary": "category post",
"description": "",
"operationId": "loginUser",
"produces": [
"application/json"
],
"parameters": [
{
"name": "category",
"in": "body",
"description": "The category",
"required": true,
"schema": {
"$ref": "#/definitions/Category"
}
}
],
"responses": {
"200": {
"code": 200,
"data": {
"_id": "5c251fa9c228ea5e85de25f1",
"email": "sagar.jethi007@gmail.com",
"user_type": 1,
"is_user_exists": true,
"authToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiNWMyNTFmYTljMjI4ZWE1ZTg1ZGUyNWYxIiwiZW1haWwiOiJzYWdhci5qZXRoaTAwN0BnbWFpbC5jb20iLCJ0eXBlIjoxLCJpYXQiOjE1NDU5OTgxNDUsImV4cCI6MTU0NjA4NDU0NX0.xRmLnVlOahLFGUBm9LRqqcL8PKk9Th3KKAlwm2mrdJM"
},
"status": "OK",
"message": "LoggedIn successfully!"
},
"headers": {
"X-Rate-Limit": {
"type": "integer",
"format": "int32",
"description": "calls per hour allowed by the user"
},
"X-Expires-After": {
"type": "string",
"format": "date-time",
"description": "date in UTC when token expires"
}
}
},
"400": {
"description": "Invalid username/password supplied"
}
}
},
"/v1/question": {
"post": {
"tags": [
"question"
],
"summary": "Question post by student",
"description": "",
"operationId": "loginUser",
"produces": [
"application/json"
],
"parameters": [
{
"name": "question",
"in": "body",
"description": "The Question post",
"required": true,
"schema": {
"$ref": "#/definitions/Question"
}
},
{
"name": "authorization",
"in": "header",
"description": "The authorization token",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"code": 200,
"data": {
"_id": "5c251fa9c228ea5e85de25f1",
"email": "sagar.jethi007@gmail.com",
"user_type": 1,
"is_user_exists": true,
"authToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiNWMyNTFmYTljMjI4ZWE1ZTg1ZGUyNWYxIiwiZW1haWwiOiJzYWdhci5qZXRoaTAwN0BnbWFpbC5jb20iLCJ0eXBlIjoxLCJpYXQiOjE1NDU5OTgxNDUsImV4cCI6MTU0NjA4NDU0NX0.xRmLnVlOahLFGUBm9LRqqcL8PKk9Th3KKAlwm2mrdJM"
},
"status": "OK",
"message": "LoggedIn successfully!"
},
"headers": {
"X-Rate-Limit": {
"type": "integer",
"format": "int32",
"description": "calls per hour allowed by the user"
},
"X-Expires-After": {
"type": "string",
"format": "date-time",
"description": "date in UTC when token expires"
}
}
},
"400": {
"description": "Invalid username/password supplied"
}
},
"get": {
"tags": [
"question"
],
"summary": "Get question list",
"description": "",
"operationId": "getQuestionList",
"produces": [
"application/json"
],
"parameters": [
{
"name": "authorization",
"in": "header",
"description": "The authorization token",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"code": 200,
"data": [
{
"is_active": true,
"_id": "5c29e7824fb5b913227f3be0",
"title": "asdads adsds",
"description": "asadsadda adssad",
"category": "737364647361736164736164",
"student_id": "5c251fa9c228ea5e85de25f1",
"__v": 0
}
],
"status": "OK",
"message": "Question get suessfully"
},
"headers": {
"X-Rate-Limit": {
"type": "integer",
"format": "int32",
"description": "calls per hour allowed by the user"
},
"X-Expires-After": {
"type": "string",
"format": "date-time",
"description": "date in UTC when token expires"
}
}
},
"400": {
"description": "Invalid username/password supplied"
}
}
}
},
"securityDefinitions": {
"api_key": {
"type": "apiKey",
"name": "authorization",
"in": "header"
}
},
"definitions": {
"User": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"googleId": {
"type": "string"
},
"userType": {
"type": "string"
},
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"deviceType": {
"type": "string"
},
"deviceToken": {
"type": "string"
}
},
"xml": {
"name": "User"
}
},
"Question": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"category": {
"type": "string"
}
},
"xml": {
"name": "User"
}
},
"Category": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
},
"ApiResponse": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"type": {
"type": "string"
},
"message": {
"type": "string"
}
}
}
},
"externalDocs": {
"description": "Find out more about Swagger",
"url": "http://swagger.io"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment