OpenAPI: Difference between revisions

From MiRTA PBX documentation
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
# OpenAPI API
## Overview


  ## Overview
openapi.php is the new JSON API endpoint based on the OpenAPI specification.


  openapi.php is the new JSON API endpoint based on the OpenAPI specification.
The API uses the existing MirtaPBX API keys:
 
  The API uses the existing MirtaPBX API keys:


   - Full API key: APIKEY
   - Full API key: APIKEY
   - Read-only API key: READONLYAPIKEY
   - Read-only API key: READONLYAPIKEY


  Both global and tenant-level keys are supported.
Both global and tenant-level keys are supported.


  The first implemented API object is extension, with a list endpoint returning extension ID, number, name, and technology.
The first implemented API object is extension, with a list endpoint returning extension ID, number, name, and technology.


  ## OpenAPI Specification
## OpenAPI Specification


  The OpenAPI specification is available from:
The OpenAPI specification is available from:


  openapi.php
openapi.php
  openapi.php?spec=1
openapi.php?spec=1
  openapi.php/openapi.json
openapi.php/openapi.json
  openapi.php/swagger.json
openapi.php/swagger.json


  The response is an OpenAPI 3.0.3 JSON document.
The response is an OpenAPI 3.0.3 JSON document.


  ## Authentication
## Authentication


   The API key can be provided in any of these ways:
   The API key can be provided in any of these ways:

Revision as of 07:35, 25 May 2026

    1. Overview

openapi.php is the new JSON API endpoint based on the OpenAPI specification.

The API uses the existing MirtaPBX API keys:

 - Full API key: APIKEY
 - Read-only API key: READONLYAPIKEY

Both global and tenant-level keys are supported.

The first implemented API object is extension, with a list endpoint returning extension ID, number, name, and technology.

    1. OpenAPI Specification

The OpenAPI specification is available from:

openapi.php openapi.php?spec=1 openapi.php/openapi.json openapi.php/swagger.json

The response is an OpenAPI 3.0.3 JSON document.

    1. Authentication
 The API key can be provided in any of these ways:
 ### Query Parameter
 openapi.php/extensions?tenant=TENANTCODE&key=APIKEY
 ### Header
 X-API-Key: APIKEY
 ### Bearer Token