Hackle Proxy API

An API, otherwise known as Application Programming Interface, is an intermediary software that allows two applications to communicate with one another. This document provides and describes the API used for calling the Hackle Proxy.

📘

Prerequisites

You need to install the Hackle Proxy in order to use the APIs.

Common Headers

To call the Hackle Proxy server, the SDK Key must be entered in the Header value. An error will occur if there is no SDK Key or the registered SDK_KEYS key is different from the input value when the Proxy server was first installed.

X-HACKLE-SDK-KEY: {YOUR_SDK_KEY}

API

1. Variation

The Variation API determines which Variation or version of the page to expose to a specific user.

POST /api/v1/variation

1.1 Request

{
  "experimentKey" : number,
  "userId" : string
}

1.2 Response

Response status code : 200

Body

{
  "variation" : string // A, B, C, D, E, F, G, H, I, J
}

In the case of an error, you can troubleshoot your API problem with the response code below.

  • 400 : Bad Request - Occurs when the content of the request does not exist or the format is not correct.
  • 401 : Unauthorized - Occurs when SDK_KEY does not exist or does not match in the header.
  • 500 : Internal Server Error

2. Track

The Track API is used to track user events.

POST /api/v1/track

2.1 Request

{
  "eventKey" : string,
  "userId" : string,
  "value" : number // Optional (default=0.0)
}

2.2 Response

Response status code : 202
In the case of an error, you can troubleshoot your API problem with the response code below.

  • 400 : Bad Request - Occurs when the content of the request does not exist or the format is not correct.
  • 401 : Unauthorized - Occurs when SDK_KEY does not exist or does not match in the header.
  • 500 : Internal Server Error

Did this page help you?