Kongregate Web Services APIThe Kongregate Web Services API is designed to allow you to integrate your existing game server with the Kongregate back end. This integration allows the user to log into your game automatically while playing on Kongregate, removing the need to create a separate account. This leads to a more seamless experience, which typically leads to many more gameplays and a higher rating. Note that for now, all web services are designed only for server-to-server purposes, as using them from the client would expose your api_key. We hope to make some of these services available to the client in the near future. Kongregate Client APIIn order to use the web services API, it is required that you implement the Kongregate Client API which will allow you to retrieve information about the player such as their user id and game authentication token. Game API KeysAll web requests require an API key. You can find information on retrieving your key here Game Authentication TokensAuthentication tokens are used for validating that a Kongregate user is who they claim to be. These tokens are unique per-user and per-game. Certain actions such as authentication and using items require this token in order to complete successfully. Note that tokens will change occasionally, for example when the user changes their password, so you cannot assume that it will be constant for a user. Client Integration
The user's kongregate.services.getUserId(); kongregate.services.getGameAuthToken();
Your game client can then pass the Ideally, your server application should hold on to this token while the user is connected so that it can be retrieved from memory whenever it is needed. You will need to re-authenticate the token each time the user logs in. HTTP responses
The HTTP status codes will be 200 as long as there is not an internal server error or a scheduled downtime. All requests return JSON strings - there's sure to be a JSON parsing library for your programming language. Every request has a HTTP CallbacksYou can specify an API callback URL to receive notifications when certain events happen on Kongregate. The documentation for API callbacks can be found here Getting Started With Authentication/KredsTo get started, please read this document about the steps required for integrating authentication and microtransactions. Services |