Assets
Use this endpoint to obtain details on Salesbox’s Assets.
Base Endpoint
https://segmentai.salesbox.com.br/api/assets
Get Asset
GET /api/assets/{id}
Get an individual Asset by ID.
HTTP Request
GET /api/assets/ID
Response
Expected Response Code: 200
{
"asset": {
"id": 1,
"title": "Product Whitepaper",
"description": "Some description",
"alias": "whitepaper",
"language": "en",
"isPublished": true,
"publishUp": "2024-01-15T10:00:00+00:00",
"publishDown": "2024-01-30T10:00:00+00:00",
"dateAdded": "2024-01-15T10:00:00+00:00",
"createdBy": 1,
"createdByUser": "John Smith",
"dateModified": "2024-01-15T10:30:47+00:00",
"modifiedBy": 1,
"modifiedByUser": "John Smith",
"downloadCount": 10,
"uniqueDownloadCount": 8,
"revision": 1,
"category": {
"createdByUser": "Jane Doe",
"modifiedByUser": "Jane Doe",
"id": 19,
"title": "Whitepapers",
"alias": "whitepapers",
"description": null,
"color": null,
"bundle": "asset"
},
"extension": "pdf",
"mime": "application/pdf",
"size": 269128,
"downloadUrl": "https://segmentai.salesbox.com.br/api/assets/1:whitepaper"
}
}
Asset Properties
Name |
Type |
Description |
|---|---|---|
|
int |
ID of the Asset |
|
string |
Title/name of the Asset |
|
string/null |
Description of the Asset |
|
string |
Used to generate the URL for the Asset |
|
string |
Locale of the Asset |
|
boolean |
Published state |
|
datetime/null |
Asset publish date/time |
|
datetime/null |
Asset unpublish date/time |
|
datetime |
Asset creation date/time |
|
int |
ID of the User that created the Asset |
|
string |
Name of the User that created the Asset |
|
datetime/null |
Asset modified date/time |
|
int |
ID of the User that last modified the Asset |
|
string |
Name of the User that last modified the Asset |
|
int |
Total number of downloads |
|
int |
Unique number of downloads |
|
int |
Revision version |
|
object/null |
Object with the Category details |
|
string |
Extension of the Asset |
|
string |
Mime type of the Asset |
|
int |
File size of the Asset in bytes |
|
string |
Public download URL for the Asset |
List Assets
GET /api/assets
Get a list of assets.
Query Parameters
Name |
Type |
Description |
|---|---|---|
|
string |
Text to search assets by |
|
int |
Which page to display |
|
int |
How many records to return |
|
string |
Column to sort by |
|
string |
Sort direction: asc or desc |
|
string |
Filter by status (published, unpublished) |
Create Asset
POST /api/assets/new
Create a new asset.
Request Body
Name |
Type |
Description |
|---|---|---|
|
string |
Asset title |
|
string |
Asset description |
|
file |
The file to upload |
|
string |
Asset language code |
|
boolean |
Whether the asset should be published |
|
int |
Category ID |
Edit Asset
PATCH /api/assets/{id}/edit
Edit an existing asset.
Request Body
Same fields as Create Asset.
Delete Asset
DELETE /api/assets/{id}/delete
Delete an existing asset.