Bncs Parameters

<< Click to Display Table of Contents >>

Navigation:  Web UI & API > Extending UI & API > Javascript API Client > Making API Calls >

Bncs Parameters

Instance Management

getInstances():

 

Retrieves all available instances.

 

Returns: a string array of the instance-ids of all the instances

 

Example:

 

  let instances = await apiClient.getInstances();
  console.log("Available Instances: " + instances.length);

 

Parameter Operations

getParameters(instanceId):

 

Gets a minified version of bncs parameters for a specific instance.

 

Parameters:

 

•instanceId (string): The instance ID

 

Returns: object representing the key-value pairs of the parameter names and values for the specified instance.

 

let parameters= await apiClient.getParameters("Copenhagen/dLiveIP03");
//mute parameter
let muteValue=parameters.mute;
//fadeLevel parameter
let faderValue=parameters.faderLevel;
  if(muteValue===1)
   console.log("Mute ON")
  else{
   console.log("Mute OFF")}

 

getDetailedParameters(instanceId):

 

Gets the more detailed bncs parameters for a specific instance.

 

Parameters:

 

•instanceId (string): The instance ID

Returns: array of objects representing detailed parameters for that instance, the schema is as below:

 

       let parameters= await apiClient.getDetailedParameters("Copenhagen/dLiveIP03");
       parameters.forEach((param)=>{
           console.log("Param Name:  " + param.name + "Param Value:  " + param.value)
       });

 

Parameter object schema:

 

  //Unique identifier for the parameter instance
 instanceId: string;
//Numeric identifier of the associated device
 deviceId: number;
/**
  * guid: Globally unique identifier for the parameter
  * @format uuid
  * @example "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8"
  */
 uid: string;
/**
  * Current parameter value (type varies by parameter)
  * - Could be primitive (string/number/boolean) or complex object
  */
 value: any;
//Human-readable explanation of the parameter
 description: string;
//Classification/category of the parameter
 class: string;
//Parameter identifier name
 name: string;
//Indicates if parameter is modifiable
 readonly: boolean;
// slot position
 slot: number;

 

patchParameters(instanceId, data):

 

Updates specific parameters for an instance (partial update).

 

Parameters:

 

•instanceId (string): The instance ID

•data (Object): Parameters to be updated

 

Example:

 

await apiClient.patchParameters('instance1', {
 
param1: 'value1',
 
param2: 'value2'
 
});

 

putParameters(instanceId, data):

 

Replaces all parameters for an instance (full update).

 

Parameters:

 

•instanceId (string): The instance ID

•data (Object): Dictionary of all parameters

 

Example:

 

await apiClient.put('instance1', {
 
param1: 'value1',
 
param2: 'value2'
 
});

 

optionParameters(instanceId):

 

Gets all the parameter Ids of an instance.

 

Parameters:

 

•instanceId (string): The instance ID

 

Returns: available parameters on the instance as options

 

let params= await apiClient.optionParameters("Copenhagen/dLiveIP03");
params.forEach((param)=>{console.log("Param Id:  " + param); });

 

Individual Parameter Operations

optionsParam(instanceId, parameterId):

 

Gets the entire definition of a specific parameter.

 

Parameters:

 

•instanceId (string): The instance ID

•parameterId (string): The parameter ID

 

Returns: The parameter definition: Refer to schema on getDetailedParameters(instanceId):

 

let param= await apiClient.optionsParam("Copenhagen/dLiveIP03","faderLevel");
console.log("Param Name:  " + param.name + "Param Value:  " + param.value);
getParamValue(instanceId, parameterId):

 

Gets the value of a specific parameter.

 

Parameters:

 

•instanceId (string): The instance ID

•parameterId (string): The parameter ID

 

Returns: The parameter value

 

let param= await apiClient.getParamValue("Copenhagen/dLiveIP03","faderLevel");
console.log("Param value:  " + param);
putParamValue(instanceId, parameterId, value):

 

Sets the value of a specific parameter.

 

Parameters:

 

•instanceId (string): The instance ID

•parameterId (string): The parameter ID

 

value (any): The new parameter value

 

Example:

 

await apiClient.putParamValue("Copenhagen/dLiveIP03", "faderLevel", 0);