[owncloud-devel] ownCloud 7.0 and External API

Ben C owncloud at nosolutions.com
Thu Jan 29 18:02:58 GMT 2015


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


More information about the Devel mailing list