Telegram Mini App toolkit monorepo
399
REST and GraphQL server for validating data received via the Telegram Mini App.
We use this docker image:
ducker run bigslycat/tg-app-validate-service \
-p 80:80 \
-e BOT_TOKEN='...'
You can send GraphQL requests to path /graphql and use GraphiQL playground on
server root.
type Query {
webAppInitData(initData: String!): WebAppInitData!
}
type WebAppInitData {
queryId: String
user: WebAppUser
receiver: WebAppUser
chat: WebAppUser
chatType: ChatType
chatInstance: String
startParam: String
canSendAfter: Int
authDate: Int!
hash: String!
}
type WebAppUser {
id: Int!
isBot: Boolean
firstName: String!
lastName: String
username: String
languageCode: String
isPremium: Boolean
addedToAttachmentMenu: Boolean
allowsWriteToPm: Boolean
photoUrl: String
}
enum ChatType {
SENDER
PRIVATE
GROUP
SUPER_GROUP
CHANNEL
}
schema {
query: Query
}
You can send GET request to path /parse with initData in query string as is
and receive WebAppUser JSON object in response:
GET /parse?<initData>
You can use OpenAPI in 3 ways:
Swagger-UI. Just set SWAGGER_UI env variable:
ducker run bigslycat/tg-app-validate-service \
-p 80:80 \
-e BOT_TOKEN='...'
-e SWAGGER_UI=true
And you can get the documentation this path: /swagger-ui.
RapiDoc. Set RAPIDOC env variable:
ducker run bigslycat/tg-app-validate-service \
-p 80:80 \
-e BOT_TOKEN='...'
-e RAPIDOC=true
And you can get the documentation this path: /rapidoc.
Redocly. Set REDOC env variable:
ducker run bigslycat/tg-app-validate-service \
-p 80:80 \
-e BOT_TOKEN='...'
-e REDOC=true
And you can get the documentation this path: /redoc.
Content type
Image
Digest
sha256:6951b0a58…
Size
11.7 MB
Last updated
over 2 years ago
docker pull bigslycat/tg-app-validate-service