API Templates Get

    Purpose

    Retrieve a list of templates.

    Arguments

    Type Name Description Default Optional?
    int start Index of first template to get ( 0 based ) 0 Yes
    int amount Total number of templates to get 20 Yes
    string sortby Sort by field ('id', 'theme_id'', 'product_id', 'title'', 'size_in_pixels', 'orientation', 'borderless') 'id' Yes
    string sortdir Sort by direction ('ASC', 'DESC') 'ASC' Yes
    associative array filter Filter results based on a combination of fields and values. Fields: 'theme_id'', 'product_id', 'title'', 'size_in_pixels', 'orientation', 'borderless'. See examples below. Empty array Yes

    Sample Usage

    $client = new SoapClient('http://l001.pageprodigy.com/api/soap/?wsdl');
    
    $start = 30;
    $amount = 30; // This will retrieve templates indexed 30 - 59
    $sortby = 'title';
    $sortdir = 'ASC';
    
    //This will retrieve only results with size_in_pixels matching 2550x3300 
    //and have an orientation of landscape.
    $filter = array('size_in_pixels' => '2550x3300', 'orientationn' => 'landscape'); 
    
    
    $session = $client->login('apiUser', 'apiKey');
    $api_result = $client->call($session, 'design_templates.get', 
               array($start, $amount, $sortby, $sortdir, $filter));
    
    echo $api_result['total_selected'];
    foreach ($api_result['templates'] as $r) {
    
       echo $r['title'];
       echo $r['theme_info']['title'];
    
    }
    
    

    Returns

    Type Name Description
    boolean sucess Return true if query is successful
    integer total Returns total number of templates based on filter
    integer total_selected Returns total number of templates based on filter, start and amount.
    array templates An array of templateEntity

    The templateEntity content is as follows:

    Type Name Description
    integer id The ID of the Template
    string title The title of the Template
    string filename The filename of the Template
    string size The size of the template in a human readable format, i.e. A3 11.69" x 16.54", landscape
    string size_in_pixels The size of the template based on 300dpi pixels shown in [width]x[height] whether or not the template is portrait or landscape, i.e. 3508x4961.
    string orientation One of two options: portrait or landscape.
    string description Description of the Template.
    integer borderless Whether or not the Template is borderless. 0 = Has margins, 1 = borderless (bleed).
    integer designer_id The ID of the user who last updated the Template.
    array theme_info Array of a single designTemplateThemeEntity associated with the Template.
    array product_info Array of a single designTemplateProductEntity associated with the Template.
    string created_time Time stamp of the creation date of the design.
    string update_time Time stamp of the most recent update of this design.

    The designTemplateThemeEntity content is as follows:

    Type Name Description
    integer id The ID of the Theme.
    string title Title of the Theme.
    string created_time Time stamp of the creation date of the Theme.
    string update_time Time stamp of the most recent update of this Theme.

    The designTemplateProductEntity content is as follows:

    Type Name Description
    integer id The ID of the Product.
    string title Title of the Product.
    string description Description of the Product.
    string created_time Time stamp of the creation date of the Product.
    string update_time Time stamp of the most recent update of this Product.