Skip to content

Latest commit

 

History

History
196 lines (130 loc) · 9.79 KB

BrandTemplateApi.md

File metadata and controls

196 lines (130 loc) · 9.79 KB

Integrations\Canva\SDK\BrandTemplateApi

All URIs are relative to https://api.canva.com/rest, except if the operation defines another base path.

Method HTTP request Description
getBrandTemplate() GET /v1/brand-templates/{brandTemplateId}
getBrandTemplateDataset() GET /v1/brand-templates/{brandTemplateId}/dataset
listBrandTemplates() GET /v1/brand-templates

getBrandTemplate()

getBrandTemplate($brand_template_id): \Integrations\Canva\SDK\Model\GetBrandTemplateResponse

Later this year, we'll be updating all brand template IDs. If your integration stores brand template IDs, you'll need to migrate to the new IDs. Once we implement this change, you'll have 6 months to update the IDs. To use this API, your integration must act on behalf of a user that's a member of a Canva Enterprise organization. Retrieves the metadata for a brand template.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: oauthAuthCode
$config = Integrations\Canva\SDK\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Integrations\Canva\SDK\Api\BrandTemplateApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$brand_template_id = 'brand_template_id_example'; // string | The brand template ID.

try {
    $result = $apiInstance->getBrandTemplate($brand_template_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BrandTemplateApi->getBrandTemplate: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
brand_template_id string The brand template ID.

Return type

\Integrations\Canva\SDK\Model\GetBrandTemplateResponse

Authorization

oauthAuthCode

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getBrandTemplateDataset()

getBrandTemplateDataset($brand_template_id): \Integrations\Canva\SDK\Model\GetBrandTemplateDatasetResponse

Later this year, we'll be updating all brand template IDs. If your integration stores brand template IDs, you'll need to migrate to the new IDs. Once we implement this change, you'll have 6 months to update the IDs. To use this API, your integration must act on behalf of a user that's a member of a Canva Enterprise organization. Gets the dataset definition of a brand template. If the brand template contains autofill data fields, this API returns an object with the data field names and the type of data they accept. You can autofill a brand template using the Create a design autofill job API.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: oauthAuthCode
$config = Integrations\Canva\SDK\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Integrations\Canva\SDK\Api\BrandTemplateApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$brand_template_id = 'brand_template_id_example'; // string | The brand template ID.

try {
    $result = $apiInstance->getBrandTemplateDataset($brand_template_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BrandTemplateApi->getBrandTemplateDataset: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
brand_template_id string The brand template ID.

Return type

\Integrations\Canva\SDK\Model\GetBrandTemplateDatasetResponse

Authorization

oauthAuthCode

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listBrandTemplates()

listBrandTemplates($query, $continuation, $ownership, $sort_by): \Integrations\Canva\SDK\Model\ListBrandTemplatesResponse

Later this year, we'll be updating all brand template IDs. If your integration stores brand template IDs, you'll need to migrate to the new IDs. Once we implement this change, you'll have 6 months to update the IDs. To use this API, your integration must act on behalf of a user that's a member of a Canva Enterprise organization. Get a list of the brand templates the user has access to.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: oauthAuthCode
$config = Integrations\Canva\SDK\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Integrations\Canva\SDK\Api\BrandTemplateApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$query = 'query_example'; // string | Lets you search the brand templates available to the user using a search term or terms.
$continuation = 'continuation_example'; // string | If the success response contains a continuation token, the user has access to more brand templates you can list. You can use this token as a query parameter and retrieve more templates from the list, for example `/v1/brand-templates?continuation={continuation}`. To retrieve all the brand templates available to the user, you might need to make multiple requests.
$ownership = new \Integrations\Canva\SDK\Model\OwnershipType(); // OwnershipType | Filter the list of brand templates based on the user's ownership of the brand templates. This can be one of the following:  - `any`: (Default) Brand templates owned by and shared with the user. - `owned`: Brand templates owned by the user. - `shared`: Brand templates shared with the user.
$sort_by = new \Integrations\Canva\SDK\Model\SortByType(); // SortByType | Sort the list of brand templates. This can be one of the following:  - `relevance`: (Default) Sort results using a relevance algorithm. - `modified_descending`: Sort results by the date last modified in descending order. - `modified_ascending`: Sort results by the date last modified in ascending order. - `title_descending`: Sort results by title in descending order. - `title_ascending`: Sort results by title in ascending order.

try {
    $result = $apiInstance->listBrandTemplates($query, $continuation, $ownership, $sort_by);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BrandTemplateApi->listBrandTemplates: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
query string Lets you search the brand templates available to the user using a search term or terms. [optional]
continuation string If the success response contains a continuation token, the user has access to more brand templates you can list. You can use this token as a query parameter and retrieve more templates from the list, for example `/v1/brand-templates?continuation={continuation}`. To retrieve all the brand templates available to the user, you might need to make multiple requests. [optional]
ownership OwnershipType Filter the list of brand templates based on the user's ownership of the brand templates. This can be one of the following: - `any`: (Default) Brand templates owned by and shared with the user. - `owned`: Brand templates owned by the user. - `shared`: Brand templates shared with the user. [optional]
sort_by SortByType Sort the list of brand templates. This can be one of the following: - `relevance`: (Default) Sort results using a relevance algorithm. - `modified_descending`: Sort results by the date last modified in descending order. - `modified_ascending`: Sort results by the date last modified in ascending order. - `title_descending`: Sort results by title in descending order. - `title_ascending`: Sort results by title in ascending order. [optional]

Return type

\Integrations\Canva\SDK\Model\ListBrandTemplatesResponse

Authorization

oauthAuthCode

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]