API usage examples

cURL

Example using cURL from the command line:

$ curl -u YOUR_API_KEY: https://kantree.io/api/1.0/me

Swagger client in Javascript

Example using the Swagger client:

<html>
    <head>
        <script src="https://cdn.rawgit.com/swagger-api/swagger-js/2.x/browser/swagger-client.min.js"></script>
        <script>
            var client = new SwaggerClient({
                url: "https://kantree.io/api/1.0/spec.json",
                authorizations: {
                    api_key: new SwaggerClient.PasswordAuthorization(YOUR_API_KEY, "")
                },
                success: function() {
                    client.setSchemes(['https']); // must use https
                    client.user.get_info({}, function(info) {
                        // ...
                    });
                }
            });
        </script>
    </head>
    <body>
    </body>
</html>