{ "openapi": "3.0.0", "info": { "title": "Porter API", "version": "1.0.0", "description": "API for managing Porter deployments. For testing on the command line, you may use curl with your API key sent as the http basic auth user name followed by a colon character, like this:\n\ncurl -X GET https://portersetup.com/api/locations -u \"gB7jIORVymAfX7MigBXGVi:\"", "termsOfService": "http://tenonedesign.com/about", "contact": { "email": "devs@tenonedesign.com" }, "x-logo": { "url": "" } }, "servers": [ { "url": "https://portersetup.com/api" } ], "paths": { "/locations": { "get": { "tags": [ "locations" ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Location" } } } }, "description": "Success" }, "401": { "$ref": "#/components/responses/error401" }, "422": { "$ref": "#/components/responses/error422" } }, "operationId": "getLocations", "summary": "Array of all locations for user", "description": "" }, "post": { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Location" }, "example": "" } }, "required": true }, "tags": [ "locations" ], "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Location" } } }, "description": "Created" }, "401": { "$ref": "#/components/responses/error401" }, "422": { "$ref": "#/components/responses/error422" } }, "operationId": "createLocation", "summary": "Create a location" } }, "/locations/{locationId}": { "get": { "tags": [ "locations" ], "parameters": [ { "name": "locationId", "description": "ID of loction to return", "schema": { "type": "string" }, "in": "path", "required": true } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Location" } } }, "description": "Success" }, "401": { "$ref": "#/components/responses/error401" }, "422": { "$ref": "#/components/responses/error422" } }, "operationId": "getLocationById", "summary": "Get a location", "description": "" }, "delete": { "tags": [ "locations" ], "parameters": [ { "example": "", "name": "locationId", "description": "", "schema": { "format": "int64", "type": "integer", "example": "" }, "in": "path", "required": true, "x-last-modified": 1594264934439 } ], "responses": { "200": { "description": "Null content" }, "401": { "$ref": "#/components/responses/error401" }, "422": { "$ref": "#/components/responses/error422" } }, "operationId": "deleteLocation", "summary": "Delete a location", "description": "" }, "patch": { "tags": [ "locations" ], "parameters": [ { "name": "locationId", "description": "", "schema": { "type": "string" }, "in": "path", "required": true } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Location" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Location" } } }, "description": "Success" }, "401": { "$ref": "#/components/responses/error401" }, "422": { "$ref": "#/components/responses/error422" } }, "operationId": "updateLocation", "summary": "Update a location", "description": "" } }, "/porters": { "summary": "Get Porters", "get": { "tags": [ "porters" ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Porter" } } } }, "description": "Success" }, "401": { "$ref": "#/components/responses/error401" }, "422": { "$ref": "#/components/responses/error422" } }, "operationId": "getPorters", "summary": "Get all Porters in account", "description": "" }, "x-last-modified": 1594263278873 }, "/porters/{porterId}": { "summary": "Manage a Porter", "get": { "tags": [ "porters" ], "parameters": [ { "name": "porterId", "description": "", "schema": { "type": "string" }, "in": "path", "required": true } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Porter" } } }, "description": "Success" }, "401": { "$ref": "#/components/responses/error401" }, "422": { "$ref": "#/components/responses/error422" } }, "operationId": "getPorterById", "summary": "Get Porter", "description": "" }, "delete": { "tags": [ "porters" ], "parameters": [ { "name": "porterId", "description": "", "schema": { "type": "string" }, "in": "path", "required": true } ], "responses": { "200": { "description": "Null content" }, "401": { "$ref": "#/components/responses/error401" }, "422": { "$ref": "#/components/responses/error422" } }, "operationId": "deletePorter", "summary": "Delete Porter", "description": "" }, "patch": { "tags": [ "porters" ], "parameters": [ { "name": "porterId", "description": "", "schema": { "type": "string" }, "in": "path", "required": true } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Porter" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Porter" } } }, "description": "Success" }, "401": { "$ref": "#/components/responses/error401" }, "422": { "$ref": "#/components/responses/error422" } }, "operationId": "patchPorter", "summary": "Update a Porter", "description": "" }, "x-last-modified": 1594263303272 } }, "components": { "schemas": { "Porter": { "type": "object", "properties": { "id": { "type": "string", "readOnly": true }, "short_id": { "type": "string", "readOnly": true }, "name": { "type": "string" }, "location": { "type": "string", "readOnly": true }, "phv": { "format": "int64", "type": "integer", "readOnly": true }, "pmi": { "format": "int64", "type": "integer", "readOnly": true }, "interaction_count": { "format": "int64", "type": "integer", "readOnly": true }, "interacted_at": { "format": "int64", "type": "integer", "readOnly": true }, "created_at": { "format": "int64", "type": "integer", "readOnly": true }, "updated_at": { "format": "int64", "type": "integer", "readOnly": true } } }, "Location": { "type": "object", "properties": { "id": { "type": "string", "readOnly": true }, "name": { "type": "string" }, "type": { "format": "int64", "type": "integer" }, "configuration": { "$ref": "#/components/schemas/Configuration" }, "display_duration": { "format": "int64", "type": "integer" }, "plaintext_credential": { "$ref": "#/components/schemas/Credential" }, "account_password": { "type": "string", "writeOnly": true, "description": "The account_password enables our server to encrypt and store a plaintext_credential on your behalf. It is offered as a convenience when encryption is not possible on the client side." }, "porters": { "type": "array", "items": { "$ref": "#/components/schemas/Porter" }, "readOnly": true }, "collected_data": { "type": "object", "properties": { "emails": { "type": "array", "items": { "$ref": "#/components/schemas/Email" } } }, "readOnly": true }, "created_at": { "format": "int64", "type": "integer", "readOnly": true }, "updated_at": { "format": "int64", "type": "integer", "readOnly": true } } }, "Email": { "type": "object", "properties": { "email": { "type": "string" }, "porter": { "type": "string" }, "porter_name": { "type": "string" }, "created_at": { "type": "integer", "format": "int64" } } }, "Header": { "type": "object", "properties": { "title": { "type": "string" }, "subtitle": { "type": "string" }, "image": { "type": "object", "properties": { "url": { "type": "string" }, "mime_type": { "type": "string" } } } } }, "Credential": { "type": "object", "writeOnly": true, "description": "Send only when encryption of credential is not possible on the client side. If a new credential is the only change to a location, the only other required property is account_password.", "properties": { "ssid": { "type": "string" }, "key": { "type": "string" }, "hidden": { "type": "boolean" }, "security": { "type": "string", "enum": ["wpa2", "wep", "none"] }, "captive_portal_username": { "type": "string" }, "captive_portal_password": { "type": "string" } } }, "Wifi": { "type": "object", "properties": { "credential": { "type": "string" }, "fragment": { "type": "string" }, "password_visible": { "type": "boolean" }, "authorization": { "type": "object", "properties": { "authentication": { "type": "object", "properties": { "providers": { "type": "array", "items": { "type": "string", "enum": ["email", "facebook", "google"] } }, "title": { "type": "string" }, "subtitle": { "type": "string" }, "show_privacy_policy": { "type": "boolean" } } }, "age_policy": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "minimum_age": { "type": "integer", "minimum": 1 }, "default_checked": { "type": "boolean" }, "under_minimum_age_action": { "type": "string", "enum": ["allow_without_collection", "deny_access"] }, "label": { "type": "string" }, "description": { "type": "string" } } }, "share": { "type": "object", "properties": { "providers": { "type": "array", "items": { "type": "string", "enum": ["email", "facebook", "google"] } }, "title": { "type": "string" }, "subtitle": { "type": "string" }, "content_url": { "type": "string" }, "content_text": { "type": "string" }, "content_hashtag": { "type": "string" } } }, "terms": { "type": "object", "properties": { "show_terms": { "type": "boolean" }, "require_terms": { "type": "boolean" }, "terms": { "type": "string" } } } } }, "display_duration": { "type": "number" }, "use_oob_keys": { "type": "boolean" }, "key_derivation_info": { "type": "string" } } }, "Configuration": { "type": "object", "properties": { "theme": { "type": "string", "enum": ["standard", "crosby", "vibrant", "beachcomber", "grunge"] }, "background_color": { "type": "string" }, "foreground_color": { "type": "string" }, "text_color": { "type": "string" }, "accent_color": { "type": "string" }, "background_image_url": { "type": "string" }, "splash_type": { "type": "string", "enum": ["none", "bubbles"] }, "splash_title": { "type": "string" }, "splash_subtitle": { "type": "string" }, "elevation": { "type": "number" }, "qr_theme": { "type": "string" }, "qr_title": { "type": "string" }, "qr_subtitle": { "type": "string" }, "qr_message": { "type": "string" }, "help_string": { "type": "string" }, "qr_show_link": { "type": "boolean" }, "header": { "$ref": "#/components/schemas/Header" }, "wifi": { "$ref": "#/components/schemas/Wifi" } } } }, "responses": { "error422": { "content": { "application/json": { "schema": { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "properties": { "field": { "type": "string" }, "message": { "type": "string" } } } } } } } }, "description": "Unprocessable Entity" }, "error401": { "content": { "application/json": { "schema": { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "properties": { "field": { "type": "string" }, "message": { "type": "string" } } } } } } } }, "description": "Authentication Error", "x-last-modified": 1594263728216 } }, "securitySchemes": { "basicAuth": { "type": "http", "scheme": "basic", "description": "Use basicAuth for testing from the command line. Send your API key as the user name followed by a colon character, like this:\n\ncurl -X GET https://portersetup.com/api/locations -u gB7jIORVymAfX7MigBXGVi:" }, "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "API key string" } }, "parameters": {} }, "security": [ { "bearerAuth": [] }, { "basicAuth": [] } ], "tags": [ { "name": "locations", "description": "A location is a group of Porter devices that share the same settings.", "externalDocs": { "description": "Find out more", "url": "https://tenonedesign.com/hospitality" } }, { "name": "porters", "description": "Individual Porter devices" } ], "externalDocs": { "description": "More information about Porter Hospitality", "url": "https://tenonedesign.com/hospitality" } }