The assets API provides functionality for uploading and removing assets (images and fonts) in your account.
Uploads an asset file. For images, only PNG and JPEG files are currently supported. For fonts, TTF and OTF are supported.
https://api.astradoc.io/assets/v1.0/create
| Property | Type | Required | Description |
|---|
| name | String | Yes | The name of the asset, usually the file name. Names longer than 64 characters will be truncated. |
| data | String | Yes | Base64 string containing the serialized file data. |
| projectId | Guid | No | The Id of project this asset should be assigned to. This is optional. |
| type | Integer | Yes | The asset type the API can expect this file to be. See the table below for the valid asset type values. |
| Value | Type |
|---|
| 1 | PNG Image |
| 2 | JPEG Image |
| 3 | TTF Font |
| 4 | OTF Font |
| Property | Type | Description |
|---|
| Success | Bool | A Boolean indicating whether or not the request was successful. |
| Message | String | A message containing error information if the request was unsuccessful. |
| Data | Guid | The Id for the asset. |
Removes an asset from your account.
https://api.astradoc.io/assets/v1.0/delete?assetId={id}
| Property | Type | Required | Description |
|---|
| id | Guid | Yes | The Id of the asset to delete. This Id would have been returned by the Create Asset API. |
| Property | Type | Description |
|---|
| Success | Bool | A Boolean indicating whether or not the request was successful. |
| Message | String | A message containing error information if the request was unsuccessful. |
| Data | Bool | A Boolean indicating whether or not the asset was deleted. |