Facedeck API v0

Routes:

http://facedeck-dev.tech.northwestern.edu

To access any of these routes you need to set the APIKEY header to your key. All netids are validated with the IdentityMapper api, and an invalid netid will throw a 500. There are not currently good error messages for this but they will be implemented.

1. Index: get "/api/groups"

Request

Empty!

Response

Returns an array of json objects representing groups like this:

[
   {
      "id":37,
      "name":"Example 1",
      "members":[
         "lwl2489",
         "meo6230",
         "egs8325"
      ],
      "accessors":[
         "idh377",
         "lgd1141"
      ]
   },
   {
      "id":38,
      "name":"Example 2",
      "members":[
         "slv7005",
         "glz9373",
      ],
      "accessors":[
         "idh377",
         "lgd1141"
      ]
   },
   ....
]

2. New: post "/apis/groups"

Request

Create (or replaces) a group. Here is an example valid post body to create/replace a group:

{
  "name": "Example 2",
  "accessors": [
    "idh377",
    "lgd1141"
  ],
  "members": [
    "egs8325",
    "meo6230",
    "lwl2489",
    "lgd1141",
    "pwh771",
    "jcj3730",
    "glz9373",
    "slv7005"
  ]
}

Response

The api will return your group + an id.

1
2
3
4
5
6
{
  "id": 1,
  "name": "Example 2",
  "accessors": [
   ...
}

3. Destroy: post "/api/groups/destroy"

Request

This destroys a group, a valid post body looks like this:

1
2
3
{
  "name": "Example 1"
}

or like this:

1
2
3
{
  "id": 40
}

Response

The api will return the following for a valid request

1
2
3
4
{
    "msg": "Removed group",
    "name": "Example 1"
}

That's it!

Edit
Pub: 08 Aug 2019 20:34 UTC
Views: 1250