2019-06-24 17:36:42 -08:00
|
|
|
{
|
|
|
|
"swagger": "2.0",
|
|
|
|
"info": {
|
|
|
|
"description": "This is a sample server celler server.",
|
|
|
|
"title": "SaaS Example API",
|
2019-06-25 02:40:29 -08:00
|
|
|
"termsOfService": "http://example.com/terms",
|
2019-06-24 17:36:42 -08:00
|
|
|
"contact": {
|
|
|
|
"name": "API Support",
|
2019-06-25 02:40:29 -08:00
|
|
|
"url": "http://example.com/support",
|
2019-06-24 17:36:42 -08:00
|
|
|
"email": "support@geeksinthewoods.com"
|
|
|
|
},
|
|
|
|
"license": {
|
|
|
|
"name": "Apache 2.0",
|
|
|
|
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
|
|
|
|
},
|
|
|
|
"version": "{{.Version}}"
|
|
|
|
},
|
|
|
|
"host": "{{.Host}}",
|
|
|
|
"basePath": "{{.BasePath}}",
|
2019-06-24 22:41:21 -08:00
|
|
|
"paths": {
|
|
|
|
"/accounts/{id}": {
|
|
|
|
"get": {
|
2019-06-25 06:25:55 -08:00
|
|
|
"security": [
|
|
|
|
{
|
|
|
|
"OAuth2Password": []
|
|
|
|
}
|
|
|
|
],
|
2019-06-24 22:41:21 -08:00
|
|
|
"description": "get string by ID",
|
|
|
|
"consumes": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"produces": [
|
|
|
|
"application/json"
|
|
|
|
],
|
2019-06-25 02:40:29 -08:00
|
|
|
"tags": [
|
|
|
|
"account"
|
|
|
|
],
|
2019-06-24 22:41:21 -08:00
|
|
|
"summary": "Read returns the specified account from the system.",
|
|
|
|
"parameters": [
|
|
|
|
{
|
2019-06-25 06:25:55 -08:00
|
|
|
"type": "string",
|
2019-06-24 22:41:21 -08:00
|
|
|
"description": "Account ID",
|
|
|
|
"name": "id",
|
|
|
|
"in": "path",
|
|
|
|
"required": true
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "OK",
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"$ref": "#/definitions/account.Account"
|
|
|
|
},
|
|
|
|
"headers": {
|
|
|
|
"Token": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "qwerty"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Bad Request",
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"$ref": "#/definitions/web.Error"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"403": {
|
|
|
|
"description": "Forbidden",
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"$ref": "#/definitions/web.Error"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"404": {
|
|
|
|
"description": "Not Found",
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"$ref": "#/definitions/web.Error"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-06-25 02:40:29 -08:00
|
|
|
},
|
2019-06-25 06:25:55 -08:00
|
|
|
"/oauth/token": {
|
|
|
|
"post": {
|
|
|
|
"security": [
|
|
|
|
{
|
|
|
|
"BasicAuth": []
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"description": "Token generates an oauth2 accessToken using Basic Auth with a user's email and password.",
|
|
|
|
"consumes": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"produces": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"tags": [
|
|
|
|
"user"
|
|
|
|
],
|
|
|
|
"summary": "Token handles a request to authenticate a user.",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "OK",
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"$ref": "#/definitions/user.Token"
|
|
|
|
},
|
|
|
|
"headers": {
|
|
|
|
"Token": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "qwerty"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Bad Request",
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"$ref": "#/definitions/web.Error"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"403": {
|
|
|
|
"description": "Forbidden",
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"$ref": "#/definitions/web.Error"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"404": {
|
|
|
|
"description": "Not Found",
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"$ref": "#/definitions/web.Error"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2019-06-25 02:40:29 -08:00
|
|
|
"/signup": {
|
|
|
|
"post": {
|
|
|
|
"description": "Signup creates a new account and user in the system.",
|
|
|
|
"consumes": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"produces": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"tags": [
|
|
|
|
"signup"
|
|
|
|
],
|
|
|
|
"summary": "Signup handles new account creation.",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"description": "Signup details",
|
|
|
|
"name": "data",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"$ref": "#/definitions/signup.SignupRequest"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "OK",
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"$ref": "#/definitions/signup.SignupResponse"
|
|
|
|
},
|
|
|
|
"headers": {
|
|
|
|
"Token": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "qwerty"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Bad Request",
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"$ref": "#/definitions/web.Error"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"403": {
|
|
|
|
"description": "Forbidden",
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"$ref": "#/definitions/web.Error"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/users/{id}": {
|
|
|
|
"get": {
|
2019-06-25 06:25:55 -08:00
|
|
|
"security": [
|
|
|
|
{
|
|
|
|
"OAuth2Password": []
|
|
|
|
}
|
|
|
|
],
|
2019-06-25 02:40:29 -08:00
|
|
|
"description": "get string by ID",
|
|
|
|
"consumes": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"produces": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"tags": [
|
|
|
|
"user"
|
|
|
|
],
|
|
|
|
"summary": "Read returns the specified user from the system.",
|
|
|
|
"parameters": [
|
|
|
|
{
|
2019-06-25 06:25:55 -08:00
|
|
|
"type": "string",
|
2019-06-25 02:40:29 -08:00
|
|
|
"description": "User ID",
|
|
|
|
"name": "id",
|
|
|
|
"in": "path",
|
|
|
|
"required": true
|
2019-06-25 06:25:55 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Authentication header",
|
|
|
|
"name": "Authorization",
|
|
|
|
"in": "header",
|
|
|
|
"required": true
|
2019-06-25 02:40:29 -08:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "OK",
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"$ref": "#/definitions/user.User"
|
|
|
|
},
|
|
|
|
"headers": {
|
|
|
|
"Token": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "qwerty"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Bad Request",
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"$ref": "#/definitions/web.Error"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"403": {
|
|
|
|
"description": "Forbidden",
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"$ref": "#/definitions/web.Error"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"404": {
|
|
|
|
"description": "Not Found",
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"$ref": "#/definitions/web.Error"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-06-24 22:41:21 -08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"definitions": {
|
|
|
|
"account.Account": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"address1": {
|
2019-06-25 02:40:29 -08:00
|
|
|
"type": "string",
|
|
|
|
"example": "221 Tatitlek Ave"
|
2019-06-24 22:41:21 -08:00
|
|
|
},
|
|
|
|
"address2": {
|
2019-06-25 02:40:29 -08:00
|
|
|
"type": "string",
|
|
|
|
"example": "Box #1832"
|
2019-06-24 22:41:21 -08:00
|
|
|
},
|
|
|
|
"archived_at": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"billing_user_id": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"city": {
|
2019-06-25 02:40:29 -08:00
|
|
|
"type": "string",
|
|
|
|
"example": "Valdez"
|
2019-06-24 22:41:21 -08:00
|
|
|
},
|
|
|
|
"country": {
|
2019-06-25 02:40:29 -08:00
|
|
|
"type": "string",
|
|
|
|
"example": "USA"
|
2019-06-24 22:41:21 -08:00
|
|
|
},
|
|
|
|
"created_at": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"id": {
|
2019-06-25 02:40:29 -08:00
|
|
|
"type": "string",
|
|
|
|
"example": "c4653bf9-5978-48b7-89c5-95704aebb7e2"
|
2019-06-24 22:41:21 -08:00
|
|
|
},
|
|
|
|
"name": {
|
2019-06-25 02:40:29 -08:00
|
|
|
"type": "string",
|
|
|
|
"example": "Company Name"
|
2019-06-24 22:41:21 -08:00
|
|
|
},
|
|
|
|
"region": {
|
2019-06-25 02:40:29 -08:00
|
|
|
"type": "string",
|
|
|
|
"example": "AK"
|
2019-06-24 22:41:21 -08:00
|
|
|
},
|
|
|
|
"signup_user_id": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"status": {
|
2019-06-25 02:40:29 -08:00
|
|
|
"type": "string",
|
|
|
|
"example": "active"
|
2019-06-24 22:41:21 -08:00
|
|
|
},
|
|
|
|
"timezone": {
|
2019-06-25 02:40:29 -08:00
|
|
|
"type": "string",
|
|
|
|
"example": "America/Anchorage"
|
2019-06-24 22:41:21 -08:00
|
|
|
},
|
|
|
|
"updated_at": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"zipcode": {
|
2019-06-25 02:40:29 -08:00
|
|
|
"type": "string",
|
|
|
|
"example": "99686"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"signup.SignupRequest": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"account": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"name",
|
|
|
|
"address1",
|
|
|
|
"city",
|
|
|
|
"region",
|
|
|
|
"country",
|
|
|
|
"zipcode"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"address1": {
|
|
|
|
"type": "string",
|
|
|
|
"example": "221 Tatitlek Ave"
|
|
|
|
},
|
|
|
|
"address2": {
|
|
|
|
"type": "string",
|
|
|
|
"example": "Box #1832"
|
|
|
|
},
|
|
|
|
"city": {
|
|
|
|
"type": "string",
|
|
|
|
"example": "Valdez"
|
|
|
|
},
|
|
|
|
"country": {
|
|
|
|
"type": "string",
|
|
|
|
"example": "USA"
|
|
|
|
},
|
|
|
|
"name": {
|
|
|
|
"type": "string",
|
|
|
|
"example": "Company {RANDOM_UUID}"
|
|
|
|
},
|
|
|
|
"region": {
|
|
|
|
"type": "string",
|
|
|
|
"example": "AK"
|
|
|
|
},
|
|
|
|
"timezone": {
|
|
|
|
"type": "string",
|
|
|
|
"example": "America/Anchorage"
|
|
|
|
},
|
|
|
|
"zipcode": {
|
|
|
|
"type": "string",
|
|
|
|
"example": "99686"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"user": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"name",
|
|
|
|
"email",
|
|
|
|
"password"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"email": {
|
|
|
|
"type": "string",
|
|
|
|
"example": "{RANDOM_EMAIL}"
|
|
|
|
},
|
|
|
|
"name": {
|
|
|
|
"type": "string",
|
|
|
|
"example": "Gabi May"
|
|
|
|
},
|
|
|
|
"password": {
|
|
|
|
"type": "string",
|
|
|
|
"example": "SecretString"
|
|
|
|
},
|
|
|
|
"password_confirm": {
|
|
|
|
"type": "string",
|
|
|
|
"example": "SecretString"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"signup.SignupResponse": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"account": {
|
|
|
|
"type": "object",
|
|
|
|
"$ref": "#/definitions/account.Account"
|
|
|
|
},
|
|
|
|
"user": {
|
|
|
|
"type": "object",
|
|
|
|
"$ref": "#/definitions/user.User"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2019-06-25 06:25:55 -08:00
|
|
|
"user.Token": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"access_token": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"expiry": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"token_type": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2019-06-25 02:40:29 -08:00
|
|
|
"user.User": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"name"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"archived_at": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"created_at": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"email": {
|
|
|
|
"type": "string",
|
|
|
|
"example": "gabi@geeksinthewoods.com"
|
|
|
|
},
|
|
|
|
"id": {
|
|
|
|
"type": "string",
|
|
|
|
"example": "d69bdef7-173f-4d29-b52c-3edc60baf6a2"
|
|
|
|
},
|
|
|
|
"name": {
|
|
|
|
"type": "string",
|
|
|
|
"example": "Gabi May"
|
|
|
|
},
|
|
|
|
"timezone": {
|
|
|
|
"type": "string",
|
|
|
|
"example": "America/Anchorage"
|
|
|
|
},
|
|
|
|
"updated_at": {
|
2019-06-24 22:41:21 -08:00
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
2019-06-24 17:36:42 -08:00
|
|
|
},
|
2019-06-24 22:41:21 -08:00
|
|
|
"web.Error": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"err": {
|
|
|
|
"type": "error"
|
|
|
|
},
|
|
|
|
"fields": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "FieldError"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"status": {
|
|
|
|
"type": "integer"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"securityDefinitions": {
|
2019-06-25 06:25:55 -08:00
|
|
|
"BasicAuth": {
|
|
|
|
"type": "basic"
|
|
|
|
},
|
2019-06-24 17:36:42 -08:00
|
|
|
"OAuth2Password": {
|
|
|
|
"type": "oauth2",
|
|
|
|
"flow": "password",
|
2019-06-25 06:25:55 -08:00
|
|
|
"tokenUrl": "/v1/oauth/token",
|
|
|
|
"scopes": {
|
|
|
|
"admin": " Grants read and write access to administrative information",
|
|
|
|
"read": " Grants read access",
|
|
|
|
"write": " Grants write access"
|
|
|
|
}
|
2019-06-24 17:36:42 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|