Apigility Integration in Zend Studio
Apigility is an API Builder, designed to simplify creating and maintaining useful, easy to consume, and well structured APIs. Regardless of your experience in API building, with Apigility you can allow mobile applications, developer communities, and any other consumer controlled access to your applications.
Zend Studio's integration with Apigility allows you to seamlessly create, document and test the APIs constructing the back-end of your applications, all within the same development environment.
Tutorial Content
In this tutorial you will learn:
- To create a new Apigility project
- To create, document and test a new RPC service
- To add and test authentication
Prerequisites
- Zend Studio 11.0 or above which can be downloaded from the Zend Studio Downloads page. For information on installation, see the Zend Studio Installation Guide.
Related Media
To better understand the procedures described in this tutorial, watch this video:
The first step in this tutorial is creating a new Apigility project in your workspace.
|
|
|
To create an Apigility project:
|
|
Next, we will add a new RPC service to our Apigility project.
In this tutorial, we will be adding a service that pings the API for availability and receives a time-stamp for acknowledgments.
|
|
|
To add a new service to Apigility:
Well done! You have successfully created your new web service in Apigility. |
|
The Apigility Editor makes documenting your API services an easy task.
|
|
|
To document services:
|
|
Our next step in this tutorial is to add some code to the service so it actually performs some action. We are going to make sure that the response to the request contain the 'ack' parameter with a current timestamp.
|
|
|
To develop the service:
The important lines are lines 05, which imports 'ZF\ContentNegotiation\ViewModel', and lines 11-13, which return a view model from the controller.
|
|
Our final step is to test the new service. Zend Studio's integration with Apigility allows you do this within your workspace, without needing to use other utilities.
|
|
|
To test the service:
|
For more information on working with Apigility, see Apigility.org. |
Our final step is adding and testing HTTP Basic authentication to our service.
|
|
|
To add and test authentication:
|
Congratulations! You have completed the Apigility Integration tutorial. We recommend you visit http://www.apigility.org/ for information on using Apigility as the back-end of your mobile projects. |