SlideShare uma empresa Scribd logo
1 de 5
Baixar para ler offline
Upload and show documents from slideshare on our application using API in PHP
Before start using apis of slideshare , we need to have authentication api for it
Steps for getting API key and secret key for your application:
1. After Login: go to http://www.slideshare.net/developers/applyforapi and enter your name
and send request for api
2. API key along with secret key will be mail to your mail soon after the request
Note : This method requires extra permissions. If you want to upload a file using SlideShare API, please send an
email to api@slideshare.com with your developer account username describing the use case.
1. Upload doc to SlideShare:
API : Request Type : HTTPS GET or HTTPS POST (for slideshow_srcfile)
Authorization : Required
URL : https://www.slideshare.net/api/2/upload_slideshow
Required parameters
● username : username of the requesting user
● password : password of the requesting user
● slideshow_title : slideshow's title
● slideshow_srcfile : slideshow file (requires HTTPS POST) ­OR­
● upload_url : string containing an url pointing to the power point file
Optional parameters
● slideshow_description : description
● slideshow_tags : tags should be comma separated
● make_src_public : Y if you want users to be able to download the ppt file, N otherwise. Default is Y
Privacy settings (optional)
● make_slideshow_private : Should be Y if you want to make the slideshow private. If this is not set,
following tags will not be considered
● generate_secret_url : Generate a secret URL for the slideshow. Requires make_slideshow_private to be
Y
● allow_embeds : Sets if other websites should be allowed to embed the slideshow. Requires
make_slideshow_private to be Y
● share_with_contacts : Sets if your contacts on SlideShare can view the slideshow. Requires
make_slideshow_private to be Y
Response XML Format
<SlideShowUploaded>
  <SlideShowID>{slideshow id goes here}</SlideShowID>
</SlideShowUploaded>
Create following form :  //do not change the form action as it api url for uploading
<form action="https://www.slideshare.net/api/2/upload_slideshow" method="post" enctype='multipart/form­data'
name="ssuploadform">
Slideshare API Key (api_key):<br/>
<input name="api_key" type="text" size="20">
<br><br>
Slideshare Shared Secret:<br/>
<input name="sharedsecret" type="text" size="20">
<br><br>
<input name="ts" type="hidden" value="">
<input type="hidden" name="hash" value="">
Slideshare username (username): <br><input name="username" type="text" value="" size="20"><br><br>
Slideshare password (password): <br><input name="password" type="text" value="" size="20"><br><br>
Slideshow Title (slideshow_title): <br><input name="slideshow_title" type="text" value="My cool new Slideshow!"
size="50"><br><br>
Slideshow Source File (slideshow_srcfile): <br><input name="slideshow_srcfile" type="file" size="20"><br><br>
<input type="submit" onClick="return generateTimeHash(this.form)" value="Upload Slideshow!">
</form>
<script type="text/javascript">
function getUnixTime()
{
var theDate = new Date();
return Math.round(theDate.getTime()/1000.0);
}
function generateTimeHash(form)
{
if (form != null) {
var timestr = getUnixTime();
var ss = document.ssuploadform.sharedsecret.value;
form.ts.value = timestr;
var hashstr = SHA1(ss + timestr);
alert('UNIX Time=[' + timestr + ']nSecret Key=[' + ss + ']nSHA1 Hash=[' + hashstr + ']');
form.hash.value = hashstr;
return true;
}
return false;
}
</script>
FIll this form and you will be able to upload the doc to slideshare
In resonse you will get the slideshowID in xml, store it and save it in db for fetching same doc for
view on our application
2. Viewing the document in slideshare layout :
Multiple ways to do that but depend upon the input we have
Currently we have only slideshowID for doc so using api through curl we will fetch the data and
display the embed code.
First Method :
<?php
class slideShare {
    //*** do not alter this­­­­
    public $endpoint = 'https://www.slideshare.net/api/2/';
    public $key = 'XXXXXX'; //your api key
    public $secret = 'XXXXXX'; //your secret key
    //­­­­­***
   public function call($api,$params) {
        $ts = time();
        $hash = sha1($this­>secret . $ts);
        $url = $this­>endpoint . $api."api_key=$this­>key&ts=$ts&hash=$hash&" . $params;
        return $this­>curlRequest($url);
    }
    public function curlRequest($url){
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $res = curl_exec($ch);
        curl_close($ch);
        return $res;
    }
}
­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
view page : index.php
<?php
include_once 'slide_share.php';
$req=new slideShare();
$id=25835769; // just example
$show=$req­>call("get_slideshow?","slideshow_id=$id&exclude_tags=1&detailed=1");
//print_r($show);
$movies = new SimpleXMLElement($show);
echo $movies­>ID;
echo $movies­>Embed; // this returns the object of your document
echo $movies­>PPTLocation; ­­­­­­­­­­­­­­­­­­­­­1
­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
Second Method :
if you have url of slide share, you can call oembed api thru curl
eg:  http://www.slideshare.net/api/oembed/2?url={url}&format=json
­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
Third Method :
Javascript:
After getting PPTLocation from first method [1] XML ,we can also use its javascript api
From first method point 1­­­­­­­­
<?php $doc=$movies­>PPTLocation;?>
<html>
        <head>
                <title>SlideShare Player API Example</title>
                <script type="text/javascript" src="swfobject.js"></script>
                <script type="text/javascript">
                        var flashMovie;
                        //Load the flash player. Properties for the player can be changed here.
                        function loadPlayer() {
                                //allowScriptAccess from other domains
                                var params = { allowScriptAccess: "always" };
                                var atts = { id: "player" };
                                //doc: The path of the file to be used
                                //startSlide: The number of the slide to start from
                                //rel: Whether to show a screen with related slideshows at the end or not. 0 means false and 1 is
true..
                                var flashvars = {
                                    doc : "thirst­upload­800x600­1215534320518707­8",//<?php echo $doc?>
                                    startSlide : 1, rel : 0 };
                                //Generate the embed SWF file
                                swfobject.embedSWF("http://static.slidesharecdn.com/swf/ssplayer2.swf", "player", "598", "480",
"8", null, flashvars, params, atts);
                                //Get a reference to the player
                                flashMovie = document.getElementById("player");
                        }
                        //Jump to the appropriate slide
                        function jumpTo(){
                                flashMovie.jumpTo(parseInt(document.getElementById("slidenumber").value));
                        }
                        //Update the slide number in the field for the same
                        function updateSlideNumber(){
                                document.getElementById("slidenumber").value = flashMovie.getCurrentSlide();
                        }
                </script>
        </head>
        <body bgcolor="#ffffff" onload="loadPlayer();">
        <?php ?>
                <div id="player">
                        You need Flash player 8+ and JavaScript enabled to view this video.
                </div>
                <div style="margin­left: 150px; margin­top: 10px;">
                       <button onclick="flashMovie.first();updateSlideNumber();" type="button" value="First">First</button>
                       <button onclick="flashMovie.previous();updateSlideNumber();" type="button"
value="Previous">Previous</button>
                       <button onclick="jumpTo();updateSlideNumber();" type="button" value="Go to">Go to</button>
                       <input type="text" id="slidenumber" size="2" value="1" onkeydown="if (event.keyCode == 13) {
jumpTo(); }"/>
                       <button onclick="flashMovie.next();updateSlideNumber();" type="button" value="Next">Next</button>
                       <button onclick="flashMovie.last();updateSlideNumber();" type="button" value="Last">Last</button>
               </div>
        </body>
</html>
Refrence : http://www.slideshare.net/developers
BY :
Sanjulika Rastogi

Mais conteúdo relacionado

Mais procurados

Building Apps for SharePoint 2013 by Andrew Connell - SPTechCon
Building Apps for SharePoint 2013 by Andrew Connell - SPTechConBuilding Apps for SharePoint 2013 by Andrew Connell - SPTechCon
Building Apps for SharePoint 2013 by Andrew Connell - SPTechCon
SPTechCon
 
SharePoint 2013 “App Model” Developing and Deploying Provider Hosted Apps
SharePoint 2013 “App Model” Developing and Deploying Provider Hosted AppsSharePoint 2013 “App Model” Developing and Deploying Provider Hosted Apps
SharePoint 2013 “App Model” Developing and Deploying Provider Hosted Apps
Sanjay Patel
 
Vodafone Update for iPhone Release Notes 2.0
Vodafone Update for iPhone Release Notes 2.0Vodafone Update for iPhone Release Notes 2.0
Vodafone Update for iPhone Release Notes 2.0
VodafoneUpdate
 

Mais procurados (20)

Kolkata Salesforce Developer Group Online - Summer '17
Kolkata Salesforce Developer Group Online - Summer '17Kolkata Salesforce Developer Group Online - Summer '17
Kolkata Salesforce Developer Group Online - Summer '17
 
spm
spmspm
spm
 
Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...
Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...
Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...
 
Google app engine
Google app engineGoogle app engine
Google app engine
 
Build apps for slack
Build apps for slackBuild apps for slack
Build apps for slack
 
Building Apps for SharePoint 2013 by Andrew Connell - SPTechCon
Building Apps for SharePoint 2013 by Andrew Connell - SPTechConBuilding Apps for SharePoint 2013 by Andrew Connell - SPTechCon
Building Apps for SharePoint 2013 by Andrew Connell - SPTechCon
 
Dropbox with Mule
Dropbox with MuleDropbox with Mule
Dropbox with Mule
 
Introduction to lightning components
Introduction to lightning componentsIntroduction to lightning components
Introduction to lightning components
 
Practical Business Intelligence in SharePoint 2013 - Honolulu
Practical Business Intelligence in SharePoint 2013 - HonoluluPractical Business Intelligence in SharePoint 2013 - Honolulu
Practical Business Intelligence in SharePoint 2013 - Honolulu
 
SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013
SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013
SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013
 
O365 DEVCamp Los Angeles June 16, 2015 Module 02 Setting up the Environments
O365 DEVCamp Los Angeles June 16, 2015 Module 02 Setting up the EnvironmentsO365 DEVCamp Los Angeles June 16, 2015 Module 02 Setting up the Environments
O365 DEVCamp Los Angeles June 16, 2015 Module 02 Setting up the Environments
 
Mule Integration with Dropbox
Mule Integration with DropboxMule Integration with Dropbox
Mule Integration with Dropbox
 
Hooking SharePoint APIs with Android
Hooking SharePoint APIs with AndroidHooking SharePoint APIs with Android
Hooking SharePoint APIs with Android
 
SharePoint 2013 “App Model” Developing and Deploying Provider Hosted Apps
SharePoint 2013 “App Model” Developing and Deploying Provider Hosted AppsSharePoint 2013 “App Model” Developing and Deploying Provider Hosted Apps
SharePoint 2013 “App Model” Developing and Deploying Provider Hosted Apps
 
O365 DEVCamp Los Angeles June 16, 2015 Module 03 Hook into Apps for Sharepoint
O365 DEVCamp Los Angeles June 16, 2015 Module 03 Hook into Apps for SharepointO365 DEVCamp Los Angeles June 16, 2015 Module 03 Hook into Apps for Sharepoint
O365 DEVCamp Los Angeles June 16, 2015 Module 03 Hook into Apps for Sharepoint
 
Vodafone Update for iPhone Release Notes 2.0
Vodafone Update for iPhone Release Notes 2.0Vodafone Update for iPhone Release Notes 2.0
Vodafone Update for iPhone Release Notes 2.0
 
Sakai Overview 06-2004
Sakai Overview 06-2004Sakai Overview 06-2004
Sakai Overview 06-2004
 
Oracle APEX plugins - AUSOUG Connect 2016
Oracle APEX plugins - AUSOUG Connect 2016Oracle APEX plugins - AUSOUG Connect 2016
Oracle APEX plugins - AUSOUG Connect 2016
 
Rest With Raml
Rest With RamlRest With Raml
Rest With Raml
 
WordPress Launch Checklist
WordPress Launch Checklist WordPress Launch Checklist
WordPress Launch Checklist
 

Semelhante a My cool new Slideshow!

Slideshare Api Doc
Slideshare Api DocSlideshare Api Doc
Slideshare Api Doc
alterman
 
Developing your personal Twitter web application in 60 minustes
Developing your personal Twitter web application in 60 minustesDeveloping your personal Twitter web application in 60 minustes
Developing your personal Twitter web application in 60 minustes
Mitesh Sanghvi
 
I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop
I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop
I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop
Apigee | Google Cloud
 

Semelhante a My cool new Slideshow! (20)

Slideshare API
Slideshare APISlideshare API
Slideshare API
 
başlık
başlıkbaşlık
başlık
 
