/api/write

This API GET method creates a gzaas and returns the url generated.

The method is called like this:
http://gzaas.com/api/v1/write?apikey=YOUR_API_KEY&message=hello
(See that the version of the API is included in the HTTP request)
 

Needed Parameters

apikey ApiKey of your application
message The gzaas! text message

 

Optional Parameters

font [string] Font desired (identified by its hashtag)
color [string] Font color (hexadecimal)
backcolor Background color (hexadecimal)
backpattern [string] Background pattern desired (identified by its hashtag)
shadows Shadows (css hex. sintaxis -> 1px 0 2px #ccc)
Multiple shadows admitted (max 5)
style [string] Style desired (identified by its hashtag)
visibility [0,1]
0: Private, not accessible in gzaas gallery (nor googles)
1: Public, accesible by everyone
launcher [string] Text of the launcher.

 

NOTES:
* In addition to the Needed Parameters, you must include at least ONE Styling parameter (font/color/backcolor/backpatter/style) to get a valid response.
* Backcolor & Backpattern are exclusive between them. If both are included (and both correct) backpattern will be used.
* Style and (font/color/backcolor/backpattern) are not exclusive. When a font (e.g) and a style go together in a gzaas creation, the style will explode and the gzaas will be generated using the font and the remaining features of the style (and it will not be associated with the style itself).

 

PHP Example

<?php
// Authorization info
$apikey    = 'YOUR_API_KEY';

// Data for new gzaas
$message  = 'hello megan!!!';
$font = 'chewy';
$color  = '444444';
$backcolor  = 'fcfcee';
$visibility  = 0;

// Prepare POST request
$request_data = http_build_query(
array(
'apikey'     => $apikey,
'message'  => $message,
'font'      => $font,
'color'     => $color,
'backcolor'      => $backcolor,
'visibility' => $visibility
)
);


// Send the POST request (with cURL)
$c = curl_init('http://gzaas.com/api/v1/write');
curl_setopt($c, CURLOPT_POST, true);
curl_setopt($c, CURLOPT_POSTFIELDS, $request_data);
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($c);
$status = curl_getinfo($c, CURLINFO_HTTP_CODE);
curl_close($c);

// Check for success
if ($status == 201) {
echo "Success! Your gzaas was succesfully created. UrlKey = $result['urlKey'].\n";
} else if ($status == 403) {
echo 'API Key error';
} else {
echo "Error: $result\n";
}
?>