Skip to content

Authentication tokens

Ilya Krukowski edited this page Apr 10, 2022 · 2 revisions

Use this endpoint to generate a JWT token. Please note that:

  1. This token is required only if you are going to create, update, or delete resources via the API. JWT token is not needed to read data.
  2. You must have an account at rating.chgk.info to generate a JWT token.

Generating JWT token

Provide your email and password:

response = client.authentication_token email: 'CHGK_EMAIL', password: 'CHGK_PASSWORD'

Now you can fetch your token:

token = response.token

Using the token

Use the newly generated token when initializing the client:

client = RatingChgkV2.client token: response.token

Now perform the API requests as usual:

custom_client.create_country name: 'Название страны'
Clone this wiki locally