$.ajax({
type: ‘POST’,
contentType: “application/json”,
url: myURL,
data: myData,
dataType: “json”,
success: function(data, status) {
$(‘#result-data’).append(JSON.stringify(data));
$(‘#result-status’).append(status);
$(‘#result-token’).append(data.result.token);
}
});
My new result is:
{“error_code”:0,”result”:{“regTime”:”2016-10-23 23:45:58″,”email”:”[email protected]”,”token”:”00xxx111-x1234b45cd6e7fghij89k0l”}}
My “Success” data is being appended to DIV layers for testing purposes:
]]>Code:
$.post(“https://use1-wap.tplinkcloud.com”,
{
method: “login”,
params: {
appType: “Kasa_Android”,
cloudUserName: “[email protected]”,
cloudPassword: “SimplePasswordLettersandNumbers”,
terminalUUID: “b6085622-86e0-4940-8fd3-4b60862de994”
}
},
function(data,status) {
$(‘#result-data’).append(JSON.stringify(data));
$(‘#result-status’).append(status);
}, “json” );
The above code returns error:
{“error_code”:-10100,”msg”:”JSON format error”}
Anyone know what I’m doing wrong?
]]>Authenticate to TP-Link cloud API and get a token
http://itnerd.space/2017/06/19/how-to-authenticate-to-tp-link-cloud-api/
]]>