DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

Developer Corner

Target group: Developers

This section shows you, how to define a webservice with this extension.

API

First of all create a class and add the annotation @Path. The leading slash is mandatory.

/*
 * @Path /myservice
 */
 class MyFirstWebservice {
 }

Next, create a method which should be called and add the annotation @Path and the required HTTP request method (@GET or @POST) as annotation.

/**
 * @GET
 * @Path /users/{param}
 */
public function usersMethod($param) {
    print_r($param);
}

In your ex_localconf.php register your class as a webservice.

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['bdegmbh_webservices']['services'][]
            = 'EXT:'.$_EXTKEY.'/Classes/MyFirstWebservice.php:MyFirstWebservice';

That's all. Open the url <Your-Typo3-environment>/services/myservice/users/dummy and you should see the word dummy in your browser.