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
    • null

์‚ฌ์šฉ ์˜ˆ์‹œ

// 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.");
    }
})