Doc

629 views

Published on

ascxsa

Published in: Technology, Design
1 Comment
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total views
629
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
3
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

Doc

  1. 1. <h1>SlideShare API » Documentation</h1> <div class="information" style="width: 530px;"> <h2 class="title">API Validation using the SlideShare API</h2> <p>All requests made using the SlideShare API must have the following parameters:</ p> <ul> <li>api_key: Set this to the API Key that SlideShare has provided for you.</li> <li>ts: Set this to the current time in Unix TimeStamp format, to the nearest second(<a class="blue_link_bold" target="_blank" href=http://en.wikipedia.org/wiki/ Unix_time>?</a>).</li> <li>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.</li> </ul> <h2 class="title">Authentication using the slideshare API</h2> <p>Requests that request private data from users, or that act on their behalf, must include the following parameters:</p> <ul> <li>username: set this to the username of the account whose data is being requested.</li> <li>password: set this to the password of the account whose data is being requested.</li> </ul> <h2 class="title">API Methods</h2> <div class="apiMethod" id="get_slideshow"> <!-- an API method starts here --> <p class="methodName">Get Slideshow Information</p> <ul> <li><strong>Request type:</strong> HTTP</li> <li><strong>Authorization:</strong> Optional</li> <li><strong>URL:</strong><a href="http://www.slideshare.net/api/2/get_slideshow"> http://www.slideshare.net/api/2/get_slideshow</a></li> </ul> <ul> <li><strong>Required parameters</strong></li> <li><strong>slideshow_id:</strong> id of the slideshow to be fetched.</li> <li><strong>slideshow_url: </strong>URL of the slideshow to be fetched. This is required if slideshow_id is not set. If both are set, slideshow_id takes precedence.</li> </ul> <ul> <li class="vspace"><strong>Optional parameters</strong></li>
  2. 2. <li class="vspace"><strong>username:</strong> username of the requesting user</li> <li><strong>password:</strong> password of the requesting user</li> <li><strong>detailed:</strong> Whether or not to include optional information. 1 to include, 0 (default) for basic information.</li> </ul> <span class="vspace"><strong>Response XML Format:</strong> (Green text represents additional information provided by `detailed` parameter)</span> <pre class="samplecodeNormal vspace"> &lt;Slideshow&gt; &lt;ID&gt;{ slideshow id }&lt;/ID&gt; &lt;Title&gt;{ slideshow title }&lt;/Title&gt; &lt;Description&gt;{ slideshow description }&lt;/Description&gt; &lt;Status&gt;{ 0 if queued for conversion, 1 if converting, 2 if converted, 3 if conversion failed } &lt;/Status&gt; &lt;Username&gt;{ username }&lt;/Username&gt; &lt;URL&gt;{ web permalink }&lt;/URL&gt; &lt;ThumbnailURL&gt;{ thumbnail URL }&lt;/ThumbnailURL&gt; &lt;ThumbnailSmallURL&gt;{ URL of smaller thumbnail }&lt;/ThumbnailSmallURL&gt; &lt;Embed&gt;{ embed code }&lt;/Embed&gt; &lt;Created&gt;{ date slideshow created }&lt;/Created&gt; &lt;Language&gt;{ language, as specified by two-letter code }&lt;/Language&gt; &lt;Format&gt;ppt (or pdf, pps, odp, doc, pot, txt, rdf) &lt;/Format&gt; &lt;Download&gt;{ 1 if available to download, else 0 }&lt;/Download&gt; <pre class="samplecodeHighlighted"> &lt;Tags&gt; &lt;Tag Count="{ number of times tag has been used }" Owner="{ 1 if owner has used the tag, else 0 }"&gt;{ tag name } &lt;/Tag&gt; &lt;/Tags&gt; &lt;NumDownloads&gt;{ number of downloads }&lt;/NumDownloads&gt; &lt;NumViews&gt;{ number of views }&lt;/NumViews&gt; &lt;NumComments&gt;{ number of comments }&lt;/NumComments&gt; &lt;NumFavorites&gt;{ number of favorites }&lt;/NumFavorites&gt; &lt;NumSlides&gt;{ number of slides }&lt;/NumSlides&gt; &lt;RelatedSlideshows&gt; &lt;RelatedSlideshowID rank="{ rank, where 1 is highest}"&gt; { slideshow id } &lt;/RelatedSlideshowID&gt; &lt;/RelatedSlideshows&gt; &lt;PrivacyLevel&gt;{ 0, or 1 if private }&lt;/PrivacyLevel&gt; &lt;SecretURL&gt;{ 0, or 1 if secret URL is enabled }&lt;/SecretURL&gt; &lt;AllowEmbed&gt;{ 0, or 1 if embeds are allowed }&lt;/AllowEmbed&gt; &lt;ShareWithContacts&gt;{ 0, or 1 if set to private, but contacts can view slideshow } &lt;/ShareWithContacts&gt; &lt;/Slideshow&gt; </pre> </pre> </div><!-- an API method ends here --> <div class="apiMethod" id="get_slideshows_by_tag"> <p class="methodName">Get Slideshows By Tag</p> <ul> <li><strong>Request Type : </strong>HTTP GET</li>
  3. 3. <li><strong>Authorization : </strong>None</li> <li><strong>URL : </strong><a href="http://www.slideshare.net/api/2/get_slideshows_by_tag">http://www.slideshare. net/api/2/get_slideshows_by_tag</a></li> </ul> <ul> <li><strong>Required parameters </strong></li> <li><strong>tag : </strong> tag name</li> </ul> <ul> <li><strong>Optional parameters</strong></li> <li><strong>limit : </strong>specify number of items to return</li> <li><strong>offset : </strong>specify offset</li> <li><strong>detailed : </strong>Whether or not to include optional information. 1 to include, 0 (default) for basic information.</li> </ul> <strong>Response XML Format</strong> <pre class="samplecodeNormal"> &lt;Tag&gt; &lt;Name&gt;{ Tag Name }&lt;/Name&gt; &lt;Count&gt;{ Number of Slideshows }&lt;/Count&gt; &lt;Slideshow&gt; { as in get_slideshow } &lt;/Slideshow&gt; ... &lt;/Tag&gt; </pre> </div> <div class="apiMethod" id="get_slideshows_by_group"> <p class="methodName">Get Slideshows By Group</p> <ul> <li><strong>Request Type : </strong>HTTP GET</li> <li><strong>Authorization : </strong>None</li> <li><strong>URL : </strong><a href="http://www.slideshare.net/api/2/get_slideshows_by_group">http://www.slideshar e.net/api/2/get_slideshows_by_group</a></li> </ul> <ul> <li><strong>Required parameters </strong></li> <li><strong>group_name : </strong>Group name (as returned in QueryName element in get_user_groups method)</li> </ul> <ul> <li><strong>Optional parameters</strong></li> <li><strong>limit : </strong>specify number of items to return</li> <li><strong>offset : </strong>specify offset</li> <li><strong>detailed : </strong>Whether or not to include optional information. 1 to include, 0 (default) for basic information.</li> </ul> <strong>Response XML Format</strong> <pre class="samplecodeNormal">
  4. 4. &lt;Group&gt; &lt;Name&gt;{ Group Name }&lt;/Name&gt; &lt;Count&gt;{ Number of Slideshows }&lt;/Count&gt; &lt;Slideshow&gt; { as in get_slideshow } &lt;/Slideshow&gt; ... &lt;/Group&gt; </pre> </div> <div class="apiMethod" id="get_slideshows_by_user"> <p class="methodName">Get Slideshows By User</p> <ul> <li><strong>Request Type : </strong>HTTP GET</li> <li><strong>Authorization : </strong>None</li> <li><strong>URL : </strong><a href="http://www.slideshare.net/api/2/get_slideshows_by_user">http://www.slideshare .net/api/2/get_slideshows_by_user</a></li> </ul> <ul> <li><strong>Required parameters </strong></li> <li><strong>username_for : </strong>username of owner of slideshows</li> </ul> <ul> <li><strong>Optional parameters</strong></li> <li><strong>username : </strong>username of the requesting user</li> <li><strong>password : </strong>password of the requesting user</li> <li><strong>limit : </strong>specify number of items to return</li> <li><strong>offset : </strong>specify offset</li> <li><strong>detailed : </strong>Whether or not to include optional information. 1 to include, 0 (default) for basic information.</li> </ul> <strong>Response XML Format</strong> <pre class="samplecodeNormal"> &lt;User&gt; &lt;Name&gt;{ username_for }&lt;/Name&gt; &lt;Count&gt;{ Number of Slideshows }&lt;/Count&gt; &lt;Slideshow&gt; { as in get_slideshow } &lt;/Slideshow&gt; ... &lt;/User&gt; </pre> </div> <div class="apiMethod" id="search_slideshows"> <p class="methodName">Slideshow Search</p> <ul> <li><strong>Request Type : </strong>HTTP GET</li> <li><strong>Authorization : </strong>None</li> <li><strong>URL : </strong><a href="http://www.slideshare.net/api/2/search_slideshows">http://www.slideshare.net/ api/2/search_slideshows</a></li>
  5. 5. </ul> <ul> <li><strong>Required parameters </strong></li> <li><strong>q : </strong>the query string</li> </ul> <ul> <li><strong>Optional parameters</strong></li> <li><strong>page : </strong>The page number of the results (works in conjunction with items_per_page), default is 1</li> <li><strong>items_per_page : </strong>Number of results to return per page, default is 12</li> <li><strong>lang : </strong>Language of slideshows (default is English, 'en') ('**':All,'es':Spanish,'pt':Portuguese,'fr':French,'it':Italian,'nl':Dutch, 'de':German,'zh':Chinese,'ja':Japanese,'ko':Korean,'ro':Romanian,'!!':Other)</li> <li><strong>sort : </strong>Sort order (default is 'relevance') ('mostviewed','mostdownloaded','latest') </li> <li><strong>what : </strong>What type of search. If not set, text search is used. 'tag' is the other option.</li> <li><strong>download : </strong>Slideshows that are available to download; Set to '0' to do this, otherwise default is all slideshows.</li> <li><strong>fileformat : </strong>File format to search for. Default is "all". ('pdf':PDF,'ppt':PowerPoint,'odp':Open Office,'pps':PowerPoint Slideshow,'pot':PowerPoint template)</li> <li><strong>cc : </strong>Set to '1' to retrieve results under the Creative Commons license. Default is '0'</li> <li><strong>cc_adapt : </strong>Set to '1' for results under Creative Commons that allow adaption, modification. Default is '0'</li> <li><strong>detailed : </strong>Whether or not to include optional information. 1 to include, 0 (default) for basic information.</li> </ul> <strong>Response XML Format</strong> <pre class="samplecodeNormal"> &lt;Slideshows&gt; &lt;Meta&gt; &lt;Query&gt;{ query }&lt;/Query&gt; &lt;ResultOffset&gt;{ the offset of this result (if pages were used)} &lt;/ResultOffset&gt; &lt;NumResults&gt;{ number of results returned }&lt;/NumResults&gt; &lt;TotalResults&gt;{ total number of results}&lt;/TotalResults&gt; &lt;/Meta&gt; &lt;Slideshow&gt; {as in get_slideshow} &lt;/Slideshow&gt; ... &lt;/Slideshows&gt; </pre> </div> <div class="apiMethod" id="get_user_groups"> <p class="methodName">Get User Groups</p> <ul> <li><strong>Request Type : </strong>HTTP GET</li> <li><strong>Authorization : </strong>Optional</li> <li><strong>URL : </strong><a href="http://www.slideshare.net/api/2/get_user_groups">http://www.slideshare.net/ap
  6. 6. i/2/get_user_groups</a></li> </ul> <ul> <li><strong>Required parameters </strong></li> <li><strong>username_for : </strong>username of user whose groups are being requested</li> </ul> <ul> <li><strong>Optional parameters</strong></li> <li><strong>username : </strong>username of the requesting user</li> <li><strong>password : </strong>password of the requesting user</li> </ul> <strong>Response XML Format</strong> <pre class="samplecodeNormal"> &lt;Groups&gt; &lt;Group&gt; &lt;Name&gt;{ Group Name }&lt;/Name&gt; &lt;NumPosts&gt;{ Number of Posts }&lt;/Name&gt; &lt;NumSlideshows&gt;{ Number of Slideshows }&lt;/Name&gt; &lt;NumMembers&gt;{ Number of Members }&lt;/Name&gt; &lt;Created&gt;{ Created date }&lt;/Name&gt; &lt;QueryName&gt;{ Name used for querying (get_slideshows_by_group, etc) } &lt;/Name&gt; &lt;URL&gt;{ Group URL }&lt;/Name&gt; &lt;Group&gt; ... &lt;/Groups&gt; </pre> </div> <div class="apiMethod" id="get_user_contacts"> <p class="methodName">Get User Contacts</p> <ul> <li><strong>Request Type : </strong>HTTP GET</li> <li><strong>Authorization : </strong>Optional</li> <li><strong>URL : </strong><a href="http://www.slideshare.net/api/2/get_user_contacts">http://www.slideshare.net/ api/2/get_user_contacts</a></li> </ul> <ul> <li><strong>Required parameters </strong></li> <li><strong>username_for : </strong>username of user whose Contacts are being requested</li> </ul> <strong>Response XML Format</strong> <pre class="samplecodeNormal"> &lt;Contacts&gt; &lt;Contact&gt; &lt;Userame&gt;{ Username }&lt;/Name&gt; &lt;NumSlideshows&gt;{ Number of Slideshows }&lt;/Name&gt; &lt;NumComments&gt;{ Number of Comments }&lt;/Name&gt; &lt;Contact&gt; ...
  7. 7. &lt;/Contacts&gt; </pre> </div> <div class="apiMethod" id="get_user_tags"> <p class="methodName">Get User Tags</p> <ul> <li><strong>Request Type : </strong>HTTP GET</li> <li><strong>Authorization : </strong>Required</li> <li><strong>URL : </strong><a href="http://www.slideshare.net/api/2/get_user_tags">http://www.slideshare.net/api/ 2/get_user_tags</a></li> </ul> <ul> <li><strong>Required parameters </strong></li> <li><strong>username : </strong>username of the requesting user</li> <li><strong>password : </strong>password of the requesting user</li> </ul> <strong>Response XML Format</strong> <pre class="samplecodeNormal"> &lt;Tags&gt; &lt;Tag Count="{ Number of times tag used }"&gt;{ Tag name }&lt;/Tag&gt; ... &lt;/Tags&gt; </pre> </div> <div class="apiMethod" id="edit_slideshow"> <p class="methodName">Edit Existing Slideshow</p> <ul> <li><strong>Request Type : </strong>HTTP GET</li> <li><strong>Authorization : </strong>Required</li> <li><strong>URL : </strong><a href="http://www.slideshare.net/api/2/edit_slideshow">http://www.slideshare.net/api /2/edit_slideshow</a></li> </ul> <ul> <li><strong>Required parameters </strong></li> <li><strong>username : </strong>username of the requesting user</li> <li><strong>password : </strong>password of the requesting user</li> <li><strong>slideshow_id : </strong>slideshow ID</li> </ul> <ul> <li><strong>Optional parameters</strong></li> <li><strong>slideshow_title : </strong>text</li> <li><strong>slideshow_description : </strong>text</li> <li><strong>slideshow_tags : </strong>text</li> <li><strong>make_slideshow_private : </strong>Should be Y if you want to make the slideshow private. If this is not set, following tags will not be considered</li> <li><strong>generate_secret_url : </strong>Generate a secret URL for the slideshow. Requires make_slideshow_private to be Y</li> <li><strong>allow_embeds : </strong>Sets if other websites should be allowed to embed the slideshow. Requires make_slideshow_private to be Y</li>
  8. 8. <li><strong>share_with_contacts : </strong>Sets if your contacts on SlideShare can view the slideshow. Requires make_slideshow_private to be Y</li> </ul> <strong>Response XML Format</strong> <pre class="samplecodeNormal"> &lt;SlideShowEdited&gt; &lt;SlideShowID&gt;SlideShowID&lt;/SlideShowID&gt; &lt;/SlideShowEdited&gt; </pre> </div> <div class="apiMethod" id="delete_slideshow"> <p class="methodName">Delete Slideshow</p> <ul> <li><strong>Request Type : </strong>HTTP GET</li> <li><strong>Authorization : </strong>Required</li> <li><strong>URL : </strong><a href="http://www.slideshare.net/api/2/delete_slideshow">http://www.slideshare.net/a pi/2/delete_slideshow</a></li> </ul> <ul> <li><strong>Required parameters </strong></li> <li><strong>username : </strong>username of the requesting user</li> <li><strong>password : </strong>password of the requesting user</li> <li><strong>slideshow_id : </strong>slideshow ID</li> </ul> <strong>Response XML Format</strong> <pre class="samplecodeNormal"> &lt;SlideShowDeleted&gt; &lt;SlideShowID&gt;SlideShowID&lt;/SlideShowID&gt; &lt;/SlideShowDeleted&gt; </pre> </div> <div class="apiMethod" id="upload_slideshow"> <p class="methodName">Upload Slideshow</p> <ul> <li><strong>Request Type : </strong>HTTP GET</li> <li><strong>Authorization : </strong>Required</li> <li><strong>URL : </strong><a href="http://www.slideshare.net/api/2/upload_slideshow">http://www.slideshare.net/a pi/2/upload_slideshow</a></li> </ul> <ul> <li><strong>Required parameters </strong></li> <li><strong>username : </strong>username of the requesting user</li> <li><strong>password : </strong>password of the requesting user</li> <li><strong>slideshow_title : </strong>slideshow's title</li> <li><strong>slideshow_srcfile : </strong>slideshow file</li> </ul> <ul> <li><strong>Optional parameters</strong></li>
  9. 9. <li><strong>slideshow_description : </strong>description</li> <li><strong>slideshow_tags : </strong>tags should be space separated, use quotes for multiple word tags</li> <li><strong>make_src_public : </strong>Y if you want users to be able to download the ppt file, N otherwise. Default is Y</li> </ul> <ul> <li><strong>Privacy settings (optional)</strong></li> <li><strong>make_slideshow_private : </strong>Should be Y if you want to make the slideshow private. If this is not set, following tags will not be considered</li> <li><strong>generate_secret_url : </strong>Generate a secret URL for the slideshow. Requires make_slideshow_private to be Y</li> <li><strong>allow_embeds : </strong>Sets if other websites should be allowed to embed the slideshow. Requires make_slideshow_private to be Y</li> <li><strong>share_with_contacts : </strong>Sets if your contacts on SlideShare can view the slideshow. Requires make_slideshow_private to be Y</li> </ul> <p>The document will upload into the account of the user specified by (username / password). The user associated with the API key need not be the same as the user into who's account the slideshow gets uploaded. So, for example, a bulk uploader would include the api_key (and hash) associated with the API account, and the username and password associated with the account being uploaded to.</p> <strong>Response XML Format</strong> <pre class="samplecodeNormal"> &lt;SlideShowUploaded&gt; &lt;SlideShowID&gt;{slideshow id goes here}&lt;/SlideShowID&gt; &lt;/SlideShowUploaded&gt; </pre> <p>The slideshare ID will be necessary for retrieving the slideshow embed code, once the slideshow has been converted into flash.</p> </div> <p class="title">Notes about using API</p> <p>In particular, do NOT write code that calls our API every time you get a web request. Cache the information so that you can serve it as needed to your users. API calls are limited to 1000 per day per API_Key. Calls that exceed this limit will receive an error message in the following format.</p> <pre class="samplecodeNormal"> &lt;SlideShareServiceError&gt; &lt;Message id=99&gt;Account Exceeded Daily Limit&lt;/Message&gt; &lt;/SlideShareServiceError&gt; </pre> <p>In case your application needs to send more than 1000 API requests per day, <a href="mailto:api@slideshare.com">e-mail</a> us about your requirements.</p> </div> <div class="extraInfo howtoAPI" style="float: right;"> <h2 class="title">API Methods</h2>
  10. 10. <ul> <li> <a href="#get_slideshow">get_slideshow</a> </li> <li> <a href="#get_slideshows_by_tag">get_slideshows_by_tag</a> </li> <li><a href="#get_slideshows_by_group">get_slideshows_by_group</a> </li> <li><a href="#get_slideshows_by_user">get_slideshows_by_user</a> </li> <li><a href="#search_slideshows">search_slideshows</a> </li> <li><a href="#get_user_groups">get_user_groups</a> </li> <li><a href="#get_user_contacts">get_user_contacts</a> </li> <li><a href="#get_user_tags">get_user_tags</a> </li> <li><a href="#edit_slideshow">edit_slideshow</a> </li> <li><a href="#delete_slideshow">delete_slideshow</a> </li> <li><a href="#upload_slideshow">upload_slideshow</a> </li> </ul> </div>

×