์›๊ฒฉ ๊ตฌ์„ฑ

๐Ÿ“˜

HTTP API๋Š” ์„œ๋ฒ„ ํ™˜๊ฒฝ์—์„œ๋งŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

HTTP API๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์‚ฌ์šฉ์ž์— ๋Œ€ํ•œ ์›๊ฒฉ ๊ตฌ์„ฑ ํŒŒ๋ผ๋ฏธํ„ฐ ์ •๋ณด๋ฅผ ์กฐํšŒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.


Authentication

SDK ํ‚ค๋ฅผ ํ†ตํ•ด ์ธ์ฆ์„ ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค. SDK ํ‚ค๋ฅผ HTTP ํ—ค๋”๋กœ ์ „์†กํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
API๋ฅผ ํ˜ธ์ถœํ•˜๋Š” ๊ณณ์—๋”ฐ๋ผ Browser, App, Server SDK ํ‚ค์ค‘ ํ•˜๋‚˜๋ฅผ ํ—ค๋”๋กœ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

X-HACKLE-API-KEY: {YOUR_SDK_KEY}


Request

POST https://api.hackle.io/v1/remote-config

Request Body

FieldTypeRequiredDescription
parameterKeystringO์›๊ฒฉ ๊ตฌ์„ฑ ํŒŒ๋ผ๋ฏธํ„ฐ
defaultValuestring, number, booleanO์›๊ฒฉ ๊ตฌ์„ฑ ๊ฐ’์„ ๊ฒฐ์ •ํ•  ์ˆ˜ ์—†์„ ๋•Œ ๋ฐ˜ํ™˜๋˜๋Š” ๊ฐ’
userUser objectO์›๊ฒฉ ๊ตฌ์„ฑ ๋ถ„๋ฐฐ ์‚ฌ์šฉ์ž

๐Ÿ“˜

defaultValue์˜ Type์€ ์›๊ฒฉ ๊ตฌ์„ฑ ์„ค์ •์˜ ํŒŒ๋ผ๋ฏธํ„ฐ ์œ ํ˜•๊ณผ ์ผ์น˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

defaultValue ์˜ Type ๊ณผ ํŒŒ๋ผ๋ฏธํ„ฐ ์œ ํ˜•์ด ์ผ์น˜ํ•˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ, defaultValue ์˜ ๊ฐ’์„ ์‘๋‹ต๋ฐ›์Šต๋‹ˆ๋‹ค. (๋ถ„๋ฐฐ์‚ฌ์œ : TYPE_MISMATCH)
ํŒŒ๋ผ๋ฏธํ„ฐ ์œ ํ˜•์ด JSON ์ธ ๊ฒฝ์šฐ defaultValue ๋Š” string Type ์œผ๋กœ ์ž…๋ ฅํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

User Object

FieldTypeRequiredDescription
userIdstringX์‚ฌ์šฉ์ž ID (ํ•ตํด ํ†ตํ•ฉ์‹๋ณ„์ž ์‚ฌ์šฉ ๊ฐ€๋Šฅ)
deviceIdstringX๋””๋ฐ”์ด์Šค ID (ํ•ตํด ํ†ตํ•ฉ ์‹๋ณ„์ž ์‚ฌ์šฉ๊ฐ€๋Šฅ)
identifiersobjectX์‚ฌ์šฉ์ž ์ •์˜ ์‹๋ณ„์ž
key(string)-value(string) Pair
propertiesobjectX์‚ฌ์šฉ์ž ์†์„ฑ
key(string)-value(string|number|boolean) Pair

Example

curl -i -X POST \
  'https://api.hackle.io/v1/remote-config' \
  -H 'X-HACKLE-API-KEY: YOUR_SDK_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "parameterKey": "parameter_key",
    "defaultValue": "default_value",
    "user": {
      "userId": "19285035",
      "deviceId": "ae2182e0",
      "identifiers": {
        "sessionId": "16930492542",
        "myCustomId": "ff01eae2"
      },
      "properties": {
        "grade": "GOLD",
        "age": 30,
        "isLogin": true
      }
    }
  }'

Response

200 OK

์„ฑ๊ณต์ ์ธ ์š”์ฒญ์ธ ๊ฒฝ์šฐ 200 ์‘๋‹ต๊ณผ ๋ถ„๋ฐฐ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.

Response Body

FieldTypeDescription
valuestring, number, boolean์›๊ฒฉ ๊ตฌ์„ฑ ํŒŒ๋ผ๋ฏธํ„ฐ ๊ฐ’
reasonstring๋ถ„๋ฐฐ์‚ฌ์œ 

Example

{
  "value": "paramter_value",
  "reason": "DEFAULT_RULE"
}

400 Bad Request

์œ ํšจํ•˜์ง€ ์•Š์€ ์š”์ฒญ ์ •๋ณด์ธ ๊ฒฝ์šฐ 400 ์ƒํƒœ๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.

401 Unauthorized

X-HACKLE-API-KEY ํ—ค๋”๊ฐ’์ด ์—†๊ฑฐ๋‚˜ ์œ ํšจํ•˜์ง€ ์•Š์€ SDK ํ‚ค์ธ ๊ฒฝ์šฐ 401 ์ƒํƒœ๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค