Create a standard page asset
First, use the API to create a new standard page asset from within your code.
Command
Use the following command to create your standard page asset:
POST https://website.matrix.squiz.cloud/__management_api/v1/assets
Payload
Set the following fields as shown on the example standard page payload:
{
"asset": {
"type": "page_standard", (1)
"attributes": {
"name": "EXAMPLE PAGE", (2)
"short_name": "Example Page"
},
"published": null,
"metadata_schemas": [],
"metadata_values": null,
"external_id": ""
},
"parent": {
"asset_id": "1", (3)
"link_type": "menu",
"value": "",
"sort_order": -1,
"is_dependent": false,
"is_exclusive": false
}
}
1 | Set the type to page_standard . |
2 | Give the asset a name in the name field. |
3 | Specify where to place the new field by adding the parent asset ID in the parent:asset_id field. |
Response
Newly created assets will have a Matrix status of under_construction |
The API response will contain:
{
"id": "1821", (1)
"type": "page_standard", (2)
"attributes": {
"name": "EXAMPLE PAGE", (3)
"short_name": "Example Page"
},
"status": "under_construction",
"version": "0.0.1",
"created": {
"date_time_unix": 1641875024,
"user_id": "1227"
},
"updated": {
"date_time_unix": 1641875025,
"user_id": "1227"
},
"published": null,
"status_changed": {
"date_time_unix": 1641875024,
"user_id": "1227"
},
"metadata_schemas": [],
"metadata_values": null,
"paint_layouts": {
"asset_level": null,
"asset_level_override": null,
"url_based": {},
"user_defined": {}
},
"external_id": ""
}
1 | The asset ID in the id field. |
2 | The asset type created in the type field. |
3 | The name specified in the payload. |