

Introduction to Automate OpenAPI Examples 
--------------------------------------------

Overview 
..........

This section of the API Guide describes a number of use-cases for integrating with 
VOSS Automate, based on the OpenAPI specification. 

.. note:: 

   The OpenAPI specification (formerly called Swagger) defines a standard, 
   language-agnostic interface to RESTful APIs. OpenAPI definition files are written in the 
   YAML format, which is automatically rendered into a more human-readable interface.

   See https://swagger.io/specification/ 


You can use the REST API to interact programmatically with Automate and integrate with external applications, such 
as ServiceNow. For example, you can use the example calls to retrieve a list of all customers 
at the Provider hierarchy, retrieve a list of all sites belonging to a customer, add a 
phone or a subscriber, update phone or line details, or delete a phone or a subscriber. 

.. note:: 

   The OpenAPI examples do not support interactive API calls to VOSS Automate.


Errors 
..........

The API uses standard HTTP status codes to indicate the success or failure of the API call. 

The Automate API uses conventional HTTP response codes to indicate the success or failure 
of an API request. Codes in the 2xx range indicate success. Codes in the 4xx range 
indicate an error that failed given the information provided, for example, a required parameter was omitted.



Samples 
...................

Each API call has one or more documented examples, for either a response or request (depending on the method, 
either GET, POST, PATCH, or DELETE). 

The body of the response is JSON format.

The response samples provided for the GET call depend on the macro you provide for the call, a sample response is provided for each 
input macro parameter. Click the drop-down at **Example** to view the response sample for 
the relevant input macro. 

Request samples are similarly provided for each POST, PATCH, and DEL call. Where more than one example is 
provided, click the drop-down at **Example** to toggle the examples for the call. 


You can view the samples, here:

*
   .. raw:: html

      See: <a href="ServiceNow-integration.html">OpenAPI specification examples</a>.

   .. raw:: latex

      Refer to the "OpenAPI Specification Examples" section in the HTML API Guide.



Content Type 
...............

The VOSS Automate API supports the ``application/json`` content type by default.



VOSS Automate API and the OpenAPI Specification Examples  
...........................................................

These links provide further details relevant to the OpenAPI examples:

* `Automate API Guide (this document) <https://documentation.voss-solutions.com/release_21.4/html/src/api/index.html>`__

  The Automate API Guide provides general information for the Automate API, which you can use as references 
  for the examples in this section:

  * `What are models? <https://documentation.voss-solutions.com/release_21.4/html/src/api/concepts-API-system-concepts.html>`__
  * `What are model types? <https://documentation.voss-solutions.com/release_21.4/html/src/api/concepts-API-response-elements-metadata-model_type.html>`__
  * `What is the importance of "hierarchy" in the API? <https://documentation.voss-solutions.com/release_21.4/html/src/api/concepts-API-hierarchy.html>`__
  * `Request and response patterns <https://documentation.voss-solutions.com/release_21.4/html/src/api/concepts-API-req-resp-patterns.html>`__
  * `API URL structure <https://documentation.voss-solutions.com/release_21.4/html/src/api/concepts-endpoint-versioning.html>`__
  * `Headers <https://documentation.voss-solutions.com/release_21.4/html/src/api/concepts-HTTP-header-format.html>`__
  * `Authentication <https://documentation.voss-solutions.com/release_21.4/html/src/api/concepts-HTTP-header-authentication.html>`__
  * `Authorization <https://documentation.voss-solutions.com/release_21.4/html/src/api/concepts-API-authorization.html>`__
  * `HTTP methods <https://documentation.voss-solutions.com/release_21.4/html/src/api/concepts-API-req-HTTP-methods.html>`__
  * `API parameters <https://documentation.voss-solutions.com/release_21.4/html/src/api/reference-API-parameters.html>`__
  * `Request headers <https://documentation.voss-solutions.com/release_21.4/html/src/api/reference-API-headers.html>`__
  * `Login and authorization tokens <https://documentation.voss-solutions.com/release_21.4/html/src/api/concepts-auth-token.html>`__
  * `API responses <https://documentation.voss-solutions.com/release_21.4/html/src/api/concepts-API-response-overview.html>`__
  * `Optional request metadata <https://documentation.voss-solutions.com/release_21.4/html/src/api/concepts-API-async-mutator-transact-callback.html>`__
  * `Using the API Reference <https://documentation.voss-solutions.com/release_21.4/html/src/api/concepts-API-reference-using.html>`__
  * `API schema <https://documentation.voss-solutions.com/release_21.4/html/src/api/api-schema.html>`__

* `API Model Reference <https://documentation.voss-solutions.com/release_RELEASENUM/html/src/api-ref/index-Model-alphabetical.html>`__

  The API Model Reference provides resource details. Resources are classified by the type of model in the 
  system (data, device, domain, relation or view), for example, `data/AccessProfile` or `device/cucm/Phone`. 

  Depending on the installed modules and their feature packages, the API of feature package 
  models may be available, for example, `relation/Subscriber` or `view/QuickSubscriber`. 

  The documentation for each API example contains a link to the model reference for that call.  

* `API Reference <https://documentation.voss-solutions.com/release_RELEASENUM/html/src/api-ref/index.html>`__

  The API Reference describes the schema and the operations applicable for each 
  resource in the system. The documentation for each API example contains a link to the API reference for that call. 

*   
   .. raw:: html

      <a href="ServiceNow-integration.html">OpenAPI Specification Examples</a>

   .. raw:: latex
  
      Refer to the "OpenAPI Specification Examples" section in the HTML API Guide.






