Getting information about a CAPTCHA
- In the management console
, select the folder containing the CAPTCHA. - Select SmartCaptcha.
- Select a CAPTCHA. The Overview page will display detailed information about the CAPTCHA.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
-
See the description of the CLI command to view information about a CAPTCHA:
yc smartcaptcha captcha get --help -
Get a list of captchas:
yc smartcaptcha captcha listResult:
+----------------------+---------+---------------------+------------+----------------+----------------+-------------+ | ID | NAME | CREATED | COMPLEXITY | PRE-CHECK TYPE | CHALLENGE TYPE | RULES COUNT | +----------------------+---------+---------------------+------------+----------------+----------------+-------------+ | bpne29ifsca8******** | test | 2025-02-24 17:16:13 | MEDIUM | CHECKBOX | IMAGE_TEXT | 0 | | bpnm7lhokq2t******** | prod | 2025-02-26 09:12:02 | MEDIUM | CHECKBOX | IMAGE_TEXT | 0 | | bpn43btuo4g9******** | website | 2025-02-26 09:12:42 | MEDIUM | CHECKBOX | IMAGE_TEXT | 0 | +----------------------+---------+---------------------+------------+----------------+----------------+-------------+ -
Get detailed information about a CAPTCHA by specifying its name or ID:
yc smartcaptcha captcha get <captcha_ID>Result:
id: bpne29ifsca8******** folder_id: b1geoelk7fld******** cloud_id: b1gia87mbaom******** client_key: ysc1_MtyvvAUieCSUfHb6tugqFAbTyesgGzXWU50sZq0E******** created_at: "2025-02-24T17:16:13.034742Z" name: test allowed_sites: - example.com complexity: MEDIUM pre_check_type: CHECKBOX challenge_type: IMAGE_TEXT
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the relevant documentation on the Terraform
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
To get information about a CAPTCHA using Terraform:
-
Add the
dataandoutputsections to the Terraform configuration file:data "yandex_smartcaptcha_captcha" "my-captcha" { captcha_id = "<captcha_ID>" } output "my-client-key" { value = data.yandex_smartcaptcha_captcha.my-captcha.client_key }Where:
data "yandex_smartcaptcha_captcha": Description of the CAPTCHA as a data source:resource_id: Resource ID.
output "ref_description": Output variable with information about the client key (client_key):value: Returned value.
You can replace
client_keywith any other parameter to get the information you need. For more information about theyandex_smartcaptcha_captchadata source parameters, see the relevant provider documentation. -
Create the resources:
-
In the terminal, go to the directory where you edited the configuration file.
-
Make sure the configuration file is correct using this command:
terraform validateIf the configuration is correct, you will get this message:
Success! The configuration is valid. -
Run this command:
terraform planYou will see a detailed list of resources. No changes will be made at this step. If the configuration contains any errors, Terraform will show them.
-
Apply the changes:
terraform apply -
Type
yesand press Enter to confirm the changes.
Terraform will create all the required resources and display the output variable values in the terminal. To check the results, run this command:
terraform outputResult:
my-client-key = ysc1_MtyvvAUieCSUfHb6tugqFAbTyesgGzXWU50sZq0E******** ... -
To get detailed information about a CAPTCHA, use the get REST API method for the Captcha resource or the CaptchaService/Get gRPC API call.