{"__v":1,"_id":"5707ead0992be0170027ccd4","category":{"__v":0,"_id":"5705b12221cfed0e00e8c580","project":"56abbf55f25f160d00e17f4e","version":"56abbf55f25f160d00e17f51","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-04-07T01:00:18.230Z","from_sync":false,"order":4,"slug":"server-side-api","title":"Server Side API"},"editedParams":true,"editedParams2":true,"parentDoc":null,"project":"56abbf55f25f160d00e17f4e","user":"56abbec30b9e0b0d00616274","version":{"__v":12,"_id":"56abbf55f25f160d00e17f51","project":"56abbf55f25f160d00e17f4e","createdAt":"2016-01-29T19:36:53.665Z","releaseDate":"2016-01-29T19:36:53.665Z","categories":["56abbf56f25f160d00e17f52","56abca6bf9757e0d007c6650","56acddfa0ab3c00d00ce3332","56af65da9d32e30d0006d30f","56af66cab34d210d003d9ad0","56af6afcd21e9c0d00b628d1","56af6d6ecc4cbd0d00ce2c88","5705b12221cfed0e00e8c580","570a5676ade45d0e00c1ad33","570d7d25d1e4b82000d9e385","570eac3c3160d10e0041df0e","575709000fd6a3200010dded"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-04-08T17:30:56.792Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":"curl -XPOST -H \"Content-type: application/json\" -d '{\n  \"api_key\": \"GAMEAPIKEY\",\n  \"user_id\": 426367,\n  \"server_identifier\": \"101\",\n  \"server_name\": \"Gotham01\",\n  \"character_identifier\": \"12582\",\n  \"character_name\": \"Batman\",\n  \"guild_identifier\": \"234\",\n  \"guild_name\": \"JusticeLeague\",\n  \"guild_admin_level\": \"admin\"\n}' 'https://api.kongregate.com/api/characters.json'","language":"curl","name":"Add Admin to Guild"},{"name":"Remove Character From Guild","language":"json","code":"curl -XPOST -H \"Content-type: application/json\" -d '{\n  \"api_key\": \"GAMEAPIKEY\",\n  \"user_id\": 426367,\n  \"server_identifier\": \"101\",\n  \"server_name\": \"Gotham01\",\n  \"character_identifier\": \"12582\",\n  \"character_name\": \"Batman\"\n}' 'https://api.kongregate.com/api/characters.json'"},{"code":"curl -XPOST -H \"Content-type: application/json\" -d '{\n  \"api_key\": \"GAMEAPIKEY\",\n  \"user_id\": 426367,\n  \"server_identifier\": \"101\",\n  \"server_name\": \"Gotham01\",\n  \"character_identifier\": \"12582\",\n  \"character_name\": \"Batman\",\n  \"guild_identifier\": \"234\",\n  \"guild_name\": \"JusticeLeague\"\n}' 'https://api.kongregate.com/api/characters.json'","language":"json","name":"Revoke Guild Admin"}]},"method":"post","results":{"codes":[{"name":"Add Admin to Guild","code":"{\n  \"success\": true,\n  \"user_id\": 426367,\n  \"server_identifier\": \"101\",\n  \"guild_identifier\": \"234\",\n  \"character_identifier\": \"12582\"\n}","language":"json","status":200},{"name":"Remove Character From Guild","status":200,"language":"json","code":"{\n  \"success\": true,\n  \"user_id\": 426367,\n  \"server_identifier\": \"101\",\n  \"guild_identifier\": null,\n  \"character_identifier\": \"12582\"\n}"},{"code":"{\n  \"success\": true,\n  \"user_id\": 426367,\n  \"server_identifier\": \"101\",\n  \"guild_identifier\": \"234\",\n  \"character_identifier\": \"12582\"\n}","language":"json","status":200,"name":"Revoke Guild Admin"}]},"settings":"5707e879cfc0992200c2a419","auth":"required","params":[{"_id":"5707ead0992be0170027ccdd","ref":"","in":"body","required":true,"desc":"Your private API key","default":"","type":"string","name":"api_key"},{"_id":"5707ead0992be0170027ccda","ref":"","in":"body","required":true,"desc":"Unique (per-server) identifier for the user","default":"","type":"string","name":"character_identifier"},{"_id":"5707ead0992be0170027ccd9","ref":"","in":"body","required":true,"desc":"Display name for the user","default":"","type":"string","name":"character_name"},{"_id":"5707ead0992be0170027ccdc","ref":"","in":"body","required":false,"desc":"Unique identifier for the server the guild exists on","default":"Default","type":"string","name":"server_identifier"},{"_id":"5707ead0992be0170027ccdb","ref":"","in":"body","required":false,"desc":"Display name for the server the guild exists on","default":"Default","type":"string","name":"server_name"},{"_id":"5707ead0992be0170027ccd8","ref":"","in":"body","required":false,"desc":"Unique (per-server) identifier for the guild","default":"","type":"string","name":"guild_identifier"},{"_id":"5707ead0992be0170027ccd7","ref":"","in":"body","required":false,"desc":"Display name for the guild","default":"","type":"string","name":"guild_name"},{"_id":"5707ead0992be0170027ccd6","ref":"","in":"body","required":false,"desc":"The Kongregate user id (if any) of the user","default":"","type":"int","name":"user_id"},{"_id":"5707ead0992be0170027ccd5","ref":"","in":"body","required":false,"desc":"Set to superadmin or admin to grant privileges","default":"","type":"string","name":"guild_admin_level"}],"url":"/characters.json"},"isReference":true,"order":3,"body":"### Adding a Character to a Guild\n\nAdding a player's character to a guild is handled by a call to `/characters.json`. In the case that a character is added to a guild that has not been created yet, this call will have the side effect of creating that guild.\n\nThere are three types of guild members:\n\n*   **Admin**: Can lock, sticky, edit, and hide forum posts in the guild forum. We suggest giving guild officers an admin status.\n*   **Superadmin**: Currently has the same permissions as a regular admin, but we may change that later. It would be best to restrict this to the owner of a guild.\n*   **Member**: Has access to and can post in guild chat and forums. To denote a character as a member, don't pass the `guild_admin_level` parameter when adding the character to the guild.\n\n### Removing a Character from a Guild\n\nIn the case that a user leaves a guild, or is booted from one, that user should no longer have access to guild specific forums or chat. The call to remove a character is almost identical to the call to add a character, except the `guild_identifier` and `guild_name` shouldn't be submitted at all (or alternatively submitted as empty strings).\n\n### Revoking a Character's Superadmin or Admin Status\n\nYou can revoke a user's Superadmin or Admin status similarly with a call that resubmits the all of the character's guild parameters the same, except without the `guild_admin_status` parameter.","excerpt":"Creates/manages game characters for use with guilds","slug":"server-api-characters","type":"endpoint","title":"Characters"}

