Devgroups

Devgroups are currently mainly for use in conjunction with mods (for those mods that are developed by groups instead of individuals) but are also used by games, forming the developer part of game URLs.

Because devgroups are used interchangeably with individual player usernames, they share the same namespace as usernames, and as such you cannot have a devgroup that is the same as an existing player username, and the allowed character rules are also the same.

Devgroups really only have two main fields besides their name - the member list and owner list. The member list is self-explanatory, and the owner list grants specified members (they must also be members, naturally) the right to edit the devgroup and override the owner lists of mods managed by the devgroup.

GET /devgroup/(groupname)/info

Devgroup info resource.

Example request:

GET /devgroup/thd/info HTTP/1.1
Host: api.kag2d.com
Accept: application/json

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "devgroupInfo": {
    "devgroupID": "0aaf8030-91ec-11e3-baa8-0800200c9a66",
    "memberList": [
      "flieslikeabrick",
      "furai",
      "geti",
      "jrgp",
      "mm",
      "roland",
      "shadlington"
    ],
    "name": "THD",
    "ownerList": [
      "flieslikeabrick",
      "furai",
      "geti",
      "jrgp",
      "mm",
      "roland",
      "shadlington"
    ],
    "registered": "2013-12-11 00:00:00"
  }
}
Parameters:
  • groupname – the devgroup’s name
Status Codes:
  • 200 – when the devgroup exists
  • 404 – when the devgroup doesn’t exist
Response JSON fields:
 
  • name The devgroup’s name

  • devgroupID The devgroup’s ID

  • memberList An Array of the members of the devgroup (player

    usernames)

  • ownerList An Array of the members of the devgroup that are

    allowed to manage the devgroup.

  • registered Registration time, format: YYYY-MM-DD hh:mm:ss

PUT /devgroup/(groupname)/info

Devgroup update resource. Uses HTTP basic auth - the username in the authorization header must be within the ownerList of the group being updated. Any members listed in the ownerList must also be in the memberList, and you cannot take yourself off of the ownerList. You cannot change the devgroup name once it has been set.

Example requests:

PUT /devgroup/thd/info HTTP/1.1
Host: api.kag2d.com
Content-Type: application/json

{
  "devgroupInfo": {
    "memberList": [
      "flieslikeabrick",
      "furai",
      "geti",
      "jrgp",
      "mm",
      "roland",
      "shadlington"
    ],
    "name": "THD",
    "ownerList": [
      "flieslikeabrick",
      "furai",
      "geti",
      "jrgp",
      "mm",
      "roland",
      "shadlington"
    ]
  }
}

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{}
Parameters:
  • groupname – the devgroup’s name
Status Codes:
  • 200 – when the devgroup update is successful
  • 400 – when there is anything invalid about the request body
  • 401 – when the authorization headers are missing/invalid
  • 403 – when the auth header username isn’t an owner of the devgroup or you try to remove yourself from the ownerList, or you try to change the devgroup name
Request JSON fields:
 
  • devgroupInfo Same as for the devgroup info GET resource
DELETE /devgroup/(groupname)/info

Devgroup deletion resource. Uses HTTP basic auth - the username in the authorization header must be within the ownerList of the group being deleted. This will delete the entire devgroup and any mods that are associated with it.

Example request:

DELETE /devgroup/thd/info HTTP/1.1
Host: api.kag2d.com

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{}
Parameters:
  • groupname – the devgroup’s name
Status Codes:
  • 200 – when the devgroup exists and the deletion is successful
  • 401 – when the authorization headers are missing/invalid
  • 403 – when the auth header username isn’t an owner of the devgroup
  • 404 – when the devgroup doesn’t exist
GET /devgroups

Devgroup list resource. This is a list resource and therefore the notes in the introduction concerning list resources are relevant here: List type resources.

Special filter: If you specify a filter with the field ‘hasMember’ and give a player username as the value (the operator is always eq) then the devgroup list will be filtered to devgroups that have that player as one of the people in their memberList.

Example URL:

/devgroups?filters=[{“field”: “hasMember”, “value”: “Shadlington”}]&limit=5&start=10

Example request:

GET /devgroups HTTP/1.1
Host: api.kag2d.com
Accept: application/json

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "devgroupList": [
    {
      "devgroupID": "0aaf8030-91ec-11e3-baa8-0800200c9a66",
      "memberList": [
        "flieslikeabrick",
        "furai",
        "geti",
        "jrgp",
        "mm",
        "roland",
        "shadlington"
      ],
      "name": "THD",
      "ownerList": [
        "flieslikeabrick",
        "furai",
        "geti",
        "jrgp",
        "mm",
        "roland",
        "shadlington"
      ],
      "registered": "2013-12-11 00:00:00"
    },
    {
      anotherdevgroup (same format as above)
    }
  ]
}
Query Parameters:
 
  • start (variable) – which devgroup list result to start from
  • limit (variable) – how many devgroups to retrieve from the list
  • filters (variable) – The filters to apply to the devgroup list
Status Codes:
  • 200 – most of the time
  • 400 – when the filters/limit/start are invalid in any way
Response JSON fields:
 
  • devgroupList List of devgroups that match the filter criteria

    provided. Contents are the same as for the devgroup info resource.

GET /devgroups/filterinfo

Devgroup list filter info resource This is a list filterinfo resource and therefore the notes in the introduction concerning list resources are relevant here: List type resources.

Example request:

GET /devgroups/filterinfo HTTP/1.1
Host: api.kag2d.com
Accept: application/json

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "devgroupListFilterFields": [
    {
      "name": "registered",
      "type": "datetime"
    },
    {
      "name": "devgroupID",
      "type": "string"
    },
    {
      "name": "name",
      "type": "string"
    },
    {
      "name": "last_modified",
      "type": "datetime"
    },
    {
      "name": "hasMember",
      "ops": "eq",
      "type": "string"
    }
  ],
  "devgroupListFilterOperators": [
    {
      "meaning": ">",
      "name": "gt"
    },
    {
      "meaning": "<",
      "name": "lt"
    },
    {
      "meaning": "!=",
      "name": "ne"
    },
    {
      "meaning": ">=",
      "name": "ge"
    },
    {
      "meaning": "<=",
      "name": "le"
    },
    {
      "meaning": "=",
      "name": "eq"
    }
  ]
}
Status Codes:
  • 200 – always (ideally)
Response JSON fields:
 
  • devgroupListFilterFields The fields that you can filter the

    devgroup list by, with their types

  • devgroupListFilterOperators The operators that you can filter

    the devgroup list with, with their meanings (underlying operator)

Related Topics