diamante/api-bundle
最新稳定版本:2.0.3
Composer 安装命令:
composer require diamante/api-bundle
包简介
DiamanteDesk Api Bundle
README 文档
README
API bundle provides extended authentication required for DiamanteDesk API and a way to expose services and their methods as RESTful API.
Requirements
DiamanteDesk supports OroCRM version 1.8+.
Configuration
Add additional configuration to app/config/security.yml:
- to section providers:
diamante_api_user: id: diamante.api.user.security.provider
- to section firewalls:
wsse_secured_diamante: pattern: ^/api/diamante/(rest|soap).* provider: diamante_api_user stateless: true wsse_diamante_api: true
Usage
For example, you have a service defined in configuration with "entities.service.id" id. To expose it as RESTful API:
- it should implement the following interface \Diamante\ApiBundle\Routing\RestServiceInterface
- the following methods should be public and annotated with \Diamante\ApiBundle\Annotation\ApiDoc:
/** * @ApiDoc( * description="Returns all entities", * uri="/entities.{_format}", * method="GET", * resource=true, * statusCodes={ * 200="Returned when successful", * 403="Returned when the user is not authorized to list entities" * } * ) * @return Entities[] */
- specify service in routing configuration:
entities_service:
resource: entities.service.id
type: diamante_rest_service
prefix: /api/rest/{version}/example
requirements:
version: latest|v1
_format: xml|json
defaults:
version: latest
_format: json
After all the steps are completed, your service shall be available at:
GET http://host/api/rest/latest/example/entities
Contributing
We appreciate any effort to make DiamanteDesk functionality better; therefore, we welcome all kinds of contributions in the form of bug reporting, patches submitting, feature requests or documentation enhancement. Please refer to the DiamanteDesk guidelines for contributing if you wish to be a part of the project.
统计信息
- 总下载量: 2.66k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: OSL-3.0
- 更新时间: 2015-03-24