postCharacters

Creates/manages game characters for use with guilds

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

api_key:
required
string
Your private API key
character_identifier:
required
string
Unique (per-server) identifier for the user
character_name:
required
string
Display name for the user
server_identifier:
stringDefault
Unique identifier for the server the guild exists on
server_name:
stringDefault
Display name for the server the guild exists on
guild_identifier:
string
Unique (per-server) identifier for the guild
guild_name:
string
Display name for the guild
user_id:
integer
The Kongregate user id (if any) of the user
guild_admin_level:
string
Set to superadmin or admin to grant privileges

Examples


Result Format


Documentation

### Adding a Character to a Guild Adding a player's character to a guild is handled by a call to `/characters.json`. In the case that a character is added to a guild that has not been created yet, this call will have the side effect of creating that guild. There are three types of guild members: * **Admin**: Can lock, sticky, edit, and hide forum posts in the guild forum. We suggest giving guild officers an admin status. * **Superadmin**: Currently has the same permissions as a regular admin, but we may change that later. It would be best to restrict this to the owner of a guild. * **Member**: Has access to and can post in guild chat and forums. To denote a character as a member, don't pass the `guild_admin_level` parameter when adding the character to the guild. ### Removing a Character from a Guild In the case that a user leaves a guild, or is booted from one, that user should no longer have access to guild specific forums or chat. The call to remove a character is almost identical to the call to add a character, except the `guild_identifier` and `guild_name` shouldn't be submitted at all (or alternatively submitted as empty strings). ### Revoking a Character's Superadmin or Admin Status You can revoke a user's Superadmin or Admin status similarly with a call that resubmits the all of the character's guild parameters the same, except without the `guild_admin_status` parameter.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}