Last active
June 27, 2016 11:52
-
-
Save ivanpepelko/a556914d411aca828923f3fe5a85bc18 to your computer and use it in GitHub Desktop.
antispam swagger
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
{ | |
"swagger": "2.0", | |
"info": { | |
"title": "Flowly Traffic Engine API", | |
"description": "Flowly Traffic Engine API for fetching flowly user info, api keys, etc etc etc....\n", | |
"version": "0.0.1", | |
"contact": { | |
"name": "Flowly dev team", | |
"url": "https://www.flowly.com", | |
"email": "development@vastools.com" | |
} | |
}, | |
"host": "api-staging.flowly.com", | |
"schemes": [ | |
"https" | |
], | |
"securityDefinitions": { | |
"basicAuth": { | |
"type": "basic", | |
"description": "HTTP Basic Authentication. Works over `HTTPS`. Use provided Flowly username and password" | |
} | |
}, | |
"basePath": "/trafficengine/v1", | |
"consumes": [ | |
"application/json" | |
], | |
"produces": [ | |
"application/json" | |
], | |
"paths": { | |
"/": { | |
"get": { | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"summary": "Authentication check", | |
"description": "Authentication check\n", | |
"responses": { | |
"200": { | |
"description": "Will send `Authenticated` if authentication is succesful, otherwise it will send `Unauthorized`" | |
} | |
}, | |
"tags": [ | |
"Authentication" | |
] | |
} | |
}, | |
"/user": { | |
"get": { | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"summary": "Get all user properties", | |
"description": "Get flowly user account for authenticated user\n", | |
"operationId": "getUser", | |
"responses": { | |
"200": { | |
"description": "successful operation", | |
"schema": { | |
"$ref": "#/definitions/User" | |
}, | |
"examples": { | |
"application/json": { | |
"uuid": "fa6278cb-0823-4090-881d-073f0a033ad9", | |
"username": "test.user@gmail.com", | |
"firstname": "John", | |
"lastname": "Malkovich", | |
"deleted": -1 | |
} | |
} | |
}, | |
"404": { | |
"description": "User not found" | |
} | |
}, | |
"tags": [ | |
"User" | |
] | |
} | |
}, | |
"/user/apikey": { | |
"get": { | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"summary": "Get Api KEYS for user", | |
"description": "Get all api keyt\n", | |
"operationId": "getUserApiKeys", | |
"responses": { | |
"200": { | |
"description": "Array of apikeys", | |
"schema": { | |
"type": "array", | |
"items": { | |
"$ref": "#/definitions/Apikey" | |
} | |
}, | |
"examples": { | |
"application/json": [ | |
{ | |
"uuid": "fa6278cb-0823-4090-881d-073f0a033ad9", | |
"access": "asdasdadffdgrtgrtgr", | |
"owner": "a059f100-c971-4957-8725-44434117ac0b", | |
"secret": "sasdoijgnvueorgberognerovne" | |
} | |
] | |
} | |
} | |
}, | |
"tags": [ | |
"User" | |
] | |
} | |
}, | |
"/antispam/msisdns/{uuid}": { | |
"get": { | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"summary": "Get antispam list", | |
"description": "Get antispam list\n", | |
"operationId": "getAntispamListMSISDNS", | |
"tags": [ | |
"Antispam" | |
], | |
"parameters": [ | |
{ | |
"name": "uuid", | |
"in": "path", | |
"required": true, | |
"type": "string", | |
"description": "Antispam list UUID" | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "Array of Antispam List MSISDNS", | |
"schema": { | |
"type": "array", | |
"items": { | |
"$ref": "#/definitions/AntispamMSISDNS" | |
} | |
} | |
}, | |
"default": { | |
"description": "Error response", | |
"schema": { | |
"$ref": "#/definitions/ErrorResponse" | |
} | |
} | |
} | |
} | |
}, | |
"/antispam": { | |
"get": { | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"summary": "Get antispam lists", | |
"description": "Get all antispam lists\n", | |
"operationId": "getAntispamList", | |
"tags": [ | |
"Antispam" | |
], | |
"responses": { | |
"200": { | |
"description": "Array of AntispamList objects", | |
"schema": { | |
"type": "array", | |
"items": { | |
"$ref": "#/definitions/AntispamList" | |
} | |
} | |
}, | |
"default": { | |
"description": "Error response", | |
"schema": { | |
"$ref": "#/definitions/ErrorResponse" | |
} | |
} | |
} | |
}, | |
"post": { | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"summary": "Add MSISDN to antispam list", | |
"description": "Add MSISDN to antispam list\n", | |
"operationId": "addAntispamMSISDN", | |
"tags": [ | |
"Antispam" | |
], | |
"parameters": [ | |
{ | |
"name": "parameters", | |
"in": "body", | |
"schema": { | |
"type": "object", | |
"required": [ | |
"uuid", | |
"msisdns", | |
"comment" | |
], | |
"properties": { | |
"uuid": { | |
"type": "string", | |
"description": "Antispam list UUID" | |
}, | |
"msisdns": { | |
"type": "array", | |
"description": "MSISDNs to add to list", | |
"items": { | |
"type": "string" | |
} | |
}, | |
"comment": { | |
"type": "string", | |
"description": "Comment" | |
} | |
} | |
} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "Success response", | |
"schema": { | |
"$ref": "#/definitions/SuccessResponse" | |
} | |
}, | |
"default": { | |
"description": "Error response", | |
"schema": { | |
"$ref": "#/definitions/ErrorResponse" | |
} | |
} | |
} | |
}, | |
"delete": { | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"summary": "Delete MSISDN from antispam list", | |
"description": "Delete MSISDN from antispam list\n", | |
"operationId": "deleteAntispamMSISDN", | |
"tags": [ | |
"Antispam" | |
], | |
"parameters": [ | |
{ | |
"name": "parameters", | |
"in": "body", | |
"schema": { | |
"type": "object", | |
"required": [ | |
"uuid", | |
"msisdns" | |
], | |
"properties": { | |
"uuid": { | |
"type": "string", | |
"description": "Antispam list UUID" | |
}, | |
"msisdns": { | |
"type": "array", | |
"description": "MSISDNs to delete from list", | |
"items": { | |
"type": "string" | |
} | |
} | |
} | |
} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "Success response", | |
"schema": { | |
"$ref": "#/definitions/SuccessResponse" | |
} | |
}, | |
"default": { | |
"description": "Error response", | |
"schema": { | |
"$ref": "#/definitions/ErrorResponse" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"definitions": { | |
"SuccessResponse": { | |
"type": "object", | |
"description": "Empty body is returned on success" | |
}, | |
"ErrorResponse": { | |
"type": "object", | |
"description": "Error response", | |
"properties": { | |
"code": { | |
"type": "string", | |
"description": "Error type" | |
}, | |
"message": { | |
"type": "string", | |
"description": "Error message" | |
} | |
} | |
}, | |
"User": { | |
"type": "object", | |
"properties": { | |
"uuid": { | |
"type": "string", | |
"format": "uuid", | |
"description": "User UUID" | |
}, | |
"username": { | |
"type": "string", | |
"description": "User username" | |
}, | |
"firstname": { | |
"type": "string", | |
"description": "User first name" | |
}, | |
"lastname": { | |
"type": "string", | |
"description": "User lastname" | |
}, | |
"deleted": { | |
"type": "integer", | |
"description": "Timestamp when user was deleted. If -1 then user is not deleted" | |
} | |
} | |
}, | |
"Apikey": { | |
"type": "object", | |
"properties": { | |
"uuid": { | |
"type": "string", | |
"format": "uuid", | |
"description": "Apikey UUID" | |
}, | |
"access": { | |
"type": "string", | |
"description": "Access key" | |
}, | |
"owner": { | |
"type": "string", | |
"format": "uuid", | |
"description": "Owner uuid" | |
}, | |
"secret": { | |
"type": "string", | |
"description": "Secret key" | |
} | |
} | |
}, | |
"AntispamList": { | |
"type": "object", | |
"properties": { | |
"name": { | |
"type": "string", | |
"description": "Antispam list name" | |
}, | |
"uuid": { | |
"type": "string", | |
"format": "uuid", | |
"description": "Antispam list UUID" | |
}, | |
"count": { | |
"type": "integer", | |
"description": "Count of MSISDNS in list" | |
} | |
} | |
}, | |
"AntispamMSISDNS": { | |
"type": "object", | |
"properties": { | |
"added": { | |
"type": "string", | |
"description": "Unix Timestamp" | |
}, | |
"comment": { | |
"type": "string", | |
"description": "Comment" | |
}, | |
"source": { | |
"type": "string", | |
"description": "From where was MSISDN added" | |
}, | |
"mccmnc": { | |
"type": "string", | |
"description": "mccmnc" | |
}, | |
"operatorName": { | |
"type": "string", | |
"description": "Operator Name" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment