API ๊ณตํต ๊ฒฐ๊ณผ ์ฝ๋ (RstVal)
GIIP ๊ฐ์ด๋ ์์คํ
์ API ๊ณตํต ์๋ต ๊ฐ์ธ RstVal๊ณผ RstMsg์ ๋ํ ํ์ค ์ ์๋ฅผ ์๋ดํฉ๋๋ค.
๐ ๊ฐ์
๋ชจ๋ GIIP API๋ ์คํ ๊ฒฐ๊ณผ๋ฅผ ์ถ์ ํ๊ธฐ ์ํด RstVal(์ ์ํ ์ฝ๋)๊ณผ RstMsg(์ค๋ช
๋ฉ์์ง)๋ฅผ ์๋ต ๋ฐ์ดํฐ์ ์ต์์ ๊ณ์ธต์ ํฌํจํฉ๋๋ค. ์ด ๊ฐ๋ค์ ๋ฐ์ดํฐ๋ฒ ์ด์ค์ tDefRst(Result Definition) ํ
์ด๋ธ์ ์ ์๋ ํ์ค์ ๋ฐ๋ฆ
๋๋ค.
์ฌ์ฉ์๊ป์ ์ธ๊ธํ์ tRstVal์ ์ค์ ์์คํ ์ tDefRst ํ ์ด๋ธ ๋ด drRstVal ์ปฌ๋ผ์ ์๋ฏธํ๋ฉฐ, API ๊ฐ๋ฐ ๋ฐ ์ฐ๋ ์ ์๋ ์ ์๋ ์ฝ๋๋ฅผ ์ฐธ์กฐํ์ฌ ์์ธ ์ฒ๋ฆฌ๋ฅผ ์ํํ ์ ์์ต๋๋ค.
๐ก ์ฃผ์ ๊ฒฐ๊ณผ ์ฝ๋ (Major Codes)
| RstVal | RstMsg | ์๋ฏธ | ๋น๊ณ |
|---|---|---|---|
| 200 | Process has done successfully | ์ฑ๊ณต | ํ์ค ์ฑ๊ณต ์๋ต |
| 400 | No data found | ์๋ชป๋ ์์ฒญ | ํ์ ํ๋ผ๋ฏธํฐ ๋๋ฝ ๋๋ ๋น ๋ฐ์ดํฐ |
| 401 | Unauthorized | ์ธ์ฆ ์คํจ | Access Key/Secret Key ์ค๋ฅ ๋๋ ์ธ์ ๋ง๋ฃ |
| 403 | Forbidden | ๊ถํ ์์ | ์์ฒญํ ๋ฆฌ์์ค์ ๋ํ ์ ๊ทผ ๊ถํ ๋ถ์กฑ |
| 404 | No data found | ์ฐพ์ ์ ์์ | ์์ฒญํ ๋ฆฌ์์ค๊ฐ ์กด์ฌํ์ง ์์ |
| 500 | System error | ์์คํ ์ค๋ฅ | ์๋ฒ ๋ด๋ถ ๋ก์ง ๋๋ DB ์๋ฌ |
๐ ์์ธ ๊ฒฐ๊ณผ ์ฝ๋ ๋ชฉ๋ก (tDefRst)
์์คํ ๋ด๋ถ์ ์ผ๋ก ์ฌ์ฉ๋๋ ์์ธ ๊ฒฐ๊ณผ ์ฝ๋ ๋ชฉ๋ก์ ๋๋ค. ํน์ ๋๋ฉ์ธ(ํฌ์ธํธ, ์ฌ์ฉ์ ๊ฐ์ , ์ธ๋ถ ์ฐ๋ ๋ฑ)์ ํนํ๋ ๋ฉ์์ง๊ฐ ํฌํจ๋์ด ์์ต๋๋ค.
| drRstVal | drRstMsg | ์นดํ ๊ณ ๋ฆฌ |
|---|---|---|
| 100 | Starting Stored Procedure... | ์์คํ |
| 102 | Data is not match | ์ ํจ์ฑ |
| 201 | Created successfully | ์์ฑ |
| 204 | No content available | ๋ฐ์ดํฐ |
| 211 | It is clean email. go next... | ํ์๊ฐ์ |
| 212 | Already registered user. | ํ์๊ฐ์ |
| 220 | Charge process has done successfully | ๊ฒฐ์ /ํฌ์ธํธ |
| 221 | Point process has done successfully | ํฌ์ธํธ |
| 230 | Buying process has done successfully | ๊ตฌ๋งค |
| 250 | Prayed successfully | ๊ธฐํ |
| 300 | Permission error | ๊ถํ |
| 301 | Not enough point | ํฌ์ธํธ |
| 302 | Already data exists. | ์ค๋ณต |
| 312 | Pre-registered but not have User data. | ๊ฐ์ ์ํ |
| 313 | Input status is lower than dbStatus. | ๋ฐ์ดํฐ ๋ฌด๊ฒฐ์ฑ |
| 320 | It cannot be processed point processing | ํฌ์ธํธ |
| 330 | You have NFT Token already. | NFT/Asset |
| 332 | Already sold out. | ๊ตฌ๋งค |
| 333 | Event item limit reached. | ์ด๋ฒคํธ |
| 390 | Already registered this wallet. | ์ง๊ฐ/์ธ์ฆ |
| 405 | Method not allowed | ์๋ฒ/HTTP |
| 409 | Conflict: Resource already exists | ์ํ ์ถฉ๋ |
| 410 | Gone: Resource no longer available | ๋ง๋ฃ/์ญ์ |
| 420 | You don't have enough point | ํฌ์ธํธ |
| 421 | Not same point and point history. | ๋ฐ์ดํฐ ์ ํฉ์ฑ |
| 502 | Bad Gateway: Upstream error | ๋คํธ์ํฌ |
๐ก ๊ฐ๋ฐ์ ํ
- ์ฑ๊ณต ํ๋ณ:
RstVal์ด200์ธ ๊ฒฝ์ฐ์๋ง ๋น์ฆ๋์ค ๋ก์ง์ ๊ณ์ ์งํํ๋ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค. - ์๋ฌ ํธ๋ค๋ง:
400๋ ์ฝ๋๋ ํด๋ผ์ด์ธํธ์ ์์ฒญ ์์ ์ด ํ์ํจ์,500๋ ์ฝ๋๋ ์์คํ ๊ด๋ฆฌ์์ ํ์ธ์ด ํ์ํจ์ ์๋ฏธํฉ๋๋ค. - ๋ฉ์์ง ํ์ฉ:
RstMsg๋ ์ฌ์ฉ์์๊ฒ ์ง์ ๋ ธ์ถํ๊ธฐ๋ณด๋ค๋ ๊ฐ๋ฐ์ ๋๋ฒ๊น ์ฉ์ผ๋ก ํ์ฉํ๊ณ , ์ฌ์ฉ์์๊ฒ๋ ๋ก์บ(Locale)์ ๋ง๋ ๋ณ๋์ ๋ฉ์์ง ์ฒ๋ฆฌ๋ฅผ ๊ถ์ฅํฉ๋๋ค.
๋ฌธ์ ํด๊ฒฐ
| ์ฆ์ | ์์ธ | ํด๊ฒฐ |
|---|---|---|
API ์๋ต์ RstVal์ด 401๋ก ๋ฐํ๋จ | Access Key/Secret Key ์ค๋ฅ ๋๋ ์ธ์ ๋ง๋ฃ | ์ธ์ฆ ํค๋ฅผ ์ฌํ์ธํ๊ณ ์ธ์ ์ ๊ฐฑ์ ํ ๋ค ์์ฒญ์ ๋ค์ ๋ณด๋ ๋๋ค. |
RstVal์ด 400 ๋๋ 404์ด๊ณ ๋ฐ์ดํฐ๊ฐ ๋น์ด ์์ | ํ์ ํ๋ผ๋ฏธํฐ ๋๋ฝ ๋๋ ์กฐํ ๋์ ๋ฆฌ์์ค ๋ถ์ฌ | ์์ฒญ ํ๋ผ๋ฏธํฐ๋ฅผ ์ ๊ฒํ๊ณ , ์กด์ฌํ๋ ๋ฆฌ์์ค ์๋ณ์๋ก ์ฌ์์ฒญํฉ๋๋ค. |
RstVal์ด 301/420์ผ๋ก ์ฒ๋ฆฌ๊ฐ ์ค๋จ๋จ | ํฌ์ธํธ ๋ถ์กฑ ๋ฑ ๋น์ฆ๋์ค ์กฐ๊ฑด ๋ฏธ์ถฉ์กฑ | RstMsg(์: Not enough point)๋ฅผ ํ์ธํ๊ณ ์ ํ ์กฐ๊ฑด์ ์ถฉ์กฑํ ๋ค ์ฌ์๋ํฉ๋๋ค. |
RstVal์ด 500/502๋ก ๋ฐํ๋จ | ์๋ฒ ๋ด๋ถ ๋ก์งยทDB ์ค๋ฅ ๋๋ ์ ์คํธ๋ฆผ ๊ฒ์ดํธ์จ์ด ์ค๋ฅ | ํด๋ผ์ด์ธํธ์์ ์ฌ์๋ํ์ง ๋ง๊ณ RstMsg์ ํจ๊ป ์์คํ
๊ด๋ฆฌ์์๊ฒ ๋ฌธ์ํฉ๋๋ค. |
๊ด๋ จ ๋ฌธ์: