Step 1: Obtain authorization

To subscribe to webhooks, you must first obtain client authorization via OAuth. You will be requesting these credentials on the behalf of your own application, so there will be no OAuth permissions dialog; you are only required to provide your client_id and client_secret.

To generate an application access token, you’ll need to initiate a POST request to in our Sandbox environment or in our production environment. The request must include a Content-Type header with the value of application/x-www-form-urlencoded.

Example request

Content-Type: application/x-www-form-urlencoded

# Provide example using K2Connect
import k2connect

k2connect.initialize(CLIENT_ID, CLIENT_SECRET, BASE_URL)
token_service = k2connect.Tokens
access_token_request = token_service.request_access_token()
access_token = token_service.get_access_token(access_token_request)
const options = {
  clientId: 'YOUR_CLIENT_ID',
  clientSecret: 'YOUR_CLIENT_SECRET',
  apiKey: 'YOUR_API_KEY',
  baseUrl: ''

//Including the kopokopo module
var K2 = require("k2-connect-node")(options)

const TokenService = K2.TokenService

    .then(response => {
        //Developer can decide to store the token_details and track expiry
    .catch( error => {
# Provide example using K2Connect
k2_token =, CLIENT_SECRET)
 access_token = k2_token.request_token 
use Kopokopo\SDK\K2;

// Do not hardcode these values
$options = [
    'clientId' => 'YOUR_CLIENT_ID',
    'clientSecret' => 'YOUR_CLIENT_SECRET',
    'apiKey' => 'YOUR_API_KEY',
    'baseUrl' => ''
$K2 = new K2($options);

// Get one of the services
$tokens = $K2->TokenService();

// Use the service
$result = $tokens->getToken();
if($result['status'] == 'success'){
    $data = $result['data'];
    echo "My access token is: ".$data['access_token'];
    echo "It expires in: ".$data['expires_in'];