Warning: This documentation is in early alpha and may not work properly, if you have any issues getting setup, email api@kaped.io for help. Additionally, make sure you test your build in our sandbox environment first before putting it in production!
You are responsible for all custom development and what you choose to release. KAPED accepts no liability for faulty builds, loss, or damage that stems from a custom solution designed by you!
Prerequisite
Get your API keys
Your API requests are authenticated using API keys. Any request that doesn't include an API key will return an error.
After testing your build in the sandbox environment, you can request an API key by emailing api@kaped.io with the subject line "API Key Request".
Use the same email from signup
Any events created by you will return an error if you do not use the same email address that is linked to your account (AKA: the email used to signup)
Get Bearer token from Login API
The Bearer Token is needed for all API calls with the exception of the Login API.
To make your first request, send an authenticated request to the login-token endpoint. This will create a bearer token
, which is nice.
Take a look at how you might call this method using our official libraries, or via curl
:
curl Java Obj-C Javascript C# PHP
Copy curl -X POST\
-H "Content-Type: application/json"\
"https://api.kaped.io/partner/login-token"
Copy // require the partner-api module and set it up with your API key
import io . swagger . client . * ;
import io . swagger . client . auth . * ;
import io . swagger . client . model . * ;
import io . swagger . client . api . RESTCallsApi ;
import java . io . File ;
import java . util . * ;
public class RESTCallsApiExample {
public static void main ( String [] args) {
RESTCallsApi apiInstance = new RESTCallsApi() ;
Login body = {
"username" : "partner@kaped.io"
}; // Login |
String apiKey = apiKey_example; // String |
try {
apiInstance . loginTokenPost (body , apiKey);
} catch ( ApiException e) {
System . err . println ( "Exception when calling RESTCallsApi#loginTokenPost" );
e . printStackTrace ();
}
}
}
Copy Login *body = {
"username" : "partner@kaped.io"
}; //
String *apiKey = apiKey_example; //
RESTCallsApi *apiInstance = [[RESTCallsApi alloc] init];
// Login
[apiInstance loginTokenPostWith:body
apiKey:apiKey
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error: %@", error);
}
}];
Copy var KapedPartnerApi = require ( 'kaped_partner_api' );
var api = new KapedPartnerApi .RESTCallsApi ()
var body = {
"username" : "partner@kaped.io"
}; // {{Login}}
var apiKey = apiKey_example; // {{String}}
var callback = function (error , data , response) {
if (error) {
console .error (error);
} else {
console .log ( 'API called successfully.' );
}
};
api .loginTokenPost (bodyapiKey , callback);
Copy using System ;
using System . Diagnostics ;
using IO . Swagger . Api ;
using IO . Swagger . Client ;
using IO . Swagger . Model ;
namespace Example
{
public class loginTokenPostExample
{
public void main ()
{
var apiInstance = new RESTCallsApi ();
var body = new Login (); // Login |
var apiKey = apiKey_example; // String |
try
{
// Login
apiInstance . loginTokenPost (body , apiKey);
}
catch ( Exception e)
{
Debug . Print ( "Exception when calling RESTCallsApi.loginTokenPost: " + e . Message );
}
}
}
}
Copy <? php
require_once ( __DIR__ . '/vendor/autoload.php' );
$api_instance = new Swagger \ Client \ ApiRESTCallsApi ();
$body = {
"username" : "partner@kaped.io"
}; // Login |
$apiKey = apiKey_example; // String |
try {
$api_instance -> loginTokenPost ( $body , $apiKey ) ;
} catch ( Exception $e) {
echo 'Exception when calling RESTCallsApi->loginTokenPost: ' , $e -> getMessage (), PHP_EOL ;
}
?>