BranchList_Load_Query
#
Description#
This function is used to load a list of Template Branches from a Miva Store.
Request Body Parameters#
Parameter |
Type | Description |
---|---|---|
count |
Number | Count is used to tell Miva how many JS Resources you want returned. |
offset |
Offset | Used in conjunction with the Count parameter for paginating results of large datasets. Default is 0 . |
sort |
String | Field to sort results by. Available sorting fields listed below. Use - prefix for a descending sort. |
filter |
Object | Array of Object containing search filters. See usage here |
Supported Sort Columns#
One of these values would be passed in the sort request parameter to have the results sorted by that column. Value may be preceded by -
for a descending sort.
Sort | Description |
---|---|
id |
Branch ID |
On Demand Columns#
Column |
Description |
---|---|
source |
Template Source |
settings |
Template Settings |
Response Parameters#
Parameter |
Type | Description |
---|---|---|
total_count |
Number | total_count is the total number of records that match your search criteria. |
start_offset |
Number | Number of the starting offset number of branches to return. Used in conjunction with the Count parameter. |
id |
Number | Template Branch ID |
immutable |
Boolean | Flag for whether the branch is immutable |
branchkey |
String | Unique Identifier for Branch |
name |
String | Branch Name |
color |
String | Branch Color Chip Color. Hex value including # |
is_primary |
Boolean | Boolean flag to identify the primary branch. This is the branch live traffic is seeing. |
is_working |
Boolean | Boolean flag to identify the working branch. This is the branch user is currently viewing in the admin. |
preview_url |
String | Preview URL to this specific branch |
Example Request#
{
"Store_Code": "{{Store_Code}}",
"Miva_Request_Timestamp": "{{$timestamp}}",
"Function": "BranchList_Load_Query",
"Count": 0,
"Offset": 0,
"Sort": "id",
"Filter": [
{
"name": "ondemandcolumns",
"value": [
"source",
"settings"
]
}
]
}
Example Response#
{
"success": 1,
"data": {
"total_count": 6,
"start_offset": 0,
"data": [
{
"id": 1,
"immutable": true,
"branchkey": "d9c3c37d58bdbd1cc3f7a8de93ffdb0b",
"name": "Production",
"color": "#20c171",
"is_primary": true,
"is_working": true,
"preview_url": "https://mivadevtest.com/storefront.html?BranchKey=d9c3c37d58bdbd1cc3f7a8de93ffdb0b"
},
{
"id": 2,
"immutable": false,
"branchkey": "ea8c19ad042b477a40e3abe6e987be27",
"name": "Dev Store 1",
"color": "#20c171",
"is_primary": false,
"is_working": false,
"preview_url": "https://mivadevtest.com/storefront.html?BranchKey=ea8c19ad042b477a40e3abe6e987be27"
},
{
"id": 3,
"immutable": false,
"branchkey": "ea53f12fce9012049082795014ad85c1",
"name": "Staging",
"color": "#ffa700",
"is_primary": false,
"is_working": false,
"preview_url": "https://mivadevtest.com/storefront.html?BranchKey=ea53f12fce9012049082795014ad85c1"
},
{
"id": 4,
"immutable": false,
"branchkey": "012f7cb816925a1c32acac270e1593ae",
"name": "Homepage Redesign",
"color": "#20c171",
"is_primary": false,
"is_working": false,
"preview_url": "https://mivadevtest.com/storefront.html?BranchKey=012f7cb816925a1c32acac270e1593ae"
},
{
"id": 5,
"immutable": false,
"branchkey": "13013b0eeaa347357771b9b72fae2a11",
"name": "Dev Branch - Brennan",
"color": "#ffeb00",
"is_primary": false,
"is_working": false,
"preview_url": "https://mivadevtest.com/storefront.html?BranchKey=13013b0eeaa347357771b9b72fae2a11"
},
{
"id": 7,
"immutable": false,
"branchkey": "a69e9626653b978b4ee41e93e9e43eca",
"name": "Product Page Updates",
"color": "#20c171",
"is_primary": false,
"is_working": false,
"preview_url": "https://mivadevtest.com/storefront.html?BranchKey=a69e9626653b978b4ee41e93e9e43eca"
}
]
}
}