PHPackages                             digecon/elgg\_web\_services - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. digecon/elgg\_web\_services

ActiveElgg-plugin

digecon/elgg\_web\_services
===========================

Web services plugin for elgg

08PHP

Since Jan 27Pushed 11y ago1 watchersCompare

[ Source](https://github.com/digecon/elgg_web_services)[ Packagist](https://packagist.org/packages/digecon/elgg_web_services)[ RSS](/packages/digecon-elgg-web-services/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Original code: [github.com/Tachyon/Elgg-Web-Services](https://github.com/Tachyon/Elgg-Web-Services)

Elgg Web Services
=================

[](#elgg-web-services)

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications. The web services plugin can be installed to any Elgg server and it will enable the web services in that server. These web services can be used to provide access to data of that Elgg server and allows developers to build upon and extend their applications in new and creative ways.

Introduction
------------

[](#introduction)

The Elgg web services are essentially RPC web services the output can be requested as JSON as well as XML. These web services are based on Elgg's web services API.

### Making a web services call

[](#making-a-web-services-call)

Any call to the web services can be made by calling the URL

```
```
/services/api/rest//?method=
```

```

Here : the path of root directory of Elgg website : json or xml : the name of the remote method you want to call

Other parameters need to be passed by GET or POST depending on the type of web services is being requested. The request type for each web service has been defined later in this document

Getting Started
---------------

[](#getting-started)

### Installation

[](#installation)

To use these web services in any Elgg installation, just install this plugin. After that generate a API key pair for all the application which use them. This API key willbe needed to passed in every web service request as a variable 'api\_key'.

### Configuration

[](#configuration)

All the web services are divided in seven broad categories

```
* Core
* User
* Group
* Wire
* Blog
* File
* Like

```

These web serivces can be enabled or disabled depending on reuirement. Any web services can be disabled or enabled from "Web Services" in Admin settings.

### Authentication

[](#authentication)

Web sevices make use of Elgg's API authentication web service for authetication.

A sample code for authentication will look like this

```
```
$params = array(
	'username' => $username,
	'password' => $password,
);
$token = $this->post('auth.gettoken', $params);
```

```

This token will be used for all web services call in the future. This token must be passed in every call as 'auth\_token'.

### Client Classes

[](#client-classes)

A PHP class which can be used by client software is included in the Class folder of source code And a premature sample of JavaScript clietn is in the app/ folder.

List of Web Services
--------------------

[](#list-of-web-services)

### Core

[](#core)

- site.test - Heartbeat method to test whether web services are up

    ```
    $info = $client->get('site.test');
    var_dump($info);

    ```

    ```
    object(stdClass)
    	public 'success' => boolean true
    	public 'message' => string 'Hello' (length=5)

    ```
- site.get\_info - Get basic information about this Elgg site

    ```
    $info = $client->get('site.getinfo');
    var_dump($info);

    ```

    ```
    object(stdClass)[135]
    	public 'url' => string 'http://elgg-master.mbp/Users/brett/Devel/elgg/master' (length=52)
    	public 'sitename' => string 'New Elgg site' (length=13)
    	public 'language' => string 'en' (length=2)

    ```

### User

[](#user)

- user.get\_profile\_fields Get profile fields

    ```
    $info = $client->get('user.get_profile_fields');
    var_dump($info);

    ```

    ```
    object(stdClass)[3]
      public 'description' =>
    	object(stdClass)[13]
    	  public 'label' => string 'About me' (length=8)
    	  public 'type' => string 'longtext' (length=8)
      public 'briefdescription' =>
    	object(stdClass)[12]
    	  public 'label' => string 'Brief description' (length=17)
    	  public 'type' => string 'text' (length=4)
      public 'location' =>
    	object(stdClass)[11]
    	  public 'label' => string 'Location' (length=8)
    	  public 'type' => string 'location' (length=8)
      public 'interests' =>
    	object(stdClass)[10]
    	  public 'label' => string 'Interests' (length=9)
    	  public 'type' => string 'tags' (length=4)
      public 'skills' =>
    	object(stdClass)[9]
    	  public 'label' => string 'Skills' (length=6)
    	  public 'type' => string 'tags' (length=4)
      public 'contactemail' =>
    	object(stdClass)[8]
    	  public 'label' => string 'Contact email' (length=13)
    	  public 'type' => string 'email' (length=5)
      public 'phone' =>
    	object(stdClass)[7]
    	  public 'label' => string 'Telephone' (length=9)
    	  public 'type' => string 'text' (length=4)
      public 'mobile' =>
    	object(stdClass)[6]
    	  public 'label' => string 'Mobile phone' (length=12)
    	  public 'type' => string 'text' (length=4)
      public 'website' =>
    	object(stdClass)[5]
    	  public 'label' => string 'Website' (length=7)
    	  public 'type' => string 'url' (length=3)
      public 'twitter' =>
    	object(stdClass)[4]
    	  public 'label' => string 'Twitter username' (length=16)
    	  public 'type' => string 'text' (length=4)

    ```
- user.get\_profile Get profile information

    ```
    $params = array("username" => "admin");
    $info = $client->get('user.get_profile', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)[3]
      public 'description' => null
      public 'briefdescription' => null
      public 'location' => null
      public 'interests' => null
      public 'skills' => null
      public 'contactemail' => null
      public 'phone' => null
      public 'mobile' => null
      public 'website' => null
      public 'twitter' => null

    ```
- user.save\_profile Update profile information

    ```
    $profile = array('description' => 'description test',
    				'briefdescription' => 'briefdescription test',
    				'location' => 'India',
    				'interests' => 'my interest',
    				'skills' => 'my skills',
    				'contactemail' => 'myemail@email.com',
    				'phone' => '01234567890',
    				'mobile' => '11234567890',
    				'website' => 'http://mywebsite.com',
    				'twitter' => 'tweet',
    				);
    $params = array('username' => $this->user->username,
    				'profile' => $profile
    				);
    $info = $client->post('user.save_profile', $params);
    var_dump($info);

    ```

    ```
    string 'Success' (length=7)

    ```
- user.get\_user\_by\_email Get all users registered with an email ID

    ```
    $params = array('email' => 'tachyon.saket@gmail.com');
    $info = $client->get('user.get_user_by_email', $params);
    var_dump($info);

    ```

    ```
    array
    	0 => string 'Admin' (length=5)

    ```
- user.check\_username\_availability Check availability of username

    ```
    $params = array('username' => 'admin');
    $info = $this->client->get('user.check_username_availability', $params);
    var_dump($info);

    ```

    ```
    boolean false

    ```
- user.register Register user

    ```
    $params = array('name' => 'test',
    				'email' => 'test2@test.org',
    				'username' => 'test2',
    				'password' => 'password',
    				);
    $info = $this->client->get('user.register', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)
    	boolean success true
    	int guid 8654

    ```
- user.friend.add Add a user as a friend

    ```
    $params = array('username' => array ('type' => 'string'),
    				'friend' => array ('type' => 'string'),
    				);
    $info = $this->client->post('user.friend.add', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)
    	boolean success true
    	string message 'Successfully Added'

    ```
- user.friend.remove Remove a user from friend

    ```
    $params = array('username' => array ('type' => 'string'),
    				'friend' => array ('type' => 'string'),
    				);
    $info = $this->client->post('user.friend.remove', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)
    	boolean success true
    	string message 'Successfully Removed'

    ```
- user.friend.get\_friends Get friends of a user

    ```
    $params = array('username' => 'admin',
    				'limit' => 1,
    				'offset' => 0,
    				);
    $info = $this->client->get('user.friend.get_friends', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)[334]
      public '3393' =>
    	object(stdClass)[300]
    	  public 'username' => string 'Tachyon' (length=19)
    	  public 'name' => string 'Saket Saurabh' (length=16)

    ```
- user.friend.get\_friends\_of Obtains the people who have made a given user a friend

    ```
    $params = array('username' => 'tachyon',
    				'limit' => 1,
    				'offset' => 0,
    				);
    $info = $this->client->get('user.friend.get_friends', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)[334]
      public '3393' =>
    	object(stdClass)[300]
    	  public 'username' => string 'admin' (length=19)
    	  public 'name' => string 'Administrator' (length=16)

    ```

### Blog

[](#blog)

- blog.save\_post Make a blog post

    ```
    $params = array('username' => 'admin',
    				'title' => 'Test blog post',
    				'text' => 'text of blog post',
    				),
    $info = $this->client->get('blog.save_post', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)
    	public 'success' => boolean true
    	public 'message' => string 'Successfully saved the blog post.' (length=33)

    ```
- blog.get\_post Read a blog post

    ```
    $params = array('guid' => 53,
    				'username' => 'admin'
    				),
    $info = $this->client->get('blog.get_post', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)[3]
      public 'title' => string 'This is a new blog' (length=18)
      public 'content' => string 'this is the content of the latest blog' (length=38)
      public 'excerpt' => string '' (length=0)
      public 'tags' => string 'blog' (length=4)
      public 'owner_guid' => string '43' (length=2)
      public 'access_id' => string '2' (length=1)
      public 'status' => string 'published' (length=9)
      public 'comments_on' => string 'On' (length=2)

    ```
- blog.delete\_post Delete a blog post

    ```
    $params = array('guid' => 53,
    				'username' => 'admin'
    				);
    $info = $this->client->post('blog.delete_post', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)
    	public 'success' => boolean true
    	public 'message' => string 'Blog post deleted.' (length=18)

    ```
- blog.get\_friends\_posts Get latest blog post by friends

    ```
    $params = array('username' => 'admin',
    				'limit' => 1,
    				'offset' => 0,
    				);
    $info = $this->client->get('blog.get_friends_posts', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)[3]
      public '55' =>
    	object(stdClass)[4]
    	  public 'time_created' => string '1310124191' (length=10)
    	  public 'title' => string 'This is a new blog' (length=18)
    	  public 'content' => string 'this is the content of the latest blog' (length=38)
    	  public 'excerpt' => string '' (length=0)
    	  public 'tags' => string 'blog' (length=4)
    	  public 'owner_guid' => string '43' (length=2)
    	  public 'access_id' => string '2' (length=1)
    	  public 'status' => string 'published' (length=9)
    	  public 'comments_on' => string 'On' (length=2)

    ```
- blog.get\_latest\_posts Latest blog post by a user or by all user

    ```
    $params = array('username' => 'admin',
    					'limit' => 1,
    					'offset' => 0,
    				);
    $info = $this->client->get('blog.get_latest_posts', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)[3]
      public '49' =>
    	object(stdClass)[4]
    	  public 'time_created' => string '1310027828' (length=10)
    	  public 'title' => string 'title' (length=5)
    	  public 'content' => string 'text' (length=4)
    	  public 'excerpt' => string 'excerpt' (length=7)
    	  public 'tags' => string 'tags' (length=4)
    	  public 'owner_guid' => string '36' (length=2)
    	  public 'access_id' => string '2' (length=1)
    	  public 'status' => string 'published' (length=9)
    	  public 'comments_on' => string 'On' (length=2)

    ```

### Group

[](#group)

- group.join Joining a group

    ```
    $params = array('username' => 'tachyon',
    				'groupid' => 72,
    				);
    $info = $this->client->post('group.join', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)
    	public 'success' => boolean true
    	public 'message' => string 'Successfully joined group!' (length=26)

    ```
- group.leave Leaving a group

    ```
    $params = array('username' => 'tachyon',
    				'groupid' => 72,
    				);
    $info = $this->client->post('group.leave', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)
    	public 'success' => boolean true
    	public 'message' => string 'Successfully left group' (length=23)

    ```
- group.forum.save\_post Posting a new topic to a group

    ```
    $params = array('username' => 'admin',
    					'groupid' => 71,
    					'title' => 'testing post',
    					'desc' => 'hello i am testing web services',
    				);
    $info = $this->client->post('group.forum.save_post', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)
    	public 'success' => boolean true
    	public 'message' => string 'The discussion topic was created.' (length=33)

    ```
- group.forum.delete\_post Deleting a topic from a group

    ```
    $params = array('username' => 'admin',
    				'topicid' => 84,
    				);
    $info = $this->client->post('group.forum.delete_post', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)
    	public 'success' => boolean true
    	public 'message' => string 'Discussion topic has been deleted.' (length=34)

    ```
- group.forum.get\_latest\_post Get latest post in a group

    ```
    $params = array('groupid' => 47,
    				'limit' => 1,
    				'offset' => 0,
    				);
    $info = $this->client->get('group.forum.get_latest_post', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)[3]
      public '56' =>
    	object(stdClass)[4]
    	  public 'title' => string 'test' (length=4)
    	  public 'description' => string 'test' (length=11)
    	  public 'owner_guid' => string '36' (length=2)
    	  public 'container_guid' => string '47' (length=2)
    	  public 'access_id' => string '2' (length=1)
    	  public 'time_created' => string '1310144929' (length=10)
    	  public 'time_updated' => string '1310144929' (length=10)
    	  public 'last_action' => string '1310321462' (length=10)

    ```
- group.forum.get\_reply Get replies on a post

    ```
    $params = array('postid' => 56,
    				  'limit' => 1,
    				  'offset' => 0,
    				);
    $info = $this->client->get('group.forum.get_replies', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)[3]
      public '2' =>
    	object(stdClass)[4]
    	  public 'value' => string 'this i smy reply' (length=23)
    	  public 'name' => string 'group_topic_post' (length=16)
    	  public 'enabled' => string 'yes' (length=3)
    	  public 'owner_guid' => string '36' (length=2)
    	  public 'entity_guid' => string '56' (length=2)
    	  public 'access_id' => string '2' (length=1)
    	  public 'time_created' => string '1310310194' (length=10)
    	  public 'name_id' => string '71' (length=2)
    	  public 'value_id' => string '70' (length=2)
    	  public 'value_type' => string 'text' (length=4)

    ```
- group.forum.save\_reply Post a reply

    ```
    $params = array('username' => 'admin',
    					'postid' => 56,
    					'text' => 'My reply',
    				);
    $info = $this->client->post('group.forum.save_reply', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)
    	public 'success' => boolean true
    	public 'message' => string 'Successfully posted reply' (length=25)

    ```
- group.forum.delete\_reply Delete a reply

    ```
    $params = array('username' => 'admin',
    				'id' => 6,
    				);
    $info = $this->client->post('group.forum.delete_reply', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)
    	public 'success' => boolean true
    	public 'message' => string 'Discussion reply has been deleted.' (length=34)

    ```

### Wire

[](#wire)

- wire.save\_post Making a wire post

    ```
    $params = array('username' => 'admin',
    				'text' => 'test wire post',
    				);
    $info = $this->client->post('wire.save_post', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)
    	public 'success' => boolean true
    	public 'message' => string 'succesfully saved' (length=17)

    ```
- wire.get\_posts Read latest wire post of user

    ```
    $params = array('username' => 'admin',
    				);
    $info = $this->client->get('wire.get_post', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)[3]
      public 'guid' => string '64' (length=2)
      public 'time_created' => string '1310558739' (length=10)
      public 'description' => string 'wire post' (length=9)

    ```
- wire.get\_friends\_posts Read latest wire post by friends

    ```
    $params = array('username' => 'admin',
    				'limit' => 1,
    				'offset' => 0,
    				);
    $info = $this->client->get('wire.get_friends_posts', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)[3]
      public '64' =>
    	object(stdClass)[4]
    	  public 'time_created' => string '1310558739' (length=10)
    	  public 'description' => string 'wire post' (length=9)

    ```
- wire.delete\_posts Read latest wire post by friends

    ```
    $params = array('username' => 'admin',
    				'wireid' => 64,
    				);
    $info = $this->client->post('wire.delete_posts', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)
    	public 'success' => boolean true
    	public 'message' => string 'The wire post was successfully deleted.' (length=39)

    ```

### File

[](#file)

- file.get\_files Get file list by all users or a pecific user

    ```
    $params = array('limit' => 1,
    				  'offset' => 0,
    				);
    $info = $this->client->get('wire.get_files', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)[3]
      public '58' =>
    	object(stdClass)[4]
    	  public 'title' => string 'deploy' (length=6)
    	  public 'owner_guid' => string '43' (length=2)
    	  public 'container_guid' => string '43' (length=2)
    	  public 'access_id' => string '2' (length=1)
    	  public 'time_created' => string '1310301409' (length=10)
    	  public 'time_updated' => string '1310301409' (length=10)
    	  public 'last_action' => string '1310301409' (length=10)

    ```
- file.get\_files\_by\_friend Get file list by friends

    ```
    $params = array('username' => 'admin',
    				'limit' => 1,
    				'offset' => 0,
    				);
    $info = $this->client->get('wire.get_files_by_friend', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)[3]
      public '58' =>
    	object(stdClass)[4]
    	  public 'title' => string 'deploy' (length=6)
    	  public 'owner_guid' => string '43' (length=2)
    	  public 'container_guid' => string '43' (length=2)
    	  public 'access_id' => string '2' (length=1)
    	  public 'time_created' => string '1310301409' (length=10)
    	  public 'time_updated' => string '1310301409' (length=10)
    	  public 'last_action' => string '1310301409' (length=10)

    ```

### Likes

[](#likes)

- likes.add Like an entity

    ```
    $params = array('entity_guid' => 64),
    				);
    $info = $this->client->post('likes.add', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)
    	public 'success' => boolean true
    	public 'message' => string 'You now like this item' (length=22)

    ```
- likes.delete Unlike an entity

    ```
    $params = array('entity_guid' => 64),
    				);
    $info = $this->client->post('likes.add', $params);
    var_dump($info);

    ```

    ```
    object(stdClass)
    	public 'success' => boolean true
    	public 'message' =>	string 'Your like has been removed' (length=26)

    ```
- likes.count Number of likes to an entity

    ```
    $params = array('entity_guid' => 64),
    				);
    $info = $this->client->get('likes.add', $params);
    var_dump($info);

    ```

    ```
    int 3

    ```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5586240?v=4)[Sergey S.](/maintainers/serega3000)[@serega3000](https://github.com/serega3000)

### Embed Badge

![Health badge](/badges/digecon-elgg-web-services/health.svg)

```
[![Health](https://phpackages.com/badges/digecon-elgg-web-services/health.svg)](https://phpackages.com/packages/digecon-elgg-web-services)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
