Podling API Documentation

Group

Administrators

A Group has one administrator (User). The Administrators may:

The creator of the Group immediately becomes the Administrator.

Name Slugs

A Group is referenced in a URI with the group's 'slug'; a string which is derived from the Group's name and ID. Slugs are returned with Group representations. E.g. a Group with name "Citizen Family" could be shown via the URI api/v1/14-citizen-family

Subresources: Conversations

Creating Groups

Example: Creating Groups authenticated as User creates group.

Request
POST /api/v1/groups HTTP/1.1
Host: podling.com
Authorization: Bearer accesstoken51
Content-Type: application/json; charset=utf-8

{
  "name": "A Group!"
}
Reponse
HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8
ETag: "7e554b9fdb2a0ddf141e738710c0ee99"
Cache-Control: max-age=0, private, must-revalidate
Content-Length: 140

{
  "id": 1583,
  "name": "A Group!",
  "slug": "1583-a-group",
  "created_at": "2013-02-28T07:19:20Z",
  "updated_at": "2013-02-28T07:19:20Z",
  "member_count": 1
}
Back to top

Deleting Groups

Example: Deleting Groups as a group administrator deletes the Group, Conversations, GroupMemberships.

Request
DELETE /api/v1/groups/1589-group-73 HTTP/1.1
Host: podling.com
Authorization: Bearer accesstoken56
Reponse
HTTP/1.1 204 No Content
Cache-Control: no-cache
Back to top

Listing Groups

Example: Listing Groups with user authentication only lists groups of which the user is a member.

Request
GET /api/v1/groups HTTP/1.1
Host: podling.com
Authorization: Bearer accesstoken62
Reponse
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
ETag: "d84467ada7a74ce125887f2ac7e29bf3"
Cache-Control: max-age=0, private, must-revalidate
Content-Length: 143

[
  {
    "id": 1596,
    "name": "Group 80",
    "slug": "1596-group-80",
    "created_at": "2013-02-28T07:19:20Z",
    "updated_at": "2013-02-28T07:19:20Z",
    "member_count": 1
  }
]
Back to top