appinfo.getAuthKey - GiGAGenie-ServiceSDK/UserGuide GitHub Wiki
gigagenie.appinfo.getAuthKey
API μ€λͺ
- AuthKey μ‘°ν API
- ν΄λΉ μ±μ λν G-Boxμ AuthKeyλ₯Ό μ‘°νν¨
API ꡬ쑰
- function getAuthKey(options,callback)
options
result_cd
200
: μ±κ³΅
404
: AuthKey μ€μ λμ΄ μμ§ μμ
500
: μμ€ν
Error
extra
authkey
: (String) authKey κ°
settime
: (String) authKey κ° μ€μ λ μκ°(νμ: YYYYMMDDhhmmss, 20170519184202)
duetime
: (String) authKey μ λ§λ£ μμ μκ°
sid
: (String) sid κ°(result_cdκ° 200μ΄κ±°λ 404μΌ λ μ λ¬)
μ¬μ© μμ
// callback λ°©μ
var options = {};
gigagenie.appinfo.getAuthKey(options, function (result_cd, result_msg, extra) {
if (result_cd === 200) {
console.log("Key value is " + extra.authkey);
console.log("SetTime value is " + extra.settime);
console.log("DueTime value is " + extra.duetime);
} else if (result_cd === 404) {
console.log("Key is not set.");
} else {
console.log("getAuthKey is fail.");
}
});
// promise λ°©μ
var options = {};
gigagenie.appinfo.getAuthKey(options).then(function (extra) {
console.log("Key value is " + extra.authkey);
console.log("SetTime value is " + extra.settime);
console.log("DueTime value is " + extra.duetime);
}).catch(function (result_cd, result_msg, extra) {
if (result_cd === 404) {
console.log("Key is not set.");
} else {
console.log("getAuthKey is fail.");
}
})