{ "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## JSON Web Token Authentication\n\n```bash\ncurl 'https:\/\/hosting.primexm.com\/api\/login' \\\n -d username=\"username\"\\\n -d password=\"password\"\n\n# grab authentication token from the response and pass it in Authorization header\ncurl 'https:\/\/hosting.primexm.com\/api\/details' \\\n -H \"Authorization: Bearer $token\"\n```\n\n```php\n$resp = $client->post('login', [\n 'form_params' => [\n 'username' => 'username',\n 'password' => 'password'\n ]\n]);\n\n$token = $resp->json()['token'];\n\n$resp = $client->get('details', [\n 'headers' => [\n 'Authorization' => 'Bearer ' . $token\n ]\n]);\n\necho $resp->getBody();\n```\n\n> Make sure to replace `username` and `password` with your client area details.\n\nTo authenticate, you need to send a [JSON Web Token (JWT)](https:\/\/jwt.io\/) in the authorization header of the HTTP request.\n\nTo obtain the authorization `token` you need to submit a request with your username and password to `POST https:\/\/hosting.primexm.com\/api\/login` API method.\n\nAll API calls that require authentication expect HTTP header in the form of `Authorization: Bearer `.\n\nFor example: `Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRw...`\n\n", "version": "4.20260225", "title": "PrimeXM DMCC User API" }, "host": "hosting.primexm.com", "basePath": "\/api", "tags": [ { "name": "Clientarea" }, { "name": "Billing" }, { "name": "Services" }, { "name": "Support" } ], "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 } } } } } }, "\/token": { "post": { "tags": [ "Clientarea" ], "summary": "Refresh Token", "description": "Generate new authorization token using refresh token", "operationId": "refreshToken", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "refresh_token": { "type": "string", "description": "Refresh token previously obtained from `POST \/login`", "example": "refresh_tokenValue" } }, "example": { "refresh_token": "refresh_tokenValue" } } } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHR(...)vY2xlYiHGvauCWZD9B0VwXgHEzXDllqY", "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJBQ(...)Rmivc_u3YA_kgDqOPtUuGNXOzueXYtZw" } }, "schema": { "type": "object", "example": { "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHR(...)vY2xlYiHGvauCWZD9B0VwXgHEzXDllqY", "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJBQ(...)Rmivc_u3YA_kgDqOPtUuGNXOzueXYtZw" } } } } } }, "\/revoke": { "post": { "tags": [ "Clientarea" ], "summary": "Revoke Token", "description": "Invalidate authorization and refresh token.\nPass refresh token or call this method with valid access token", "operationId": "revokeToken", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "refresh_token": { "type": "string", "example": "refresh_tokenValue" } }, "example": { "refresh_token": "refresh_tokenValue" } } } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "status": true } }, "schema": { "type": "object", "example": { "status": true } } } } } }, "\/logs": { "get": { "tags": [ "Clientarea" ], "summary": "User Logs", "description": "Returns logs from history", "operationId": "getLogs", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`" } } } }, "\/statuses": { "get": { "tags": [ "Clientarea" ], "summary": "Returns a list of all statuses with specific status", "description": "", "operationId": "status_updates_specific", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "status", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/statuses\/{id}": { "put": { "tags": [ "Clientarea" ], "summary": "Returns details of status", "description": "", "operationId": "status_updates_details", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "id", "type": "integer", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/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`" } } } }, "\/invoice": { "get": { "tags": [ "Billing" ], "summary": "List Invoices", "description": "List all invoices under my account", "operationId": "getInvoices", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "invoices": [ { "id": "308976", "date": "2016-12-30", "dateorig": "2016-12-30", "duedate": "2017-01-06", "paybefore": "2017-01-06", "total": "19.65", "datepaid": "2016-12-30 12:40:47", "status": "Paid", "merge_id": null, "number": "2016\/12\/1", "currency": "USD" } ] } }, "schema": { "type": "object", "example": { "invoices": [ { "id": "308976", "date": "2016-12-30", "dateorig": "2016-12-30", "duedate": "2017-01-06", "paybefore": "2017-01-06", "total": "19.65", "datepaid": "2016-12-30 12:40:47", "status": "Paid", "merge_id": null, "number": "2016\/12\/1", "currency": "USD" } ] } } } } } }, "\/invoice\/{id}": { "get": { "tags": [ "Billing" ], "summary": "Invoice Details", "description": "Get invoice details", "operationId": "getInvoiceDetails", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "invoice": { "id": "308976", "status": "Paid", "date": "2016-12-30", "duedate": "2017-01-06", "paybefore": "2017-01-06", "datepaid": "2016-12-30 12:40:47", "subtotal": 16.24, "credit": 0, "tax": 3.41, "taxrate": 21, "tax2": 0, "taxrate2": 0, "taxexempt": "0", "total": 19.65, "rate": 1, "rate2": 0, "rate3": 1, "notes": "", "items": [ { "id": "12305", "invoice_id": "308976", "type": "Other", "item_id": "0", "description": "Example Service", "amount": "15.00", "taxed": "1", "qty": "1.00", "linetotal": "15.00" }, { "id": "12309", "invoice_id": "308976", "type": "Other", "item_id": "-2", "description": "PayPal Payment Fee", "amount": "1.24", "taxed": "1", "qty": "1.00", "linetotal": "1.24" } ], "client": { "id": "26", "email": "api@example.com", "firstname": "Joe", "lastname": "Doe", "companyname": "", "address1": "Pretty View Lane", "address2": "3194", "city": "Santa Rosa", "state": "California", "postcode": "95401", "country": "US", "phonenumber": "+1.24123123" }, "number": "2016\/12\/1", "currency": "USD" } } }, "schema": { "type": "object", "example": { "invoice": { "id": "308976", "status": "Paid", "date": "2016-12-30", "duedate": "2017-01-06", "paybefore": "2017-01-06", "datepaid": "2016-12-30 12:40:47", "subtotal": 16.24, "credit": 0, "tax": 3.41, "taxrate": 21, "tax2": 0, "taxrate2": 0, "taxexempt": "0", "total": 19.65, "rate": 1, "rate2": 0, "rate3": 1, "notes": "", "items": [ { "id": "12305", "invoice_id": "308976", "type": "Other", "item_id": "0", "description": "Example Service", "amount": "15.00", "taxed": "1", "qty": "1.00", "linetotal": "15.00" }, { "id": "12309", "invoice_id": "308976", "type": "Other", "item_id": "-2", "description": "PayPal Payment Fee", "amount": "1.24", "taxed": "1", "qty": "1.00", "linetotal": "1.24" } ], "client": { "id": "26", "email": "api@example.com", "firstname": "Joe", "lastname": "Doe", "companyname": "", "address1": "Pretty View Lane", "address2": "3194", "city": "Santa Rosa", "state": "California", "postcode": "95401", "country": "US", "phonenumber": "+1.24123123" }, "number": "2016\/12\/1", "currency": "USD" } } } } } } }, "\/invoice\/{id}\/pdf": { "post": { "tags": [ "Billing" ], "summary": "Invoice PDF", "description": "Get specific invoice PDF", "operationId": "getInvoicePdf", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "success": true, "invoice": "Paid" } }, "schema": { "type": "object", "example": { "success": true, "invoice": "Paid" } } } } } }, "\/service": { "get": { "tags": [ "Services" ], "summary": "List services", "description": "List all services under your account", "operationId": "service", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "services": [ { "id": "301", "domain": "examplename.com", "total": "9.99", "status": "Pending", "billingcycle": "Monthly", "next_due": "2017-12-30", "category": "Hosting", "category_url": "hosting", "name": "Starter Hosting" } ] } }, "schema": { "type": "object", "example": { "services": [ { "id": "301", "domain": "examplename.com", "total": "9.99", "status": "Pending", "billingcycle": "Monthly", "next_due": "2017-12-30", "category": "Hosting", "category_url": "hosting", "name": "Starter Hosting" } ] } } } } } }, "\/service\/{id}": { "get": { "tags": [ "Services" ], "summary": "Service details", "description": "Return details for service `@id`", "operationId": "serviceDetails", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "id", "type": "integer", "in": "path", "description": "Service id", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "service": { "id": "301", "date_created": "2016-12-30", "domain": "examplename.com", "firstpayment": "9.99", "total": "9.99", "billingcycle": "Monthly", "next_due": "2017-12-30", "next_invoice": "2017-01-27", "status": "Active", "label": "", "username": "examplen", "password": "pdtzc", "name": "Starter Hosting" } } }, "schema": { "type": "object", "example": { "service": { "id": "301", "date_created": "2016-12-30", "domain": "examplename.com", "firstpayment": "9.99", "total": "9.99", "billingcycle": "Monthly", "next_due": "2017-12-30", "next_invoice": "2017-01-27", "status": "Active", "label": "", "username": "examplen", "password": "pdtzc", "name": "Starter Hosting" } } } } } } }, "\/service\/{id}\/renew": { "post": { "tags": [ "Services" ], "summary": "Manual Service Renew", "description": "Generate an invoice to renew the service.", "operationId": "service_renew", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "id": { "type": "integer", "description": "Service id", "example": "idValue" } }, "example": { "id": "idValue" } } }, { "name": "id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "status": true, "invoice_id": "504426", "info": [ "manualrenew_ok" ] } }, "schema": { "type": "object", "example": { "status": true, "invoice_id": "504426", "info": [ "manualrenew_ok" ] } } } } } }, "\/service\/{id}\/cycle": { "get": { "tags": [ "Services" ], "summary": "List Billing Cycle", "description": "Get recurring billing cycle options", "operationId": "service_cycle", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "id", "type": "integer", "in": "path", "description": "Service id", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "current": "m", "cycles": { "m": "14.95", "a": "179.40", "b": "358.80" } } }, "schema": { "type": "object", "example": { "current": "m", "cycles": { "m": "14.95", "a": "179.40", "b": "358.80" } } } } } }, "post": { "tags": [ "Services" ], "summary": "Change Billing Cycle", "description": "Change recurring billing cycle for the service", "operationId": "service_cycle_set", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "id": { "type": "integer", "description": "Service id", "example": "idValue" }, "cycle": { "type": "string", "description": "New billing cycle", "example": "cycleValue" } }, "example": { "id": "idValue", "cycle": "cycleValue" } } }, { "name": "id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "success": true, "info": [ "changebillingcycle_ok" ] } }, "schema": { "type": "object", "example": { "success": true, "info": [ "changebillingcycle_ok" ] } } } } } }, "\/news": { "get": { "tags": [ "Support" ], "summary": "List News", "description": "List News", "operationId": "getNews", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`" } } } }, "\/news\/{news_id}": { "get": { "tags": [ "Support" ], "summary": "Get news item", "description": "Returns details of the news item", "operationId": "getNewsItem", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "news_id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/knowledgebase": { "get": { "tags": [ "Support" ], "summary": "List all knowledgebase categories", "description": "Returns list all knowledgebase categories", "operationId": "getKnowledgebaseCategories", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`" } } } }, "\/knowledgebase\/{category_id}": { "get": { "tags": [ "Support" ], "summary": "Get knowledgebase category details", "description": "Returns subcategories and articles of the knowledgebase category", "operationId": "getKnowledgebaseCategoryDetails", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "category_id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/knowledgebase\/article\/{article_id}": { "get": { "tags": [ "Support" ], "summary": "Get knowledgebase article", "description": "Returns an article details", "operationId": "getKnowledgebaseArticleDetails", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "article_id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } } }, "securityDefinitions": { "bearerAuth": { "type": "apiKey", "name": "Authorization", "in": "header", "description": "Enter: Bearer {token}" } }, "security": [ { "bearerAuth": [] } ], "definitions": { "Clientarea": { "type": "object", "properties": { "username": { "type": "string", "description": "Your acount email address " }, "password": { "type": "string", "description": "Account password " }, "refresh_token": { "type": "string" }, "status": { "type": "string" }, "id": { "type": "integer" } } }, "Billing": { "type": "object", "properties": [] }, "Services": { "type": "object", "properties": { "id": { "type": "integer", "description": "Service id" }, "cycle": { "type": "string", "description": "New billing cycle" } } }, "Support": { "type": "object", "properties": [] } }, "externalDocs": { "description": "Find out more about UserAPI", "url": "https:\/\/hosting.primexm.com\/?cmd=userapi" } }