TTS API

Version 1.0.0 - Last updated 2020-09-29 09:03:05 KST

Authentication

API๋ฅผ ํ˜ธ์ถœํ•˜๋ ค๋ฉด ๊ถŒํ•œ์ด ์žˆ๋Š” ์•ก์„ธ์Šค ํ† ํฐ์„ ์–ป์–ด์•ผํ•ฉ๋‹ˆ๋‹ค. ๋‹ค์Œ curl ๋ช…๋ น์€ keycloak ์„œ๋ฒ„์—์„œ ํ† ํฐ์„ ํ™•๋ณดํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

To invoke the API you need to obtain an access token with the appropriate permissions. The following curl command shows how a token can be ontained from the keycloak server.

$ curl \
  -d "client_id=zeroth-web" \
  -d "username=<USERNAME>" \
  -d "password=<PASSWORD>" \
  -d "grant_type=password" \
  "http://keycloak:8080/auth/realms/zeroth/protocol/openid-connect/token"

๊ฒฐ๊ณผ๋Š” JSON ํ˜•์ž…๋‹ˆ๋‹ค. API๋ฅผ ํ˜ธ์ถœํ•˜๋ ค๋ฉด access_token ์†์„ฑ์˜ ๊ฐ’์„ ์ถ”์ถœํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋Ÿฐ ๋‹ค์Œ API ์š”์ฒญ์˜ Authorization ํ—ค๋”์— ๊ฐ’์„ ํฌํ•จํ•˜์—ฌ API๋ฅผ ํ˜ธ์ถœ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

The result will be a JSON document. To invoke the API you need to extract the value of the access_token property. You can then invoke the API by including the value in the Authorization header of requests to the API.

$ curl \
  -H "Authorization: bearer <ACCESS_TOKEN>" \
  "http://..."

Base_URL

On-Premise : Zeroth EE ์„ค์น˜๋ฒ„์ „์„ ์ด์šฉํ•˜๋Š” ๊ฒฝ์šฐ ๊ณ ๊ฐ์‚ฌ์˜ ์ ‘๊ทผ ์„ค์ •์— ๋”ฐ๋ผ ๋‹ค๋ฆ…๋‹ˆ๋‹ค.

Base URL์€ http://localhost:8080/ ์œผ๋กœ ํ‘œํ˜„ํ•ฉ๋‹ˆ๋‹ค.

Errors

๊ธฐ์กด HTTP ์‘๋‹ต ์ฝ”๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ API ์š”์ฒญ์˜ ์„ฑ๊ณต ๋˜๋Š” ์‹คํŒจ๋ฅผ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.

  • Codes in the 2xx range indicate success

  • Codes in the 4xx range indicate incorrect or incomplete parameters (e.g., a required parameter was omitted, an operation failed with a 3rd party, etc.)

  • Codes in the 5xx range indicate an error with Zeroth servers (these are rare)

Last updated

Was this helpful?