Get Placeholders from a Slide Introduction
Aspose.Slides Cloud allows you to read placeholder information from a PowerPoint presentation. The presentation file must be already saved to a storage folder. Using the request methods below, you can get information about a specified placeholder or all placeholders on a slide.
GetPlaceholders
API
Type
Description
Resource
/slides/{name}/slides/{slideIndex}/placeholders
GET
Returns a list of all placeholders from a presentation slide.
GetPlaceholders
Request Parameters
Name
Type
Location
Required
Description
name
string
path
true
The file name of a presentation.
slideIndex
integer
path
true
The 1-based index of a slide.
password
string
header
false
The password to open the presentation.
folder
string
query
false
The path to the folder containing the presentation.
storage
string
query
false
The name of the storage contaning the folder
.
In case of Amazon S3 storage folder path starts with Amazon S3 bucket name.
Examples
Get information about all placeholders on the first slide in MyFolder/MyPresentation.pptx file saved to the default storage.
cURL Solution
SDK Solutions
C#
Copy
using Aspose.Slides.Cloud.Sdk ;
using System ;
class Application
{
static void Main ( )
{
SlidesApi api = new SlidesApi ( "MyClientId" , "MyClientSecret" );
var response = api . GetPlaceholders ( "MyPresentation.pptx" , 1 );
foreach ( var resourceUri in response . PlaceholderLinks )
{
Console . WriteLine ( resourceUri . Href );
}
}
}
Java
Copy
import com.aspose.slides.ApiException ;
import com.aspose.slides.api.SlidesApi ;
public class Application {
public static void main ( String [] args ) throws ApiException {
SlidesApi slidesApi = new SlidesApi ( "my_client_id" , "my_client_secret" );
Placeholders response = slidesApi . getPlaceholders ( "MyPresentation.pptx" , 1 , null , "MyFolder" , null );
for ( ResourceUri resourceUri : response . getPlaceholderLinks ()) {
System . out . println ( resourceUri . getHref ());
}
}
}
PHP
Copy
use Aspose \Slides \Cloud \Sdk \Api \Configuration ;
use Aspose \Slides \Cloud \Sdk \Api \SlidesApi ;
$configuration = new Configuration ();
$configuration -> setAppSid ( "my_client_id" );
$configuration -> setAppKey ( "my_client_secret" );
$slidesApi = new SlidesApi ( null , $configuration );
$response = $slidesApi -> getPlaceholders ( "MyPresentation.pptx" , 1 , null , "MyFolder" );
foreach ( $response -> getPlaceholderLinks () as $resourceUri ) {
echo $resourceUri -> getHref (), " \n " ;
}
Ruby
Copy
require "aspose_slides_cloud"
include AsposeSlidesCloud
configuration = Configuration . new
configuration . app_sid = "my_client_id"
configuration . app_key = "my_client_secret"
slides_api = SlidesApi . new ( configuration )
response = slides_api . get_placeholders ( "MyPresentation.pptx" , 1 , nil , "MyFolder" )
for resource_uri in response . placeholder_links
puts resource_uri . href
end
Python
Copy
import asposeslidescloud
from asposeslidescloud.apis.slides_api import SlidesApi
slides_api = SlidesApi ( None , "my_client_id" , "my_client_secret" )
response = slides_api . get_placeholders ( "MyPresentation.pptx" , 1 , None , "MyFolder" )
for resource_uri in response . placeholder_links :
print ( resource_uri . href )
Node.js
Copy
const cloud = require ( "asposeslidescloud" );
const slidesApi = new cloud . SlidesApi ( "my_client_id" , "my_client_secret" );
const response = slidesApi . getPlaceholders ( "MyPresentation.pptx" , 1 , null , "MyFolder" ). then ( response => {
response . body . placeholderLinks . forEach ( resourceUri => {
console . log ( resourceUri . href );
});
});
Android
Copy
import com.aspose.slides.ApiException ;
import com.aspose.slides.api.SlidesApi ;
public class Application {
public static void main ( String [] args ) throws ApiException {
SlidesApi slidesApi = new SlidesApi ( "my_client_id" , "my_client_secret" );
Placeholders response = slidesApi . getPlaceholders ( "MyPresentation.pptx" , 1 , null , "MyFolder" , null );
for ( var resourceUri : response . getPlaceholderLinks ()) {
System . out . println ( resourceUri . getHref ());
}
}
}
C++
Copy
#include "asposeslidescloud/api/SlidesApi.h"
using namespace asposeslidescloud :: api ;
int main ()
{
auto slidesApi = new SlidesApi ( L "my_client_id" , L "my_client_secret" );
auto response = slidesApi -> getPlaceholders ( L "MyPresentation.pptx" , 1 , L "" , L "MyFolder" ). get ();
for ( auto resourceUri : response -> getPlaceholderLinks ()) {
std :: wcout << resourceUri -> getHref () << std :: endl ;
}
return 0 ;
}
Perl
Copy
use AsposeSlidesCloud::Configuration ;
use AsposeSlidesCloud::SlidesApi ;
my $config = AsposeSlidesCloud::Configuration -> new ();
$config -> { app_sid } = "my_client_id" ;
$config -> { app_key } = "my_client_secret" ;
my $slides_api = AsposeSlidesCloud::SlidesApi -> new ( config => $config );
my %parameters = ( name => "MyPresentation.pptx" , slide_index => 1 , folder => "MyFolder" );
my $response = $slides_api -> get_placeholders ( %parameters );
for my $resource_uri ( @ { $response -> { placeholder_links }}) {
print $resource_uri -> { href }, "\n" ;
}
Swift
Go
GetPlaceholder
API
Type
Description
Resource
/slides/{name}/slides/{slideIndex}/placeholders/{placeholderIndex}
GET
Returns information about a placeholder.
GetPlaceholder
Request Parameters
Name
Type
Location
Required
Description
name
string
path
true
The file name of a presentation.
slideIndex
integer
path
true
The 1-based index of a slide.
placeholderIndex
integer
path
true
The 1-based index of a placeholder.
password
string
header
false
The password to open the presentation.
folder
string
query
false
The path to the folder containing the presentation.
storage
string
query
false
The name of the storage contaning the folder
.
In case of Amazon S3 storage folder path starts with Amazon S3 bucket name.
Examples
Get information about the first placeholder on the second slide from MyPresentation.pptx file saved to MyStorage .
cURL Solution
Request
Get an Access Token
Copy curl -X POST "https://api.aspose.cloud/connect/token" \
-d "grant_type=client_credentials&client_id=my_client_id&client_secret=my_client_secret" \
-H "Content-Type: application/x-www-form-urlencoded"
Get Information about the Placeholder
Copy curl -X GET "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/2/placeholders/1?storage=MyStorage" \
-H "authorization: Bearer <access_token>"
Response
Copy {
"index" : 1 ,
"orientation" : "Horizontal" ,
"size" : "Full" ,
"type" : "CenteredTitle" ,
"shape" : {
"href" : "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/2/shapes/1" ,
"relation" : "self" ,
"slideIndex" : 2 ,
"shapeIndex" : 1
},
"selfUri" : {
"href" : "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/2/placeholders/1" ,
"relation" : "self" ,
"slideIndex" : 2
}
}
SDK Solutions
C#
Copy
using Aspose.Slides.Cloud.Sdk ;
using System ;
class Application
{
static void Main ( )
{
SlidesApi api = new SlidesApi ( "MyClientId" , "MyClientSecret" );
var response = api . GetPlaceholder ( "MyPresentation.pptx" , 2 , 1 );
Console . WriteLine ( response . ToString ());
}
}
Java
Copy
import com.aspose.slides.ApiException ;
import com.aspose.slides.api.SlidesApi ;
public class Application {
public static void main ( String [] args ) throws ApiException {
SlidesApi slidesApi = new SlidesApi ( "my_client_id" , "my_client_secret" );
Placeholder response = slidesApi . getPlaceholder ( "MyPresentation.pptx" , 2 , 1 , null , null , "MyStorage" );
System . out . println ( response . toString ());
}
}
PHP
Copy
use Aspose \Slides \Cloud \Sdk \Api \Configuration ;
use Aspose \Slides \Cloud \Sdk \Api \SlidesApi ;
$configuration = new Configuration ();
$configuration -> setAppSid ( "my_client_id" );
$configuration -> setAppKey ( "my_client_secret" );
$slidesApi = new SlidesApi ( null , $configuration );
$response = $slidesApi -> getPlaceholder ( "MyPresentation.pptx" , 2 , 1 , null , null , "MyStorage" );
echo $response ;
Ruby
Copy
require "aspose_slides_cloud"
include AsposeSlidesCloud
configuration = Configuration . new
configuration . app_sid = "my_client_id"
configuration . app_key = "my_client_secret"
slides_api = SlidesApi . new ( configuration )
response = slides_api . get_placeholder ( "MyPresentation.pptx" , 2 , 1 , nil , nil , "MyStorage" )
print response
Python
Copy
import asposeslidescloud
from asposeslidescloud.apis.slides_api import SlidesApi
slides_api = SlidesApi ( None , "my_client_id" , "my_client_secret" )
response = slides_api . get_placeholder ( "MyPresentation.pptx" , 2 , 1 , None , None , "MyStorage" )
print ( response )
Node.js
Copy
const cloud = require ( "asposeslidescloud" );
const slidesApi = new cloud . SlidesApi ( "my_client_id" , "my_client_secret" );
slidesApi . getPlaceholder ( "MyPresentation.pptx" , 2 , 1 , null , null , "MyStorage" ). then ( response => {
console . log ( response . body );
});
Android
Copy
import com.aspose.slides.ApiException ;
import com.aspose.slides.api.SlidesApi ;
public class Application {
public static void main ( String [] args ) throws ApiException {
SlidesApi slidesApi = new SlidesApi ( "my_client_id" , "my_client_secret" );
Placeholder response = slidesApi . getPlaceholder ( "MyPresentation.pptx" , 2 , 1 , null , null , "MyStorage" );
System . out . println ( response . toString ());
}
}
C++
Copy
#include "asposeslidescloud/api/SlidesApi.h"
using namespace asposeslidescloud :: api ;
int main ()
{
auto slidesApi = new SlidesApi ( L "my_client_id" , L "my_client_secret" );
auto response = slidesApi -> getPlaceholder ( L "MyPresentation.pptx" , 2 , 1 , L "" , L "" , L "MyStorage" ). get ();
std :: wcout << response -> toJson ();
return 0 ;
}
Perl
Copy
use AsposeSlidesCloud::Configuration ;
use AsposeSlidesCloud::SlidesApi ;
my $config = AsposeSlidesCloud::Configuration -> new ();
$config -> { app_sid } = "my_client_id" ;
$config -> { app_key } = "my_client_secret" ;
my $slides_api = AsposeSlidesCloud::SlidesApi -> new ( config => $config );
my %parameters = ( name => "MyPresentation.pptx" , slide_index => 2 , placeholder_index => 1 , storage => "MyStorage" );
my $response = $slides_api -> get_placeholder ( %parameters );
Swift
Go
SDKs
Using an SDK (API client) is the quickest way for a developer to speed up development. An SDK takes care of a lot of low-level details of making requests and handling responses and lets you focus on writing code specific to your particular project. Check out our GitHub repository for a complete list of Aspose.Slides Cloud SDKs along with working examples, to get you started in no time. Please check Available SDKs article to learn how to add an SDK to your project.