appinfo.setAuthKey - GiGAGenie-ServiceSDK/UserGuide GitHub Wiki
gigagenie.appinfo.setAuthKey
API ์ค๋ช
- AuthKey ์ค์ API
- ํด๋น ์ฑ์ ๋ํ G-Box ์ AuthKey๋ฅผ ์ค์ ํจ
API ๊ตฌ์กฐ
- function setAuthKey(options,callback)
options
authkey
: (String, Mandatory) ์ค์ ํ๋ ค๋ authkey(์๋ฆฌ์ ์ ํ: 256Byte, 2048Bit)
duetime
: (String, Optional) ์ค์ ํ๋ ค๋ authkey์ ๋ง๋ฃ ์๊ฐ(ํ์: YYYYMMDDhhmmss, 20170519184202)
result_cd
200
: ์ฑ๊ณต
400
: authkey ์ ํ ์ด๊ณผ
500
: ์์คํ
Error
extra
์ฌ์ฉ ์์
// callback ๋ฐฉ์
var options = {};
options.authkey = 'asdasldkjalskdasd';
options.duetime = '20180519184202';
gigagenie.appinfo.setAuthKey(options, function (result_cd, result_msg, extra) {
if (result_cd === 200) {
console.log("AuthKey Set is Success");
} else {
console.log("AuthKey Set is fail.");
}
});
// promise ๋ฐฉ์
var options = {};
options.authkey = 'asdasldkjalskdasd';
options.duetime = '20180519184202';
gigagenie.appinfo.setAuthKey(options).then(function (extra) {
console.log("AuthKey Set is Success");
}).catch(function (result_cd, result_msg, extra) {
if (result_cd === 400) {
console.log("AuthKey Size exceeded.");
} else {
console.log("AuthKey Set is fail.");
}
})