Is commissioning mode possible via API?

Commissioning mode via API is possible with MTR firmware version 4.0.5 and higher or Conduit mPower 5.0.0 and higher. Here are some examples:

// Execute this command to check that the device is in the commissioning mode

curl -k "https://192.168.2.1/api/commissioning"
{
   "code" : 200,
   "status" : "success"
}


// Execute this command to set the username. In the example the username is "admin"

curl -k -X POST -H "Content-Type: json/application" -d '{"username":"admin", "aasID": "", "aasAnswer":""}' https://192.168.2.1:443/api/commissioning
{
   "code" : 200,
   "result" : {
      "aasDone" : false,
      "aasID" : "5EC7E7C8FE2A6E3584D2A124A10E9",
      "aasMsg" : "New password: ",
      "aasType" : "question; input hide"
   },
   "status" : "success"
}


// Execute this command to set the password. Use the aasID value that is received in the previous response. 

curl -k -X POST -H "Content-Type: json/application" -d '{"username":"admin", "aasID": "5EC7E7C8FE2A6E3584D2A124A10E9", "aasAnswer":"Admin123"}' https://192.168.2.1:443/api/commissioning
{
   "code" : 200,
   "result" : {
      "aasDone" : false,
      "aasID" : "5EC7E7C8FE2A6E3584D2A124A10E9",
      "aasMsg" : "Retype new password: ",
      "aasType" : "question; input hide"
   },
   "status" : "success"
}

// Execute this command to confirm the password. If you get a response to the command "Change password success!", it means that the commissioning mode has been completed successfully. 

curl -k -X POST -H "Content-Type: json/application" -d '{"username":"admin", "aasID": "5EC7E7C8FE2A6E3584D2A124A10E9", "aasAnswer":"Admin123"}' https://192.168.2.1:443/api/commissioning
{
   "code" : 200,
   "result" : {
      "aasDone" : true,
      "aasID" : "5EC7E7C8FE2A6E3584D2A124A10E9",
      "aasMsg" : "Change password success!",
      "aasType" : "info"
   },
   "status" : "success"
}