appdata.getKeyData - GiGAGenie-ServiceSDK/UserGuide GitHub Wiki
gigagenie.appdata.getKeyData
API 설명
- 데이터 조회 API
- 특정 이름의 데이터네임스페이스의 Key에 대한 Data를 조회한다.
API 구조
- function getKeyData(options,callback)
options
namespace
: (String, Mandatory) 조회할 appdata Namespace
key
: (String, Mandatory) 해당 NameSpace에서 조회할 데이터 Key
result_cd
200
: 성공
403
: 해당 NameSpace가 존재하지 않음
404
: 해당 Key가 존재하지 않음
500
: 시스템 Error
extra
data
: (String, Mandatory) key에 대한 text 데이터
사용 예시
// callback 방식
var options = {};
options.namespace = 'userappprofile';
options.key = 'appusername';
gigagenie.appdata.getKeyData(options, function (result_cd, result_msg, extra) {
if (result_cd === 200) {
console.log(options.key + ":" + extra.data);
} else {
console.log("Error");
}
});
// promise 방식
var options = {};
options.namespace = 'userappprofile';
options.key = 'appusername';
gigagenie.appdata.getKeyData(options).then(function (extra) {
console.log(options.key + ":" + extra.data);
}).catch(function (result_cd, result_msg, extra) {
console.log("Error");
})