ResourceGroupList_Load_Query
#
Description#
This function is used pull resource groups and any linked css or JS to each group for a specific Branch.
Parameter |
Type | Description |
---|---|---|
count |
Number | Count is used to tell Miva how many resource groups you want returned. If for example you are querying thousands of resource groups you’ll want to set the count to limit how many you get back in a single request. |
offset |
Offset | Used in conjunction with the Count parameter for paginating results of large datasets. Default is 0 whcih is no offset. |
sort |
String | Field to sort results by. Available sorting fields listed above. Use - prefix for a decending sort. |
Filter |
Object | Array of Object containing search filters. See usage here: List Load Query Overview |
Branch_Name |
String | Name of Branch you want to pull resource groups from |
Changeset_ID |
Number | Optional Changeset ID. If omitted, the response will include templates from the head of the Branch |
On Demand Columns#
Column |
Description |
---|---|
linkedcssresources |
Linked CSS Resources |
linkedjavascriptresources |
Linked JS Resources |
Response Parameters#
Parameter |
Type | Description |
---|---|---|
total_count |
Number | total_count is the total number of records that match your search criteria. Note: this is not always the total products returned. Based on the Count and Offset parameters passed, the number of records returned could be different than the total_count. |
start_offset |
Number | Number number of the starting offset number of branches to return. Used in conjunction with the Count parameter for paginating results of large datasets. |
id |
Number | Resource ID |
code |
String | Resource Code |
linkedcssresources |
Object | Linked resources object |
linkedjavascriptresources |
Object | Linked JavaScript Resources |
linkedcssresources
Object#
Parameter |
Type | Description |
---|---|---|
id |
Number | ID of CSS Resource |
code |
String | CSS Resource Code |
type |
String | One of: L = local file, C = Combined Resource, E = External File, I = Inline |
is_global |
Boolean | true/false for if the resource is global |
Active |
Boolean | true/false whether the resource is Active |
file |
String | Optional File Path used when CSS file is a local file. Should be relative path. |
templ_id |
Number | Template ID if the resource has a page template (inline). Otherwise this will be 0 |
Attributes |
Object | Attributes Object |
Attributes
Object#
Parameter |
Type | Description |
---|---|---|
name |
String | The name of the CSS attribute. Examples: type, media, rel, etc |
value |
String | The value of the CSS attribute. Examples: text\/css, all, stylesheet |
linkedjavascriptresources
Object#
Parameter |
Type | Description |
---|---|---|
id |
Number | ID of JS Resource |
code |
String | JS Resource Code |
type |
String | One of: L = local file, C = Combined Resource, E = External File, I = Inline |
is_global |
Boolean | true/false for if the resource is global |
Active |
Boolean | true/false whether the resource is Active |
file |
String | Optional File Path used when JS file is a local file. Should be relative path. |
templ_id |
Number | Template ID if the resource has a page template (inline). Otherwise this will be 0 |
Attributes |
Object | Array of any attributes associated with the JS file. These will be listed as name/value pairs |
Attributes
Object#
Parameter |
Type | Description |
---|---|---|
name |
String | The name of the JS attribute. Example: type |
value |
String | The value of the JS attribute. Example: text\/javascript |
Example Request#
{
"Store_Code": "{{Store_Code}}",
"Miva_Request_Timestamp": "{{$timestamp}}",
"Function": "ResourceGroupList_Load_Query",
"Branch_Name": "MMT",
"Count": 0,
"Offset": 0,
"Sort": "",
"Filter": [
{
"name": "ondemandcolumns",
"value": ["linkedcssresources", "linkedjavascriptresources"]
}
]
}
Example Response#
{
"success": 1,
"data": {
"total_count": 3,
"start_offset": 0,
"data": [
{
"id": 2,
"code": "head_tag",
"linkedcssresources": [
{
"id": 7,
"code": "square-payment",
"type": "I",
"is_global": false,
"active": true,
"file": "",
"templ_id": 437,
"attributes": [
{
"name": "type",
"value": "text/css"
},
{
"name": "media",
"value": "all"
}
]
}
],
"linkedjavascriptresources": [
{
"id": 7,
"code": "GTM-dataLayer",
"type": "I",
"is_global": true,
"active": false,
"file": "",
"templ_id": 439,
"attributes": []
},
{
"id": 10,
"code": "legacy-browsers",
"type": "I",
"is_global": true,
"active": true,
"file": "",
"templ_id": 441,
"attributes": []
}
]
},
{
"id": 3,
"code": "footer_js",
"linkedcssresources": [],
"linkedjavascriptresources": [
{
"id": 1,
"code": "settings",
"type": "I",
"is_global": true,
"active": true,
"file": "",
"templ_id": 438,
"attributes": []
},
{
"id": 8,
"code": "scripts",
"type": "C",
"is_global": true,
"active": true,
"file": "",
"templ_id": 0,
"attributes": []
},
{
"id": 6,
"code": "contact",
"type": "L",
"is_global": false,
"active": true,
"file": "themes/00000001/shadows/extensions/contact/contact.js",
"templ_id": 0,
"attributes": []
},
{
"id": 9,
"code": "product-json-ld",
"type": "I",
"is_global": false,
"active": true,
"file": "",
"templ_id": 440,
"attributes": [
{
"name": "type",
"value": "application/ld+json"
}
]
}
]
},
{
"id": 4,
"code": "css_list",
"linkedcssresources": [
{
"id": 5,
"code": "preconnect-google-analytics",
"type": "E",
"is_global": true,
"active": true,
"file": "//www.google-analytics.com",
"templ_id": 0,
"attributes": [
{
"name": "rel",
"value": "preconnect"
},
{
"name": "crossorigin",
"value": ""
}
]
},
{
"id": 4,
"code": "preconnect-google-fonts",
"type": "E",
"is_global": true,
"active": true,
"file": "https://fonts.gstatic.com",
"templ_id": 0,
"attributes": [
{
"name": "rel",
"value": "preconnect"
},
{
"name": "crossorigin",
"value": ""
}
]
},
{
"id": 3,
"code": "google-fonts",
"type": "E",
"is_global": true,
"active": true,
"file": "https://fonts.googleapis.com/css?family=Poppins:400,500,700",
"templ_id": 0,
"attributes": [
{
"name": "rel",
"value": "stylesheet"
}
]
},
{
"id": 8,
"code": "stylesheet",
"type": "C",
"is_global": true,
"active": true,
"file": "",
"templ_id": 0,
"attributes": [
{
"name": "type",
"value": "text/css"
},
{
"name": "media",
"value": "all"
},
{
"name": "rel",
"value": "stylesheet"
}
]
},
{
"id": 12,
"code": "paypalcp",
"type": "I",
"is_global": false,
"active": true,
"file": "",
"templ_id": 478,
"attributes": [
{
"name": "type",
"value": "text/css"
},
{
"name": "media",
"value": "all"
}
]
}
],
"linkedjavascriptresources": []
}
]
}
}