gs.auth.token Documentation

Author:Michael JasonSmith
Contact:Michael JasonSmith <mpj17@onlinegroups.net>
Date:2015-06-18
Organization:GroupServer.org
Copyright:This document is licensed under a Creative Commons Attribution-Share Alike 4.0 International License by OnlineGroups.net.

This product provides an API to allow people to be added to a GroupServer group, without an invitation being sent [1]. There are two slight variants:

  • One is a web hook, designed to be used by external systems.
  • The other requires a cookie for authentication, and is designed to be used by the JavaScript on GroupServer pages

Contents:

Web hook

Synopsis

/gs-group-member-add.json? token =<t> & groupId =<g> & email =<e> & fn =<n> [& biography =<b>] [& tz =<t>] & add

Description

The web hook gs-group-member-add.json, in the site context, adds a person to a group on the site.

  • If the person is new to the system then a profile is created and the person is added to the group.
  • If the person already has a profile then they are just added to the group.
  • Otherwise an error is raised (see Returns).

Required arguments

token=<token>

The authentication token [1]

groupId=<groupId>

The identifier for the group that the person is joining.

email=<address>

The email address of the new group member. The email address is used as the identifier for the person (see Returns):

  • If the email has never been seen by the system then a new profile is created,
  • Otherwise an existing profile is added to the group.
fn=<name>

The name of the new member.

add

The action (no value needs to be set, but the argument must be present).

Optional arguments

biography=<bio>

The HTML-formatted biography for the new member.

tz=<tz>:

The timezone for the new member.

Note:Unlike the cookie version (see Cookie), the web hook can only handle the basic GroupServer profile information. This is because the hook is in the context of the site rather than the context of a group (because the hook is visible to the public, but the group may be secret) and groups can have specific settings.

Returns

On completion a JSON object is returned. In the returned object the status and message fields are always set, with the user field usually set.

class Returns()
status
  • 0: success, as a profile was created and the person was added to the group.
  • 1: success, as a person with an existing profile was added to the group.
  • 256: failure, as the person was already a group member.
  • 257: unexpected failure.
message

A message explaining the status.

user

In the case that a new member was added to the group, or the person was already a member of the group (the statuses 0, 1, and 256) then the user property will be set with the standard user-property values set (see the core web-hook documentation).

Example

Add a person with the name A Person and the email a.person@home.example.com to the test group on groups.example.com using wget.

$ wget http://groups.example.com/gs-group-member-add.json \
  --post-data='token=Fake&groupId=test&email=a.person@home.example.com@fn=A%20Person&add'
[1]See gs.auth.token for more information <https://github.com/groupserver/gs.auth.token>

Changelog

2.0.0 (2015-06-17)

  • Adding a web hook
  • Adding Sphinx documentation

1.1.0 (2014-01-28)

  • Sanitising the addresses before returning them
  • Updating the product metadata

1.0.0 (2014-01-10)

Initial version, forked off gs.group.member.add.base and using the same API as gs.group.member.invite.json. Prior to the creation of this product people could only be added to groups using HTML forms.

Indices and tables

Resources

[1]The equivalent for inviting people is provided by gs.group.member.add.json <https://github.com/groupserver/gs.group.member.add.json>