[owncloud-devel] How to use the ownCloud API in a Perl script?

Hoffmann, Patrick HOP at bito.de
Wed Sep 10 11:37:07 GMT 2014


I think you should use PHP/Javascript/AJAX/JQuery only, because as far as I know perl isn’t a dependency of OC.
You should be able to do everything using them. If you really want to use perl, I think using PHP-scripts to return the API values would be the easiest.

You can try:

//Your perl script
Require LWP::UserAgent;

my $val = LWP::UserAgent->new;
my $response = $val->get(‘AJAX/perlapicall.php/?apimethod=UserExists&apivalue=tom’);

and inside the PHP-script:

//perlapicall.php inside the AJAX folder of your app.
                case  “UserExists”:
                //Returns the value from the API call if user Tom exists…
                return OCP\User:UserExists($_GET[‘apivalue’]);

                //…other methods

I’m not really into perl, but something that way could be possible. It’s just pseudo code…



Von: devel-bounces at owncloud.org [mailto:devel-bounces at owncloud.org] Im Auftrag von jery2 at atlas.cz
Gesendet: Mittwoch, 10. September 2014 12:51
An: List for Developers of ownCloud
Betreff: Re: [owncloud-devel] How to use the ownCloud API in a Perl script?


to be more specific. I need to execute command line perl script which create user.

I found index.php/settings/ajax/createuser.php, thus I can probably use LWP::UserAgent

to call the PHP script, but it looks like too complicated. Is there an easier way to do that?

Thank you

> Od: <jery2 at atlas.cz<mailto:jery2 at atlas.cz>>
> Komu: <devel at owncloud.org<mailto:devel at owncloud.org>>
> Datum: 26.08.2014 10:41
> Předmět: [owncloud-devel] How to use the ownCloud API in a Perl script?


I can easy use Perl module HTTP::DAV to modify content on my ownCloud server using WebDAV
protocol, but I don't know how to call ownCloud's API methods. Is it possible to call methods
directly from a Perl script, for example the method OCP\User::userExists()?

Thank you
Devel mailing list
Devel at owncloud.org<mailto:Devel at owncloud.org>

Geschäftsführer: Werner Magin, Winfried Schmuck | HRB 2704 Bad Kreuznach | Gesellschafter: Fritz Bittmann Holding GmbH | USt-ID: DE 811 202 181

Bittmann GmbH
Obertor 29
D-55590 Meisenheim      Telefon:
Internet:       +49 (0) 6753 122 0
+49 (0) 6753 122 399
info at bito.de

Dieses E-Mail ist nur für den Empfänger bestimmt, an den es gerichtet ist und kann vertrauliches bzw. unter das Berufsgeheimnis fallendes Material enthalten. Jegliche darin enthaltene Ansicht oder Meinungsäußerung ist die des Autors und stellt nicht notwendigerweise die Ansicht oder Meinung von BITO-Lagertechnik Bittmann GmbH dar.
Sind Sie nicht der Empfänger und haben diese E-Mail irrtümlich erhalten, sind jegliche Verwendung, Veröffentlichung, Weiterleitung, Abschrift oder jeglicher Druck dieser E-Mail strengstens untersagt.
Jede ausgehende E-Mail wird von uns mit höchster Sorgfalt auf Viren geprüft. Jedoch übernehmen weder BITO-Lagertechnik Bittmann GmbH noch der Absender (Patrick Hoffmann) die Haftung für Viren; es obliegt Ihrer Verantwortung, die E-Mail und deren Anhänge auf Viren zu prüfen.

This email is exclusively meant for the addressee and may contain confidential information or information which can be classified as professional secret. Any view or opinion stated in this email is that of the author and does not necessarily represent the view or the opinion of BITO-Lagertechnik Bittmann GmbH. If you are not the addressee and if this email has been transmitted to you by mistake, you may not make use of, publish, transmit, reproduce or print the information contained therein for whatever purpose. We take every reasonable care to check all out-bound emails for viruses. However, neither BITO-Lagertechnik Bittmann GmbH nor the sender (Patrick Hoffmann) can be held liable for the occurrence of viruses and any consequential damages. It is therefore the addressee's sole responsibility to check incoming emails and attachments for viruses.

Anhänge - :
Versand am 10.09.2014 13:37 von Patrick Hoffmann

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.owncloud.org/pipermail/devel/attachments/20140910/47727370/attachment-0001.html>

More information about the Devel mailing list