SharedBrandConfig
in package
SharedBrandConfig API
Manage shared brand configurations (themes) that can be reused across multiple accounts. This API allows creating, updating, and deleting shared themes.
Canvas API Documentation: https://canvas.instructure.com/doc/api/shared_brand_configs.html
IMPORTANT LIMITATIONS:
- Canvas does NOT provide endpoints to list or fetch shared brand configs
- You must track shared config IDs externally
- The DELETE endpoint has a different path pattern (no account_id)
Note: This class does not extend AbstractBaseApi because Canvas doesn't provide fetch/list operations for shared brand configs.
Table of Contents
Properties
- $accountId : string|null
- The id of the account it should be shared within
- $brandConfigMd5 : string|null
- MD5 hash of the brand config to share (BrandConfigs are identified by MD5, not numeric id)
- $createdAt : string|null
- When this was created
- $id : int|null
- The shared brand config identifier
- $name : string|null
- The name to share this theme as
- $updatedAt : string|null
- When this was last updated
Methods
- __construct() : mixed
- Constructor
- create() : self
- Create a new shared brand config
- delete() : self
- Delete a shared brand config
- remove() : self
- Delete this shared brand config (instance method)
- toArray() : array<string, mixed>
- Convert the shared brand config to an array
- update() : self
- Update an existing shared brand config
Properties
$accountId
The id of the account it should be shared within
public
string|null
$accountId
= null
$brandConfigMd5
MD5 hash of the brand config to share (BrandConfigs are identified by MD5, not numeric id)
public
string|null
$brandConfigMd5
= null
$createdAt
When this was created
public
string|null
$createdAt
= null
$id
The shared brand config identifier
public
int|null
$id
= null
$name
The name to share this theme as
public
string|null
$name
= null
$updatedAt
When this was last updated
public
string|null
$updatedAt
= null
Methods
__construct()
Constructor
public
__construct([array<string, mixed> $data = [] ]) : mixed
Parameters
- $data : array<string, mixed> = []
-
The shared brand config data from Canvas API
create()
Create a new shared brand config
public
static create(array<string, mixed>|CreateSharedBrandConfigDTO $data) : self
Creates a SharedBrandConfig which gives the specified brand_config a name and makes it available to other users of this account.
API Endpoint: POST /api/v1/accounts/:account_id/shared_brand_configs
Parameters
- $data : array<string, mixed>|CreateSharedBrandConfigDTO
-
The shared brand config data
Tags
Return values
self —The created SharedBrandConfig object
delete()
Delete a shared brand config
public
static delete(int $id) : self
Deletes a SharedBrandConfig, which will unshare it so neither you nor anyone else in your account will see it as an option to pick from.
IMPORTANT: The DELETE endpoint has a different path pattern - it does NOT include the account_id in the path.
API Endpoint: DELETE /api/v1/shared_brand_configs/:id
Parameters
- $id : int
-
The ID of the shared brand config to delete
Tags
Return values
self —The deleted SharedBrandConfig object
remove()
Delete this shared brand config (instance method)
public
remove() : self
Deletes the current SharedBrandConfig instance.
Tags
Return values
self —The deleted SharedBrandConfig object
toArray()
Convert the shared brand config to an array
public
toArray() : array<string, mixed>
Return values
array<string, mixed> —The shared brand config data as an array
update()
Update an existing shared brand config
public
static update(int $id, array<string, mixed>|UpdateSharedBrandConfigDTO $data) : self
Updates the specified shared_brand_config with a new name or to point to a new brand_config MD5.
API Endpoint: PUT /api/v1/accounts/:account_id/shared_brand_configs/:id
Parameters
- $id : int
-
The ID of the shared brand config to update
- $data : array<string, mixed>|UpdateSharedBrandConfigDTO
-
The update data
Tags
Return values
self —The updated SharedBrandConfig object