cancel
Showing results for 
Search instead for 
Did you mean: 

Attributes for REST JSON?

Jump to solution

I am looking to make a RESTful API call to a website using the External Lists mechanism.  The desired site requires the following parameters passed in a JSON structure.  Is there a way to obtain a Unix TimeStamp value and perform a SHA1 hash?

  • ts: Set this to the current time in Unix TimeStamp format, to the nearest second(?).

     

  • hash: Set this to the SHA1 hash of the concatenation of the
    shared secret and the timestamp (ts). i.e. SHA1 (sharedsecret +
    timestamp). The order of the terms in the concatenation is important.
0 Kudos
1 Solution

Accepted Solutions
McAfee Employee

Re: Attributes for REST JSON?

Jump to solution

This is possible:

You can use an event to set a property to exactly that. String.Hash, can be used to hash the concatted key and timestamp, to whatever hash algorithm you want.

How does it need the JSON sent? Via POST or in a GET parameter?

Best Regards,

Jon

0 Kudos
3 Replies
McAfee Employee

Re: Attributes for REST JSON?

Jump to solution

This is possible:

You can use an event to set a property to exactly that. String.Hash, can be used to hash the concatted key and timestamp, to whatever hash algorithm you want.

How does it need the JSON sent? Via POST or in a GET parameter?

Best Regards,

Jon

0 Kudos

Re: Attributes for REST JSON?

Jump to solution

That answer is extremely helpful.  The formatted request will be passed on a GET.  However, I am still figuring out the specific syntax.  Here is what I have so far and the last event line is still a work-in-progress.  Any suggestion for the correct syntax for invoking the Get with the User-Defined.Slideshare.Param passed as a JSON?

0 Kudos
McAfee Employee

Re: Attributes for REST JSON?

Jump to solution

I tried dropping you an email.

Based on the documentation I see, it doesnt seem like we need to use JSON:

Developer Documentation

From what I can tell, the URL format would be something like:

https://www.slideshare.net/api/2/get_slideshow?api_key={{API_KEY}}&ts={{TIMESTAMP}}&hash={{HASH}}&slideshow_id={{SLIDESHOW_ID}}

The below doesnt work because MWG will URL escape the URL parameters. Instead the API key would need to be used in the URL instead.

https://www.slideshare.net/api/2/get_slideshow?api_key={{API_KEY}}&ts=${0}&hash=${1}&slideshow_id=${...

Where :

${0} = {{TIMESTAMP}}

${1} = {{HASH}}

${2} = {{SLIDESHOW_ID}}

To achieve this you will need to build the URL parameters into it's own string (because the external list only accepts 3 parameters).

The above event, concats to: api_key={{API_KEY}}&ts={{TIMESTAMP}}&hash={{HASH}}&slideshow_id={{SLIDESHOW_ID}}

Then External List Parameter will be User-Defined.SlideShareParameters. The URL in the settings would be: https://www.slideshare.net/api/2/get_slideshow?${0}

Best Regards,

Jon

0 Kudos