Request Signing
Each request to Prodege APIs must be signed. Redirects and survey URLs can be signed as well.
The signature scheme will be built based on the following formula where StringToSign consists of all parameters included in the URL, in alphabetical order, and concatenated by a colon (:). The SecretKey will be provided to you by Prodege.
Base64(SHA256(UTF-8-Encoding-Of(SecretKey + “:” + StringToSign))),
Example (Redirect)
https://www.mysurveys.com/redirect
Parameters:
tId=123456789
projectId=987654321
memberId=741852963
status=1
dqid=3
surveyId=852369741
var1=h494jkfn938
var2=sjew82840dj
hash=
Secret Key:
stdY0rTvRj73WAdSdnaDVcs0cIwNVfJQmTJsvn5eKN3RbUVRn2
In this example, the signature would be calculated as follows:
Base64(SHA256(UTF-8-Encoding-Of(stdY0rTvRj73WAdSdnaDVcs0cIwNVfJQmTJsvn5eKN3RbUVRn2:dqid=3:memberId=741852963:projectId=987654321:status=1:surveyId=852369741:tId=123456789:var1=h494jkfn938:var2=sjew82840dj)))
End Result:
https://www.mysurveys.com/redirect?tId=123456789&projectId=987654321&memberId=741852963&status=1&dqid=3&surveyId=852369741&var1=h494jkfn938&var2=sjew82840dj&hash=nyA8bE-lQ92k4aMP7jo2AIC2_gmHHhGs3-E17rJwYCk
Note: As the result of SHA256 can have characters that cannot be passed un-encoded as a query string parameter, the following character replacements must be made:
Character
Replacement
+
–
/
_
=
EMPTY STRING
Code Examples
In Java:
In C#:
In PHP#:
In Python:
Last updated