Awrrr, I'm sorry – the api documentation is not ready yet.
Example API-Request with PHP
<?php
define('api_user', 'yourApiUser'); // Enter your api username here
define('api_secret', 'verySecretCode'); // Enter your api secret here
$uri = 'http://api.k9hood.com/CreateHood';
$curlRequest = curl_init();
curl_setopt($curlRequest, CURLOPT_POST, 1);
curl_setopt($curlRequest, CURLOPT_HEADER, false);
curl_setopt($curlRequest, CURLOPT_POSTFIELDS, http_build_query([
'user' => api_user,
'secret' => api_secret,
'hood' => [
'modelVariant' => 'k9neo2019',
'configuration' => [
'hoodBaseColor' => 'smooth',
'hoodCrownColor' => 'smooth',
'hoodChinColor' => 'nylon',
'lipColor' => 'nylon',
'bridgeColor' => 'nylon',
'earType' => 'pointed',
'earColorA' => 'gray',
'earColorB' => 'smooth',
'earColorC' => 'nylon',
'eyebrowType' => 'double',
'eyebrowColor' => 'gray',
'muzzleType' => 'default',
'muzzleColor' => 'nylon',
'nose' => 'nylon',
'jowl' => false,
'additionalStyleType' => 'whiskers',
'additionalStyleTypeColor' => 'orange',
'jowlTopSnapColor' => 'snapsilver',
'jowlBottomSnapColor' => 'snapsilver'
]
]
]));
curl_setopt($curlRequest, CURLOPT_URL, $uri);
curl_setopt($curlRequest, CURLOPT_RETURNTRANSFER, 1);
$response = json_decode(curl_exec($curlRequest), 1);
?>
<img src="data:image/png;base64,<?php echo $response['hood']['renderingObject']; ?>" />';
Available hood colors
Key |
Color |
red |
Red |
hunter |
Hunter Green |
yellow |
Yellow |
lime |
Lime Green |
orange |
Orange |
brown |
Brown |
navy |
Navy Blue |
royal |
Royal Blue |
cobalt |
Cobalt Blue |
aqua |
Aqua |
purple |
Purple |
pink |
Pink |
smooth |
Smooth Black |
nylon |
Nylon Black |
textured |
Black Texture |
gray |
Grey |
white |
White |
camouflage |
Camouflage |
Available snap colors
Key |
Color |
snapblack |
Black |
snapsilver |
Silver |
snapbrass |
Brass |
Example API-Response
The rendered image will be in $response['hood']['renderingObject'] as a base64-encoded image object.
Array
(
[error] =>
[connected] => 1
[version] =>
[method] => CreateHood
[hood] => Array
(
[configuration] => Array
(
[hoodBaseColor] => smooth
[hoodCrownColor] => smooth
[hoodChinColor] => nylon
[earType] => pointed
[earColorA] => gray
[earColorB] => smooth
[earColorC] => nylon
[eyebrowType] => double
[eyebrowColor] => gray
[muzzleType] => default
[muzzleColor] => nylon
[bridgeColor] => nylon
[lipColor] => nylon
[additionalStyleType] => whiskers
[additionalStyleTypeColor] => orange
[jowl] => 0
[jowlColor] => white
[bridgeSnapColor] => snapblack
[jowlTopSnapColor] => snapsilver
[jowlBottomSnapColor] => snapsilver
[noseColor] => smooth
[hoodSize] => medium
)
[hoodModelVariant] => Array
(
[id] => 1
[short] => k9neo2019
)
[renderingObject] => iVBORw0KGgoAAAANSUhEUgAAA5MAAAOECAYAAAA8…
)
)