Created by potrace 1.16, written by Peter Selinger 2001-2019

Miva Developer Docs

This function updates an existing JS Resource in Miva's JS Resource Management.


Description#

This function updates an existing JS Resource in Miva’s JS Resource Management.

Request Parameters#

Parameter Type Required Description
JavaScriptResource_ID
Edit_JavaScriptResource
JavaScriptResource_Code
Number
String
String
One of these Required. ID or code of the JS resource to update. One of the three must be sent. If JavaScriptResource_ID or Edit_JavaScriptResource is sent, JavaScriptResource_Code sets a new code for the resource.
JavaScriptResource_Global Boolean No Whether the resource is global.
JavaScriptResource_Active Boolean No Whether the resource is active.
JavaScriptResource_File_Path String No File path of the resource. Max 254 characters. Required by the source for local and external file resources.
JavaScriptResource_Module_Code String Yes Code of the module that provides the resource. Only read for module resources. If either module field is sent, both are required. The module must be active and implement the jsresource feature.
JavaScriptResource_Module_Data String Yes Module data for the resource. Max 100 characters. Only read for module resources. If either module field is sent, both are required.
JavaScriptResource_Attributes Array Array of attribute objects, each with a required name and an optional value. When sent, it replaces the existing attributes.

Example Request#

{
    "Store_Code": "{{Store_Code}}",
    "Miva_Request_Timestamp": "{{$timestamp}}",
    "Function": "JavaScriptResource_Update",
    "JavaScriptResource_Code": "test",
    "JavaScriptResource_File_Path": "themes/00000001/shadows/custom1.js",
    "JavaScriptResource_Global": true,
    "JavaScriptResource_Active": true
}

Example Response#

{
    "success": 1
}