[owncloud-devel] ownCloud 7.0 and External API

Bernhard Posselt dev at bernhard-posselt.com
Fri Jan 30 08:44:55 GMT 2015


The link to the 6 dev docs have been removed because they are mostly 
wrong. They are basically identical with the 5 docs so you can look it 
up there. As for the external API: For your usecase it is better to just 
implement a very simple RESTful API like described here

* 
http://doc.owncloud.org/server/8.0/developer_manual/app/tutorial.html#adding-a-restful-api-optional
* http://doc.owncloud.org/server/8.0/developer_manual/app/api.html


On 01/29/2015 07:02 PM, Ben C wrote:
> Hi all,
>
> I'm the developer for ownNote (Evernote replacement app for ownCloud) 
> and am beginning to implement the Android and iOS interfaces. I've 
> been trying to identify the best way to integrate via API calls from a 
> PhoneGap application to the server, and I think I have found that in 
> the 6.0 documentation here: 
> http://doc.owncloud.org/server/6.0/developer_manual/app/app/externalapi.html
>
> My two part question:
>
> 1) Is this the appropriate way to integrate in 7.0 and beyond? This 
> docuemtnation doesn't seem to exist for 7.0, except in the EE 
> documentation 
> (http://doc.owncloud.com/server/7.0EE/developer_manual/app/app/externalapi.html)
>
> 2) If so, I'm running into some issues setting things up. I'm getting:
>
> ------------
> <ocs><meta><status>failed</status><statuscode>999</statuscode><message>Invalid 
> query, please check the syntax. API specifications are here: 
> http://www.freedesktop.org/wiki/Specifications/open-collaboration-services. 
> DEBUG OUTPUT:
> debug output:
> http request method: GET
> http request uri: /owncloud/ocs/v1.php/apps/ownnote
> </message></meta></ocs>
> ------------
>
> ... as a response. My query is to:
>
> ------------
> https://RegularNonAdminUser:Password@hostname.ext:port/owncloud/ocs/v1.php/apps/ownnote 
>
> ------------
>
> My routes.php:
>
> ------------
> <?php
>
> namespace OCA\OwnNote\AppInfo;
>
> \OCP\API::register(
>     'get',
>     '/apps/ownnote/ajax/api_getnotes.php',
>     function($urlParameters) {
>       return new \OC_OCS_Result($data);
>     },
>     'ownnote',
>     \OC_API::ADMIN_AUTH
> );
>
> $application = new Application();
>
> $application->registerRoutes($this, array('routes' => array(
>         array('name' => 'page#index', 'url' => '/', 'verb' => 'GET'),
>     array('name' => 'page#do_echo', 'url' => '/echo', 'verb' => 'POST'),
> )));
>
> ------------
>
> And my ajax/api_getnotes.php, which just returns "Test" to try to get 
> things working:
>
> ------------
> <?php
>
> \OCP\User::checkLoggedIn();
> \OCP\App::checkAppEnabled('ownnote');
>
> echo "Test";
>
> ?>
> ------------
>
> Can someone point me in the right direction, or to a sample of fully 
> functioning external API code?
>
> Thanks,
> Ben
> _______________________________________________
> Devel mailing list
> Devel at owncloud.org
> http://mailman.owncloud.org/mailman/listinfo/devel



More information about the Devel mailing list