photo-documentation/docs/api/PostGroupCreate.markdown
2013-01-28 22:49:14 -05:00

2.2 KiB

Create Group


  1. Purpose
  2. Endpoint
  3. Parameters
  4. Examples
  1. Response

Purpose of the create Group API

Use this API to create a group.


Endpoint

Authentication: required

POST /group/create.json

Parameters

  1. name (required), The name of the group to create
  2. members (optional), i.e. jaisen@jmathai.com,hello@openphoto.me - A comma delimited list of email addresses

Examples

Command Line (using openphoto-php)

./openphoto -p -X POST -h current.openphoto.me -e /group/create.json -F 'name=My Group' -F 'members=jaisen@jmathai.com'

PHP (using openphoto-php)

$client = new OpenPhotoOAuth($host, $consumerKey, $consumerSecret, $oauthToken, $oauthTokenSecret);
$response = $client->post("/group/create.json", array('name' => 'My Group', 'members' => 'jaisen@jmathai.com'));

Response

The response is in a standard response envelope.

  • message, A string describing the result. Don't use this for anything but reading.
  • code, 200 on success
  • result, A Group object or FALSE on error

Sample

{
  "message":"",
  "code":200,
  "result":
  {
    id: 'a',
    appId: 'current.openphoto.me',
    name: 'My Group',
    members: ['jaisen@jmathai.com','hello@openphoto.me']
  }
}