PHPackages                             jowy/phalcon-restful-webservice - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. jowy/phalcon-restful-webservice

ActiveLibrary[API Development](/categories/api)

jowy/phalcon-restful-webservice
===============================

Phalcon RESTful Webservice

571422[1 issues](https://github.com/Atriedes/phalcon-restful-webservice/issues)PHP

Since Jul 30Pushed 10y ago11 watchersCompare

[ Source](https://github.com/Atriedes/phalcon-restful-webservice)[ Packagist](https://packagist.org/packages/jowy/phalcon-restful-webservice)[ RSS](/packages/jowy-phalcon-restful-webservice/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Phalcon Restful Webservice [![Scrutinizer Code Quality](https://camo.githubusercontent.com/ffd9501b7d2b507f08a8f3e7658114b0d1b363918894baa99604a5a087b7de0b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f41747269656465732f7068616c636f6e2d7265737466756c2d776562736572766963652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Atriedes/phalcon-restful-webservice/?branch=master) [![Build Status](https://camo.githubusercontent.com/ca2d05be379e351e707d243a57435e86a415307c95dee16b78ef1a892a7732cf/68747470733a2f2f7472617669732d63692e6f72672f41747269656465732f7068616c636f6e2d7265737466756c2d776562736572766963652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Atriedes/phalcon-restful-webservice)
============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#phalcon-restful-webservice--)

Just another Phalcon RESTful webservice. It use Phalcon annotation routing for advanced and flexible routing configuration.

Routing &amp; Options
=====================

[](#routing--options)

All routing must be placed in `app/controllers` and must have `Controller` suffix for class name. If your controller name is `Example` then class name is `ExampleController`. You can limit max request to specific API key or method. Limiting max request for API key can be set in Class Annotation, It will limit API key to access all method inside class. Also if you want to limit specific method you can set in Method Annotation, it will limit all API key to accessing this method.

Class Annotation Options
------------------------

[](#class-annotation-options)

`@RoutePrefix("your-prefix-url-here")` - `required`

`@Api(level=1-10, limits={"key": {"increment": "-1 month", "limit": 1000}})` - `optional`

Method Annotation Options
-------------------------

[](#method-annotation-options)

`@Get("/")` - `required`

`@Post("/")` - `required`

`@Put("/)` - `required`

`@Delete("/")` - `required`

`@Auth("your-auth-driver")` - `optional`

`@Limit({"increment": "-1 hour", "limit": 50})` - `optional`

Full Example
------------

[](#full-example)

```
use Phalcon\Mvc\Controller;

/**
 * @RoutePrefix("/v1/example")
 * @Api(level=1,
 *  limits={
 *   "key" : {
 *       "increment" : "-1 day", "limit" : 1000}
 *   }
 *  )
 */
class ExampleController extends Controller
{
	/**
     * @Get("/")
     * @Limit({"increment": "-1 hour", "limit": 50});
     * @Auth("basic")
     * @Whitelist()
     */
    public function getAction()
    {
        // Your Logic here
    }

	/**
     * @Post("/")
     * @Limit({"increment": "-1 hour", "limit": 50});
     * @Auth("basic")
     */
    public function addAction()
    {
        // Your Logic here
    }
}
```

Auth
====

[](#auth)

You add additional layer for security by add authentication, Auth can only enabled per class method by add annotation.

Basic
-----

[](#basic)

This is enable HTTP auth basic when user request webservice.

Response
========

[](#response)

Response are handled by [ellipsesynergie/api-response](https://github.com/ellipsesynergie/api-response) you can access this library via phalcon DI using `apiResponse`

Usage
-----

[](#usage)

```
	/**
     * @Get("/")
     * @Limit({"increment": "1 hour", "limit": 50});
     * @Auth("basic")
     */
    public function getAction()
    {
        $this->apiResponse->withArray(
			[
				"name" => "Jowy"
			],
			[
				"My-Custom-Response-Header" => "It rocks"
			]
		);
    }
```

Migration
=========

[](#migration)

`php vendor/bin/phinx migrate`

Test
====

[](#test)

`php vendor/bin/codecept run`

To do
=====

[](#to-do)

1. Improve documentation
2. **Add IP based whitelist/blacklist (implemented)**
3. Add IP based limitting
4. Add dashboard for monitoring webservice

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/023a0bd17758df473ae6dad9f07575a8d0a8c36b06e83396b5962aecba38c722?d=identicon)[PrasWicaksono](/maintainers/PrasWicaksono)

### Embed Badge

![Health badge](/badges/jowy-phalcon-restful-webservice/health.svg)

```
[![Health](https://phpackages.com/badges/jowy-phalcon-restful-webservice/health.svg)](https://phpackages.com/packages/jowy-phalcon-restful-webservice)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
