mikevkay
Posts: 0
Joined: Wed Apr 18, 2012 10:47 am

REST Service Request Parameters

Hi,

I'd be glad of some help here (if at all possible). I am trying to utilize a JSON API with the REST Service. The vendor's documentation directs user to send three parameters in the request body. These are:

(1) hashedKey
(2) salt
(3) params

I'm very stuck with (1) and (2). The description for the 'hashedKey' (1) is:
hashedKey = MD5 (yourSecretKey + yourRandomSalt)

in PHP and example would be:

$this-secretKey = $"MySecretKey";
$this-salt = rand(1,999999);
$this-hashedKey = md5($this-secretKey . $this-salt);

The vendors documentation is available here:

http://docs.kumulos.com/reference/lan...

I be really extremely grateful if anyone can point me in the right direction.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

REST Service Request Parameters

URL: http://api.kumulos.com/yourAPIKey/you...
Method: post
Data type: json
Content type: x-form-www-urlencoded
Check Use Tiggzi Proxy (here is why: http://blog.tiggzi.com/2012/03/rest-s...)

Two input parameters:
hashedKey
salt

Because above parameters need to be calculated, you should test them from a page by invoking the service.

First, add http://crypto-js.googlecode.com/files... to Project Project Profile External resources

Service mapping:
Image

I used 'foo' but you can generate any string.

For hashedKey, add this JavaScript:
code
return Crypto.MD5(your_secret_key+"foo");
/code

Testing on a page (on button click):
Image

Lastly, if you need to generate the salt for each request, generate it in the hashedKey JavaScript, save it into local storage and then read it JavaScript for salt parameter.

mikevkay
Posts: 0
Joined: Wed Apr 18, 2012 10:47 am

REST Service Request Parameters

Max, many thanks. I followed you instructions and couldn't get it to work, but then figured out that I had to put the secret key (example: abc123) in quotes or is was looking for a varialbe abc123

so I wrote:

codereturn Crypto.MD5("abc123"+"foo");/code

Then it all worked. I took a sample response and "populate from sample response" and can now use the response mapping.

Its a great tool you have and I am enjoying getting to know it.

Return to “Issues”