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.
1 person has
this question
+1
This topic is no longer open for comments or replies.
  • 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:


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

    For hashedKey, add this JavaScript:

    return Crypto.MD5(your_secret_key+"foo");


    Testing on a page (on button click):


    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.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited

  • I’m excited
    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:

    return Crypto.MD5("abc123"+"foo");

    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.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited