2

I have applied for slideshare API and i got the API and the secret. All i have did is a simple GET request to slideshare which gives me results with the help of a tag.

This is my deluge script which i have tried to call the url using the API. As per the documentation, i have got the unix time stamp and SHA1 hash.

param = Map();
param.put("api_key","XYZ");
param.put("ts","1565085930");
param.put("hash","xxxxxxxxxxxxxxxxxxxxxxxxx");
param.put("tag","cricket");
request = invokeurl
[
    url :"https://www.slideshare.net/api/2/get_slideshows_by_tag"
    type : GET
    parameters: param
];
info request;

This is the response error i get:

<?xml version="1.0" encoding="UTF-8"?> 
   <SlideShareServiceError> 
        <Message ID="1">Failed API validation</Message> 
   </SlideShareServiceError> 

Thank you.

Michael M.
  • 10,486
  • 9
  • 18
  • 34
Deepak
  • 2,660
  • 2
  • 8
  • 23

1 Answers1

2

Looks like the API does not work with a GET request. Try the same using a POST request and it should work. The same failed with POSTMAN and it worked only after the request type was changed to POST.

param = Map();
head = Map();
param.put("api_key","XXXXXXXX");
param.put("ts",1577955246);
param.put("hash","b3f3f803XXXXXXXXXXXXXXXX8be21d");
param.put("tag","cricket");
request = invokeurl
[
    url :"https://www.slideshare.net/api/2/get_slideshows_by_tag"
    type : POST
    parameters: param
];
info request;

Response:

<?xml version="1.0" encoding="UTF-8"?> 
<Tag>
 <Name>cricket</Name>
 <Count>0</Count>
</Tag>
mickmackusa
  • 43,625
  • 12
  • 83
  • 136