How to specify your API key

As of IPHub V2, we are promoting the use of the X-Key header. Because our API keys are actually Base64-encoded strings, they’re not practical for GET parameter use as you would have to URL encode it first. Whereas, with the X-Key header, you can send the API key, as is, in your HTTP headers which also leaves you with a prettier request object. The GET parameter key is available too, but strongly discouraged for web applications.

In PHP, you’d do something like this:

$request = new HttpRequest();
	$response = $request->send();
	echo $response->getBody();

catch(HttpException $ex)
	echo $ex;

The code above was provided as a courtesy to demonstrate the use of the X-Key header, proper integration examples can be found in the integration examples chapter.