Connecting to Elgg

Hi all,

Disclaimer: I'm quite newbie. I'm trying to write an android app to upload a photo using both Tidypics & Webservices plugins. I'm facing several issues I though they were easy to handle but I was wrong.

First of all, how do I get a user to be authorized to do operations like upload a photo by user xyz. I wrote a Webservice and tried to 'Object->save' but, obviously, user needs to have privileges. In case there is an exposed webservice called photo.upload_photo($username, $password), how the system can let that user to perform de 'save'? What's de php code to handle this?

I though it was a common topic for elgg developers but can't find any related documentation or example.

Thanks in advance !!

* api_key (apiadmin plugin) is also passed in the request, so the API is supposed to be authorized.

  • Android ? Can already upload images via normal Browser to Elgg sites ;) Why the need for an 'Android App'/Java to do what works already anyway ?

  • does your exposed method authenticate the user first? the api_key does not authorize the user by default. Take a closer look at available functions within web services.

  • Hi all,

    @DhrupDeScoop I think is easier to share en image from Gallery than upload it with mobile browser. Of course, user must be logged in first but I can't find how to within documentation or community. I'm also trying the OAuth way but it doesn't seem to work right now (stuck too :().

    @Ismayil Finally I made it working with:

    $user = get_user_by_username($username);
    login($user, FALSE);

    but ... no password checked?

     

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking