Safe Creative API Web Services Reference v2 - D R A F T

Signature parameter

Many operations require a signature of the request, this signature is the SHA-1 hash of the arguments sorted by key

For example: http://api.safecreative.org/v2/
?ztime=20081106141840
&sharedkey=fDsm8YO9SaupC5TChOsB6w
&component=authkey.create
Get the key/value pairs (values should not be URL-encoded): ztime = 20081106141840
sharedkey = fDsm8YO9SaupC5TChOsB6w
component = authkey.create
Sort by key: component = authkey.create
sharedkey = fDsm8YO9SaupC5TChOsB6w
ztime = 20081106141840
"Create" a data stream with the private key followed by the sorted pairs, all separated by ampersand: {private_key}&component=authkey.create&sharedkey=fDsm8YO9SaupC5TChOsB6w&ztime=20081106141840 Calculate de SHA1 of the previous UTF-8 data stream: SHA1(data)=4a285c1501646b41896a065add2311ffcde889ce Finally, you must append the SHA1 to the request as the signature parameter: http://api.safecreative.org/0.2
?ztime=20081106141840
&sharedkey=fDsm8YO9SaupC5TChOsB6w
&component=authkey.create
&signature=4a285c1501646b41896a065add2311ffcde889ce
TOC