我有API_Key
和Secret_Key
。要访问API,我必须提供以下参数:
api_key: Set this to the API Key that SlideShare has provided for you.
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.
我尝试使用幻灯片搜索功能 - 我以这种方式提供了所需的参数 - 但仍然给我错误:Failed API validation
- 问题在哪里?
"https://www.slideshare.net/api/2/search_slideshows?api_key=API_Key&ts="+ Math.round((new Date()).getTime() / 1000) + "&hash="+ sha1(Secret_Key + Math.round((new Date()).getTime() / 1000)) +"&q=ionic view"
请确认这是否是在javascript
中以Unix TimeStamp格式发布当前时间的正确方法Math.round((new Date()).getTime() / 1000)