{"_id":"571127ebade1470e008463dc","user":"56abbec30b9e0b0d00616274","editedParams2":true,"parentDoc":null,"version":{"_id":"56abbf55f25f160d00e17f51","project":"56abbf55f25f160d00e17f4e","__v":12,"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"},"__v":0,"category":{"_id":"5705b12221cfed0e00e8c580","project":"56abbf55f25f160d00e17f4e","__v":0,"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,"project":"56abbf55f25f160d00e17f4e","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-04-15T17:42:03.685Z","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  \"game_auth_token\": \"GAMEAUTHTOKEN\",\n  \"user_id\": 32,\n  \"id\": \"MySharedLink\",\n  \"link_params\": \"kv_test=foo%26kv_test2=bar&name=Joe%27s%20Dragon\",\n  \"expiration\": 1448844315,\n  \"kv_params\": \"{\\\"Difficulty\\\":\\\"Hard\\\",\\\"Total HP\\\":8675309}\"\n}' 'https://api.kongregate.com/api/shared_links/create.json'","language":"curl","name":"Create a Shared Link"}]},"method":"post","results":{"codes":[{"code":"{\n  \"success\": true\n}","language":"json","status":200,"name":"Create a Shared Link"}]},"settings":"5707e879cfc0992200c2a419","auth":"required","params":[{"_id":"571127ebade1470e008463e5","ref":"","in":"body","required":true,"desc":"Your private API key","default":"","type":"string","name":"api_key"},{"_id":"571127ebade1470e008463e4","ref":"","in":"body","required":true,"desc":"The game_auth_token for the game/user combination","default":"","type":"string","name":"game_auth_token"},{"_id":"571127ebade1470e008463e3","ref":"","in":"body","required":true,"desc":"User id of the user","default":"","type":"int","name":"user_id"},{"_id":"571127ebade1470e008463e2","ref":"","in":"body","required":true,"desc":"Unique identifier of the event in your system","default":"","type":"string","name":"id"},{"_id":"571127ebade1470e008463e1","ref":"","in":"body","required":true,"desc":"Name of the link","default":"","type":"string","name":"name"},{"_id":"571127ebade1470e008463e0","ref":"","in":"body","required":true,"desc":"A type or category for the link that can be used for filtering","default":"","type":"string","name":"type"},{"_id":"571127ebade1470e008463df","ref":"","in":"body","required":true,"desc":"URL-encoded parameters to pass into the game frame. Only parameters starting with `kv_` will be passed through","default":"","type":"string","name":"link_params"},{"_id":"571127ebade1470e008463de","ref":"","in":"body","required":true,"desc":"UNIX timestamp for when the link should no longer be shown to users","default":"","type":"int","name":"expiration"},{"_id":"571127ebade1470e008463dd","ref":"","in":"body","required":false,"desc":"Optional JSON encoded string of an object containing extra information about the link","default":"","type":"string","name":"kv_params"}],"url":"/shared_links/create.json"},"isReference":true,"order":14,"body":"The above example creates new shared link, in this case a raid called \"Joe's Dragon\" that has a \"Dragon\" type and expires Monday, November 30th 2015, 00:45:15 (GMT). Additionally, if we expand the raid link we will discover that it has a difficulty rating of \"Hard\" and has 867,5309 hit points. \n\nOne point of potential confusion to note: `kv_params` is a specific set of key-values that we (Kongregate) will process. On the other hand, the `link_params`, which also need to be prefaced with `kv_` but need to have the &'s encoded as `%26`, are what will be passed in to the iframe (in this case, `kv_test` and `kv_test2`).","excerpt":"Create a shared link","slug":"server-api-create-shared-link","type":"endpoint","title":"Shared Links - Create"}

postShared Links - Create

Create a shared link

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

api_key:
required
string
Your private API key
game_auth_token:
required
string
The game_auth_token for the game/user combination
user_id:
required
integer
User id of the user
id:
required
string
Unique identifier of the event in your system
name:
required
string
Name of the link
type:
required
string
A type or category for the link that can be used for filtering
link_params:
required
string
URL-encoded parameters to pass into the game frame. Only parameters starting with `kv_` will be passed through
expiration:
required
integer
UNIX timestamp for when the link should no longer be shown to users
kv_params:
string
Optional JSON encoded string of an object containing extra information about the link

Examples


Result Format


Documentation

The above example creates new shared link, in this case a raid called "Joe's Dragon" that has a "Dragon" type and expires Monday, November 30th 2015, 00:45:15 (GMT). Additionally, if we expand the raid link we will discover that it has a difficulty rating of "Hard" and has 867,5309 hit points. One point of potential confusion to note: `kv_params` is a specific set of key-values that we (Kongregate) will process. On the other hand, the `link_params`, which also need to be prefaced with `kv_` but need to have the &'s encoded as `%26`, are what will be passed in to the iframe (in this case, `kv_test` and `kv_test2`).

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 }}