Linkedin OAuth for curious people
Linkedin OAuth for curious peopleLinkedin OAuth for curious people
Linkedin OAuth for curious people
 
Slideshare Api Doc
Slideshare Api DocSlideshare Api Doc
Slideshare Api Doc
 
Api Doc
Api DocApi Doc
Api Doc
 
How to get data from twitter (by hnnrrhm)
How to get data from twitter (by hnnrrhm)How to get data from twitter (by hnnrrhm)
How to get data from twitter (by hnnrrhm)
 
Developing your personal Twitter web application in 60 minustes
Developing your personal Twitter web application in 60 minustesDeveloping your personal Twitter web application in 60 minustes
Developing your personal Twitter web application in 60 minustes
 
ApiDD Consumer
ApiDD ConsumerApiDD Consumer
ApiDD Consumer
 
Linkedin & OAuth
Linkedin & OAuthLinkedin & OAuth
Linkedin & OAuth
 
I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop
I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop
I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop
 
Schema-First API Design
Schema-First API DesignSchema-First API Design
Schema-First API Design
 
Adding Identity Management and Access Control to your Application - Exersices
Adding Identity Management and Access Control to your Application - ExersicesAdding Identity Management and Access Control to your Application - Exersices
Adding Identity Management and Access Control to your Application - Exersices
 
Api Doc
Api DocApi Doc
Api Doc
 
Api Doc
Api DocApi Doc
Api Doc
 
Mule integration with linkedin
Mule integration with linkedinMule integration with linkedin
Mule integration with linkedin
 
Oracle APEX Social Login
Oracle APEX Social LoginOracle APEX Social Login
Oracle APEX Social Login
 
API Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsAPI Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIs
 
Developing Apps with Azure AD
Developing Apps with Azure ADDeveloping Apps with Azure AD
Developing Apps with Azure AD
 
WordCamp San Diego 2015 - WordPress, WP-API, and Web Applications
WordCamp San Diego 2015 - WordPress, WP-API, and Web ApplicationsWordCamp San Diego 2015 - WordPress, WP-API, and Web Applications
WordCamp San Diego 2015 - WordPress, WP-API, and Web Applications
 
REST API Basics
REST API BasicsREST API Basics
REST API Basics
 

Mais de Sanjulika Rastogi (20)

Using Proficiency Testing
Using Proficiency Testing Using Proficiency Testing
Using Proficiency Testing
 
WIDA CELLA
WIDA CELLAWIDA CELLA
WIDA CELLA
 
Using Proficiency Testing
Using Proficiency Testing Using Proficiency Testing
Using Proficiency Testing
 
Using Proficiency Testing
Using Proficiency Testing Using Proficiency Testing
Using Proficiency Testing
 
WIDA CELLA
WIDA CELLAWIDA CELLA
WIDA CELLA
 
Methods-Building Developmental Lessons
Methods-Building Developmental LessonsMethods-Building Developmental Lessons
Methods-Building Developmental Lessons
 
SLA Theories-Chapter 6
SLA Theories-Chapter 6SLA Theories-Chapter 6
SLA Theories-Chapter 6
 
Language Experience Lesson Activity
Language Experience Lesson ActivityLanguage Experience Lesson Activity
Language Experience Lesson Activity
 
Cooperative Learning Activity
Cooperative Learning ActivityCooperative Learning Activity
Cooperative Learning Activity
 
ganesh testing
ganesh testing ganesh testing
ganesh testing
 
ganesh testing
ganesh testing ganesh testing
ganesh testing
 
Test resource 2
Test resource 2Test resource 2
Test resource 2
 
Pop Tart Cat 3
Pop Tart Cat 3Pop Tart Cat 3
Pop Tart Cat 3
 
Resource Erin
Resource ErinResource Erin
Resource Erin
 
Resource Erin
Resource ErinResource Erin
Resource Erin
 
Test resource 2
Test resource 2Test resource 2
Test resource 2
 
Pop Tart Cat 3
Pop Tart Cat 3Pop Tart Cat 3
Pop Tart Cat 3
 
Pop Tart Cat 3
Pop Tart Cat 3Pop Tart Cat 3
Pop Tart Cat 3
 
Test resource 2
Test resource 2Test resource 2
Test resource 2
 
Resource Erin
Resource ErinResource Erin
Resource Erin
 

Último

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

My cool new Slideshow!