{ "swagger": "2.0", "info": { "description": "Our HTTP [REST API](https:\/\/en.wikipedia.org\/wiki\/Representational_state_transfer) allows you to manage vital details of your account and services in client portal. [JSON](http:\/\/www.json.org\/) is used for all API returns.\n\n## Authentication\n\n## Basic Authentication\n\n```bash\n# pass the correct header with each request (-u option)\ncurl 'https:\/\/my.brainoza.com\/api\/details' \\\n -u \"username:password\"\n```\n\n```php\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n 'base_uri' => 'https:\/\/my.brainoza.com\/api\/',\n 'auth' => ['username', 'password']\n]);\n\n$resp = $client->get('details');\n```\n\n> Make sure to replace `username` and `password` with your client area details.\n\nThis authentication method requires that you send your client area username (email address) and password with each request.\n\nAPI calls that require authentication expect a header in the form of `Authorization: Basic `, where credentials is the Base64 encoding of username and password joined by a single colon `:`.\n\nFor example: `Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==`\n\nYou can find more info on this authentication method here: [Basic HTTP Authentication](https:\/\/en.wikipedia.org\/wiki\/Basic_access_authentication)\n\n> You must replace `QWxhZGRpbjpvcGVuIHNlc2FtZQ==` with base64 encoded version of your access details.\n\n> For security, we highly recommend to issue API calls over [HTTPS](http:\/\/en.wikipedia.org\/wiki\/HTTP_Secure)\n\n", "version": "4.20260316", "title": "BRAINOZA OU User API" }, "host": "my.brainoza.com", "basePath": "\/api", "tags": [ { "name": "Clientarea" }, { "name": "Billing" }, { "name": "DNS" } ], "schemes": [ "https" ], "paths": { "\/login": { "post": { "tags": [ "Clientarea" ], "summary": "Login", "description": "Generate new authorization token", "operationId": "getToken", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "username": { "type": "string", "description": "Your acount email address ", "example": "user@example.com" }, "password": { "type": "string", "description": "Account password ", "example": "secret" } }, "example": { "username": "user@example.com", "password": "secret" } } } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRw(...)5lZ9T79ft9uwOkqRRmIBbtR51_w", "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIzMD(...)ChwIAb3zvxBu6kvULa2AwAt9U-I" } }, "schema": { "type": "object", "example": { "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRw(...)5lZ9T79ft9uwOkqRRmIBbtR51_w", "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIzMD(...)ChwIAb3zvxBu6kvULa2AwAt9U-I" } } } } } }, "\/logout": { "post": { "tags": [ "Clientarea" ], "summary": "Logout", "description": "Invalidate authorization token", "operationId": "dropToken", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "status": true } }, "schema": { "type": "object", "example": { "status": true } } } } } }, "\/details": { "get": { "tags": [ "Clientarea" ], "summary": "User Details", "description": "Return registration details for my account", "operationId": "getDetails", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "client": { "id": "26", "email": "api@example.com", "lastlogin": "2016-12-30 12:24:28", "ip": "172.100.2.1", "host": "hostname", "firstname": "Joe", "lastname": "Doe", "companyname": "", "address1": "Pretty View Lane", "address2": "3294", "city": "Santa Rosa", "state": "California", "postcode": "95401", "country": "US", "phonenumber": "+1.24123123" } } }, "schema": { "type": "object", "example": { "client": { "id": "26", "email": "api@example.com", "lastlogin": "2016-12-30 12:24:28", "ip": "172.100.2.1", "host": "hostname", "firstname": "Joe", "lastname": "Doe", "companyname": "", "address1": "Pretty View Lane", "address2": "3294", "city": "Santa Rosa", "state": "California", "postcode": "95401", "country": "US", "phonenumber": "+1.24123123" } } } } } }, "put": { "tags": [ "Clientarea" ], "summary": "Update User Details", "description": "Update registration details under my account", "operationId": "postDetails", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "email": { "type": "string", "description": "Email Address" }, "firstname": { "type": "string", "description": "First Name" }, "lastname": { "type": "string", "description": "Last Name" }, "companyname": { "type": "string", "description": "Organization" }, "address1": { "type": "string", "description": "Address 1" }, "address2": { "type": "string", "description": "Address 2" }, "city": { "type": "string", "description": "City" }, "state": { "type": "string", "description": "State" }, "postcode": { "type": "string", "description": "Post code" }, "country": { "type": "string", "description": "Country" }, "phonenumber": { "type": "string", "description": "Phone" }, "type": { "type": "string", "description": "Account Type", "enum": [ "Private", "Company" ] } } } } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "client": { "id": "26", "email": "api@example.com", "lastlogin": "2016-12-30 12:34:20", "ip": "172.100.2.1", "host": "hostname", "firstname": "Joe", "lastname": "Doe", "companyname": "", "address1": "Pretty View Lane", "address2": "3194", "city": "Santa Rosa", "state": "California", "postcode": "95401", "country": "US", "phonenumber": "+1.24123123" }, "info": [ "client_info_updated" ] } }, "schema": { "type": "object", "example": { "client": { "id": "26", "email": "api@example.com", "lastlogin": "2016-12-30 12:34:20", "ip": "172.100.2.1", "host": "hostname", "firstname": "Joe", "lastname": "Doe", "companyname": "", "address1": "Pretty View Lane", "address2": "3194", "city": "Santa Rosa", "state": "California", "postcode": "95401", "country": "US", "phonenumber": "+1.24123123" }, "info": [ "client_info_updated" ] } } } } } }, "\/balance": { "get": { "tags": [ "Billing" ], "summary": "Account balance", "description": "Get current account balance(unpaid invoices total), account credit", "operationId": "getBalance", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`" } } } }, "\/dns": { "get": { "tags": [ "DNS" ], "summary": "List DNS", "description": "Returns a list of all DNS", "operationId": "dns_get", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "service_ids": [ "10", "20" ], "zones": [ { "domain_id": "60", "name": "qwerty.com", "service_id": "10" }, { "domain_id": "61", "name": "bgg12ooble.com", "service_id": "20" } ] } }, "schema": { "type": "object", "example": { "service_ids": [ "10", "20" ], "zones": [ { "domain_id": "60", "name": "qwerty.com", "service_id": "10" }, { "domain_id": "61", "name": "bgg12ooble.com", "service_id": "20" } ] } } } } } }, "\/service\/{service_id}\/dns": { "post": { "tags": [ "DNS" ], "summary": "Add DNS Zone", "description": "Creates a new DNS zone", "operationId": "dns_add_zone", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "service_id": { "type": "integer", "description": "Service ID", "example": "service_idValue" }, "name": { "type": "string", "description": "Zone name ", "example": "testzone.com" } }, "example": { "service_id": "service_idValue", "name": "testzone.com" } } }, { "name": "service_id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "info": [ "Domain zone testzone.com was created successfully." ] } }, "schema": { "type": "object", "example": { "info": [ "Domain zone testzone.com was created successfully." ] } } } } }, "get": { "tags": [ "DNS" ], "summary": "List DNS for service", "description": "Returns a list of DNS zones under the service", "operationId": "dns_list_zones", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "service_id", "type": "integer", "in": "path", "description": "Service ID", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "error": [ "invalid method" ] } }, "schema": { "type": "object", "example": { "error": [ "invalid method" ] } } } } } }, "\/service\/{service_id}\/dns\/{zone_id}": { "get": { "tags": [ "DNS" ], "summary": "Get DNS details", "description": "Returns details of the DNS zone", "operationId": "dns_get_zone", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "service_id", "type": "integer", "in": "path", "description": "Service ID", "required": true }, { "name": "zone_id", "type": "integer", "in": "path", "description": "Zone ID", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "service_id": 10, "name": "qwerty.com", "records": [ { "id": "10", "name": "qwerty", "ttl": 1800, "priority": 0, "content": "127.0.0.1", "type": "A" }, { "id": "11", "name": "qwerty", "ttl": 1800, "priority": 0, "content": "ns1.qwerty.com", "type": "NS" } ] } }, "schema": { "type": "object", "example": { "service_id": 10, "name": "qwerty.com", "records": [ { "id": "10", "name": "qwerty", "ttl": 1800, "priority": 0, "content": "127.0.0.1", "type": "A" }, { "id": "11", "name": "qwerty", "ttl": 1800, "priority": 0, "content": "ns1.qwerty.com", "type": "NS" } ] } } } } }, "delete": { "tags": [ "DNS" ], "summary": "Remove DNS zone", "description": "Deletes the selected DNS zone", "operationId": "dns_delete_zone", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "service_id", "type": "integer", "in": "path", "description": "Service ID", "required": true }, { "name": "zone_id", "type": "integer", "in": "path", "description": "Zone ID", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "info": [ "Domain zone testzone.com was deleted successfully." ] } }, "schema": { "type": "object", "example": { "info": [ "Domain zone testzone.com was deleted successfully." ] } } } } } }, "\/service\/{service_id}\/dns\/{zone_id}\/records": { "post": { "tags": [ "DNS" ], "summary": "Add DNS Record", "description": "Creates a new record in the DNS zone", "operationId": "dns_add_record", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "service_id": { "type": "integer", "description": "Service ID", "example": "service_idValue" }, "zone_id": { "type": "integer", "description": "Zone ID", "example": "zone_idValue" }, "name": { "type": "string", "description": "Record name ", "example": "example.com" }, "ttl": { "type": "integer", "description": "Record ttl ", "example": 3600 }, "priority": { "type": "integer", "description": "Priority of the record ", "example": 10 }, "type": { "type": "string", "description": "Record type ", "example": "A" }, "content": { "type": "string", "description": "Contents of the record ", "example": "192.168.1.2" } }, "example": { "service_id": "service_idValue", "zone_id": "zone_idValue", "name": "example.com", "ttl": 3600, "priority": 10, "type": "A", "content": "192.168.1.2" } } }, { "name": "service_id", "type": "string", "in": "path", "required": true }, { "name": "zone_id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "record": { "name": "_sip._tcp.example.com", "type": "SRV", "ttl": "3600", "priority": "10", "content": [ 10, 5060, "vc01.example.com" ] }, "info": [ "dnsnewrecordadded", "SRV" ] } }, "schema": { "type": "object", "example": { "record": { "name": "_sip._tcp.example.com", "type": "SRV", "ttl": "3600", "priority": "10", "content": [ 10, 5060, "vc01.example.com" ] }, "info": [ "dnsnewrecordadded", "SRV" ] } } } } } }, "\/service\/{service_id}\/dns\/{zone_id}\/records\/{record_id}": { "put": { "tags": [ "DNS" ], "summary": "Edit DNS Record", "description": "Edits the selected DNS zone record", "operationId": "dns_edit_record", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "service_id": { "type": "integer", "description": "Service ID", "example": "service_idValue" }, "zone_id": { "type": "integer", "description": "Zone ID", "example": "zone_idValue" }, "record_id": { "type": "integer", "description": "Record ID", "example": "record_idValue" }, "name": { "type": "string", "description": "Record name ", "example": "example.com" }, "ttl": { "type": "integer", "description": "Record ttl ", "example": 3600 }, "priority": { "type": "integer", "description": "Priority of the record ", "example": 10 }, "type": { "type": "string", "description": "Record type ", "example": "A" }, "content": { "type": "string", "description": "Contents of the record ", "example": "192.168.1.2" } }, "example": { "service_id": "service_idValue", "zone_id": "zone_idValue", "record_id": "record_idValue", "name": "example.com", "ttl": 3600, "priority": 10, "type": "A", "content": "192.168.1.2" } } }, { "name": "service_id", "type": "string", "in": "path", "required": true }, { "name": "zone_id", "type": "string", "in": "path", "required": true }, { "name": "record_id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "record": { "id": "55", "type": "A", "ttl": "3600", "name": "test", "priority": 0, "content": "192.168.1.2" }, "info": [ "The record was updated successfully." ] } }, "schema": { "type": "object", "example": { "record": { "id": "55", "type": "A", "ttl": "3600", "name": "test", "priority": 0, "content": "192.168.1.2" }, "info": [ "The record was updated successfully." ] } } } } }, "delete": { "tags": [ "DNS" ], "summary": "Remove DNS Record", "description": "Removes the selected DNS zone record", "operationId": "dns_delete_record", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "service_id", "type": "integer", "in": "path", "description": "Service ID", "required": true }, { "name": "zone_id", "type": "integer", "in": "path", "description": "Zone ID", "required": true }, { "name": "record_id", "type": "integer", "in": "path", "description": "Record ID", "required": true } ], "responses": { "200": { "description": "`Success`" } } } } }, "securityDefinitions": { "basicAuth": { "type": "basic" } }, "security": [ { "basicAuth": [] } ], "definitions": { "Clientarea": { "type": "object", "properties": { "username": { "type": "string", "description": "Your acount email address " }, "password": { "type": "string", "description": "Account password " }, "email": { "type": "string", "description": "Email Address" }, "firstname": { "type": "string", "description": "First Name" }, "lastname": { "type": "string", "description": "Last Name" }, "companyname": { "type": "string", "description": "Organization" }, "address1": { "type": "string", "description": "Address 1" }, "address2": { "type": "string", "description": "Address 2" }, "city": { "type": "string", "description": "City" }, "state": { "type": "string", "description": "State" }, "postcode": { "type": "string", "description": "Post code" }, "country": { "type": "string", "description": "Country" }, "phonenumber": { "type": "string", "description": "Phone" }, "type": { "type": "string", "description": "Account Type" } } }, "Billing": { "type": "object", "properties": [] }, "DNS": { "type": "object", "properties": { "service_id": { "type": "integer", "description": "Service ID" }, "name": { "type": "string", "description": "Record name " }, "zone_id": { "type": "integer", "description": "Zone ID" }, "ttl": { "type": "integer", "description": "Record ttl " }, "priority": { "type": "integer", "description": "Priority of the record " }, "type": { "type": "string", "description": "Record type " }, "content": { "type": "string", "description": "Contents of the record " }, "record_id": { "type": "integer", "description": "Record ID" } } } }, "externalDocs": { "description": "Find out more about UserAPI", "url": "https:\/\/my.brainoza.com\/?cmd=userapi" } }