Skip to content

Instantly share code, notes, and snippets.

@binhngoc17
Created April 2, 2015 02:03
Show Gist options
  • Save binhngoc17/1be95f94f77bc8e56b4a to your computer and use it in GitHub Desktop.
Save binhngoc17/1be95f94f77bc8e56b4a to your computer and use it in GitHub Desktop.
Schema Definition
{
"swagger": "2.0",
"info": {
"title": "FixFit API",
"description": "Promote healthy lifestyle in a fun way!",
"version": "1.0.0"
},
"host": "api.fixfit.com",
"schemes": [
"https"
],
"basePath": "/v1",
"produces": [
"application/json"
],
"paths": {
"/contacts": {
"get": {
"summary": "User Types",
"description": "The Contacts endpoint returns all friends of the user.\n",
"tags": [
"Friends"
],
"responses": {
"200": {
"description": "An array of Profiles",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Profile"
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/cards": {
"get": {
"summary": "Retrieve cards for an user",
"description": "Get the cards sorted by relevancy for the user\n",
"parameters": [
{
"name": "user_id",
"in": "query",
"description": "The user ID that the cards belong.",
"required": true,
"type": "number",
"format": "double"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "An array of price estimates by product",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Card"
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"post": {
"summary": "Card creation",
"description": "Create the (Activity) card.\n",
"tags": [
"Cards"
],
"parameters": [
{
"name": "creator",
"schema": {
"$ref": "#/definitions/Profile"
},
"in": "body",
"description": "Creator of the card"
},
{
"name": "instructor",
"schema": {
"$ref": "#/definitions/Profile"
},
"in": "body",
"description": "Instructor of the card"
},
{
"description": "Creator of the card",
"in": "body",
"type": "string"
},
{
"name": "location",
"schema": {
"$ref": "#/definitions/Location"
},
"in": "body",
"description": "Creator of the card"
},
{
"name": "picture",
"in": "body",
"description": "Creator of the card",
"type": "string",
"format": "double"
}
],
"responses": {
"201": {
"description": "Information about the object created",
"schema": {
"$ref": "#/definitions/Card"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/me": {
"get": {
"summary": "User Profile",
"description": "The User Profile endpoint returns information about the Uber user that has authorized with the application.",
"tags": [
"User"
],
"responses": {
"200": {
"description": "Profile information for a user",
"schema": {
"$ref": "#/definitions/Profile"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/history": {
"get": {
"summary": "User Activity",
"description": "The User Activity endpoint returns data about a user's lifetime activity with Uber. The response will include pickup locations and times, dropoff locations and times, the distance of past requests, and information about which products were requested.<br><br>The history array in the response will have a maximum length based on the limit parameter. The response value count may exceed limit, therefore subsequent API requests may be necessary.",
"parameters": [
{
"name": "offset",
"in": "query",
"type": "integer",
"format": "int32",
"description": "Offset the list of returned results by this amount. Default is zero."
},
{
"name": "limit",
"in": "query",
"type": "integer",
"format": "int32",
"description": "Number of items to retrieve. Default is 5, maximum is 100."
}
],
"tags": [
"User"
],
"responses": {
"200": {
"description": "History information for the given user",
"schema": {
"$ref": "#/definitions/Activities"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Profile": {
"properties": {
"first_name": {
"type": "string",
"description": "First name of the Uber user."
},
"last_name": {
"type": "string",
"description": "Last name of the Uber user."
},
"email": {
"type": "string",
"description": "Email address of the Uber user."
},
"picture": {
"type": "string",
"description": "Image URL of the Uber user."
},
"promo_code": {
"type": "string",
"description": "Promo code of the Uber user."
}
}
},
"Error": {
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"fields": {
"type": "string"
}
}
},
"Location": {
"properties": {
"latitude": {
"type": "number",
"format": "double",
"description": "Latitude component of location."
},
"longitude": {
"type": "number",
"format": "double",
"description": "Longitude component of location."
}
}
},
"Card": {
"properties": {
"creator": {
"$ref": "#/definitions/Profile",
"description": "Information about the creator"
},
"instructor": {
"$ref": "#/definitions/Profile",
"description": "Information about the instructor"
},
"location": {
"$ref": "#/definitions/Location",
"description": "Email address of the Uber user"
},
"description": {
"type": "string",
"description": "String decription of the activity (No more than 300 characters)"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment