Using Curl for Commissioning

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 this example, the username is admin. NOTE: Copy or write down the aasID value (a 30-character alphanumeric string provided after you request a commissioning session or password change, which is not the same as the token used to log in) as you must use it in the further commands.

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.  Use aasAnswer value to provide the new password.

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"
}