|  Developer

cloudAPI

  • Then-block to call any cloud command. Return Cloud API info.
Edit
Field Type Required Description
blockOptions.method.args.cloudApiName string + API suffix: part of a command to construct the whole command before sending cloudPrefix =
blockOptions.method.args.version int + Cloud api version, Version: types =
blockOptions.method.args.params string + Params: serialized “params” object of a future cloud API call.Filled with a UI.
saveResult object Save result to an existing global variable
saveResult.method string + Save result method name
saveResult.args.name string + Name of stored value
Edit
Data Internal error code Message
BAD_PARAMS Wrong params,
Edit
				
					{
   "blockType":"then",
   "blockOptions":{
      "method":{
         "name":"cloudAPI",
         "args":{
            "method":"cloudApiName",      
            "version": "version",  
            "params": "params"      
         }
      }
   },
   "fields":[     
      {
         "name": "cloudApiName",
         "type": "string",
         "value": "controller_notify_user"
      },

      {
         "name":"version",
         "type":"int",
         "value": 1
      },

      {
         "name":"params",
         "type":"string",
         "value": "{\"name\":\"notify-users\",\"parameters\":[{\"name\":\"default\",\"body\":\"hello world!\",\"subject\":\"email subject\"},{\"name\":\"target\",\"targets\":[{\"type\":\"user\",\"uuid\":\"2847422\",\"channels\":[\"email\",\"push\"]}]}]}"
      }
   ],
   "saveResult": {
        "method": "setVariable",
        "args": {
            "name": "<existingVariableName>",
            "valueType": "string"
        }
   }
}				
			

Note: Ability to save result of a Cloud API request action in a global variable, using optional block is available since advanced_scenes/1.43.

Edit
				
					{
  "id": "5c6ec961cc01eb07f86f9dd9",
  "method": cloudPrefix + "fields[name=cloudApiName].value>",
  "api": <fields[name=version].value>,
  "params": <fields[name=params].value>
}				
			
cloudPrefix = “cloud.”. The cloudPrefix should be added to cloud API to point full name of a cloud command.