Mods are game-specific entities, so all resources in this section are game-specific themselves (see: Game-specific URL prefixes).
[TODO: Flesh this section out]
Mod public registration info/metadata resource. Contains most info about a mod, excluding only those fields that are only for the devs. Note that the game specified by the prefix must match the game that the requested mod is registered as being applicable to.
Example request:
GET /game/thd/kag/mod/shadlington/test/info HTTP/1.1
Host: api.kag2d.com
Accept: application/json
Example response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"modInfo": {
"clientRestricted": false,
"description": "This is an example mod",
"devType": "individual",
"developer": "Shadlington",
"downloadAvailable": false,
"fullRestricted": false,
"gameID": 1,
"modID": "2e6ee2d3-90eb-4772-b431-1844a06e0c53",
"name": "Example mod",
"nameURL": "example",
"registered": "2013-12-11 17:59:47",
"serverRestricted": false
}
}
Parameters: |
|
---|---|
Status Codes: |
|
Response JSON fields: | |
|
Mod private registration info/metadata resource. Has nearly all mod info (only missing the devkey). Note that the game specified by the prefix must match the game that the requested mod is registered as being applicable to.
Example request:
GET /game/thd/kag/mod/shadlington/test/devinfo HTTP/1.1
Host: api.kag2d.com
Accept: application/json
Example response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"modDevInfo": {
"clientRestricted": false,
"description": "This is an example mod",
"devType": "individual",
"developer": "Shadlington",
"developerAccessList": [
"shadlington"
],
"downloadAvailable": false,
"fullRestricted": false,
"gameID": 1,
"modID": "2e6ee2d3-90eb-4772-b431-1844a06e0c53",
"name": "Example mod",
"nameURL": "example",
"ownerList": [
"shadlington"
],
"registered": "2013-12-11 17:59:47",
"serverRestricted": false
}
}
Parameters: |
|
---|---|
Status Codes: |
|
Response JSON fields: | |
|
Mod registration/metadata update resource. Uses HTTP basic auth - the username in the authorization header must either be the individual developer specified in the URL or a member of the developer group, depending on the devType. If the devType is a group then the developer must be a registered devgroup (see devgroup resources for details). Any members listed in the ownerList/developerAccessList must already be members of the devgroup assigned as the developer. Also, the person making the change cannot remove themselves from the ownerList (only people in the ownerList are able to make PUT requests to this resource). Also, anyone who is a member of the devgroup’s own ownerList is able to make PUT requests to this resource regardless of whether or not they are already on the mod’s ownerList, but in order to do so they must add themselves to the mod ownerList. Note that the mod will be set as being applicable to the game that is specified in the prefix.
Example requests:
PUT /game/thd/kag/mod/shadlington/test/devinfo HTTP/1.1
Host: api.kag2d.com
Content-Type: application/json
{
"modInfo": {
"clientRestricted": false,
"description": "This is a test mod",
"devType": "individual",
"developer": "shadlington",
"developerAccessList": ["shadlington"],
"fullRestricted": false,
"name": "Test mod",
"nameURL": "testtttttttt",
"ownerList": ["shadlington"],
"serverRestricted": false
}
}
PUT /game/thd/kag/mod/shadlington/test/devinfo HTTP/1.1
Host: api.kag2d.com
Content-Type: application/json
{
"modInfo": {
"clientRestricted": false,
"description": "This is a test mod",
"devType": "group",
"developer": "thd",
"developerAccessList": ["mm"],
"fullRestricted": false,
"name": "Test mod",
"nameURL": "testtttttttt",
"ownerList": ["mm", "shadlington"],
"serverRestricted": false
}
}
Example response:
HTTP/1.1 200 OK
Content-Type: application/json
{}
Parameters: |
|
---|---|
Status Codes: |
|
Request JSON fields: | |
|
Mod deletion resource. Uses HTTP basic auth - the username in the authorization header must match the username of the developer in the URL. This will delete the entire mod - its registration info and any uploaded packages, if it has them.
Example request:
DELETE /game/thd/kag/mod/shadlington/test/devinfo HTTP/1.1
Host: api.kag2d.com
Example response:
HTTP/1.1 200 OK
Content-Type: application/json
{}
Parameters: |
|
---|---|
Status Codes: |
|
Mod developer key resource. Uses HTTP basic auth - the username in the authorization header must match the username of the developer in the URL. Note that the game specified by the prefix must match the game that the requested mod is registered as being applicable to. This developer key should be kept private as it is used to ‘sign’ mods. Only people on the mod’s developerAccessList can access this resource.
Example request:
GET /game/thd/kag/mod/shadlington/test/devkey HTTP/1.1
Host: api.kag2d.com
Accept: application/json
Example response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"modDevkey": "bc6abf221a7b46f660244324d2ba7d"
}
Parameters: |
|
---|---|
Status Codes: |
|
Response JSON fields: | |
|
Mod hash verification resource. Note that the game specified by the prefix must match the game that the requested mod is registered as being applicable to. If the localHash provided matches the devHash provided (after the localHash is re-hashed with the mod’s developer key as a salt) then the resource will return a validHash value of true. Otherwise, it’ll return false.
Example request:
POST /game/thd/kag/mod/shadlington/test/verifyhash HTTP/1.1
Host: api.kag2d.com
Content-Type: application/json
{
'devHash': "s7s63h4yf883",
'localHash': "sk84ufjstgh3ki"
}
Example response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"validHash": false
}
Parameters: |
|
---|---|
Status Codes: |
|
Request JSON fields: | |
|
Mod package retrieval resource. When successful (i.e. 200) the response body is a .tar.gz file. Specifically, this resource is for the whole package, including both server-specific and client-specific files. Note that the game specified by the prefix must match the game that the requested mod is registered as being applicable to. If this package type is restricted then only the developer/members of the devgroup may access this resource.
Example request:
GET /game/thd/kag/mod/shadlington/test/full HTTP/1.1
Host: api.kag2d.com
Accept: application/x-tar
Example response:
HTTP/1.1 200 OK
Content-Type: application/x-tar
Content-Encoding: gzip
[Some .tar.gz file data]
Parameters: |
|
---|---|
Status Codes: |
|
Mod package update resource. Note that the game specified by the prefix must match the game that the requested mod is registered as being applicable to. It is advised that you generate your package using a client as it must contain a registration.json file that meets several requirements in order to be accepted. Only people on the mod’s developerAccessList can update this resource.
Example request:
PUT /game/thd/kag/mod/shadlington/test/full HTTP/1.1
Host: api.kag2d.com
Content-Type: application/x-tar
[Some .tar.gz file data]
Example response:
HTTP/1.1 200 OK
Content-Type: application/x-tar
{
"statusMessage": "Mod package saved successfully"
}
Parameters: |
|
---|---|
Status Codes: |
|
Mod package retrieval resource. When successful (i.e. 200) the response body is a .tar.gz file. Specifically, this resource is for the server package, excluding any client-specific files. Note that the game specified by the prefix must match the game that the requested mod is registered as being applicable to. If this package type is restricted then only the developer/members of the devgroup may access this resource.
Example request:
GET /game/thd/kag/mod/shadlington/test/server HTTP/1.1
Host: api.kag2d.com
Accept: application/x-tar
Example response:
HTTP/1.1 200 OK
Content-Type: application/x-tar
Content-Encoding: gzip
[Some .tar.gz file data]
Parameters: |
|
---|---|
Status Codes: |
|
Mod package retrieval resource. When successful (i.e. 200) the response body is a .tar.gz file. Specifically, this resource is for the client package, excluding any server-specific files. Note that the game specified by the prefix must match the game that the requested mod is registered as being applicable to. If this package type is restricted then only the developer/members of the devgroup may access this resource.
Example request:
GET /game/thd/kag/mod/shadlington/test/client HTTP/1.1
Host: api.kag2d.com
Accept: application/x-tar
Example response:
HTTP/1.1 200 OK
Content-Type: application/x-tar
Content-Encoding: gzip
[Some .tar.gz file data]
Parameters: |
|
---|---|
Status Codes: |
|
Mod list resource. This is a list resource and therefore the notes in the introduction concerning list resources are relevant here: List type resources. Note that the mod list will be filtered down to mods registered as applicable to the game specified by the prefix.
Example URL:
/game/thd/kag/mods?filters=[{“field”: “developer”, “op”: “eq”, “value”: “Shadlington”}]&limit=5&start=10
Example request:
GET /game/thd/kag/mods HTTP/1.1
Host: api.kag2d.com
Accept: application/json
Example response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"modList": [
{
"clientRestricted": false,
"description": "This is an example mod",
"devType": "individual",
"developer": "Shadlington",
"downloadAvailable": false,
"fullRestricted": false,
"gameID": 1,
"modID": "2e6ee2d3-90eb-4772-b431-1844a06e0c53",
"name": "Example mod",
"nameURL": "example",
"registered": "2013-12-11 17:59:47",
"serverRestricted": false
},
{
anothermod (same format as above)
}
]
}
Query Parameters: | |
---|---|
|
|
Status Codes: |
|
Response JSON fields: | |
|
Mod 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. Note that the game prefix currently doesn’t do anything for this resource (though will eventually cause the resource to return only the filters relevant to the specified game).
Example request:
GET /game/thd/kag/mods/filterinfo HTTP/1.1
Host: api.kag2d.com
Accept: application/json
Example response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"modListFilterFields": [
{
"name": "gameID",
"type": "int"
},
{
"name": "name",
"type": "string"
},
{
"name": "downloadAvailable",
"type": "int"
},
{
"name": "registered",
"type": "datetime"
},
{
"name": "clientRestricted",
"type": "int"
},
{
"name": "devType",
"type": "int"
},
{
"name": "last_modified",
"type": "datetime"
},
{
"name": "serverRestricted",
"type": "int"
},
{
"name": "modID",
"type": "string"
},
{
"name": "fullRestricted",
"type": "int"
},
{
"name": "nameURL",
"type": "string"
},
{
"name": "devkey",
"type": "string"
},
{
"name": "description",
"type": "string"
},
{
"name": "developer",
"ops": "eq",
"type": "string"
}
],
"modListFilterOperators": [
{
"meaning": ">",
"name": "gt"
},
{
"meaning": "<",
"name": "lt"
},
{
"meaning": "!=",
"name": "ne"
},
{
"meaning": ">=",
"name": "ge"
},
{
"meaning": "<=",
"name": "le"
},
{
"meaning": "=",
"name": "eq"
}
]
}
Status Codes: |
|
---|---|
Response JSON fields: | |
|