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