setPassportDataErrorsЧастично
Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.
Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.
Поддерживается частично
validated and stored; the server has no Telegram Passport forms to surface them
Параметры
User identifier
A JSON-serialized Array describing the errors
Пример запроса
curl
curl "https://api.staticgram.top/bot$TOKEN/setPassportDataErrors" \
-H "Content-Type: application/json" \
-d '{
"user_id": 123456789,
"errors": []
}'aiogram 3
from aiogram import Bot
from aiogram.client.session.aiohttp import AiohttpSession
from aiogram.client.telegram import TelegramAPIServer
session = AiohttpSession(api=TelegramAPIServer.from_base("https://api.staticgram.top"))
bot = Bot(TOKEN, session=session)
result = await bot.set_passport_data_errors(user_id=123456789, errors=[])JavaScript
const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/setPassportDataErrors`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"user_id": 123456789,
"errors": []
}),
});
const data = await res.json();Ответ (True)
JSON
{
"ok": true,
"result": true
}