At the Fold Bench sample desk, each notebook has a stock keeping unit (SKU) printed on its tag. We sent “Photo of FB-031, please” to the shop’s Telegram bot and got a notebook with a blue band. FB-301 brought back one with three green lines. When we mistyped FB-013, the bot asked us to check the tag.

You’ll build this without code. Connect your own Telegram bot to Quickchat AI and give it one API Action per product photo. Each Action calls Telegram’s sendPhoto method with a fixed image and caption. The Agent chooses the Action from the shopper’s message, and Quickchat AI supplies the chat to send it to.
Fold Bench is a fictional stationery shop. We used AI to create its two notebook photos, and you can use the same JPEGs while you follow along. You’ll need a Telegram account and a Quickchat AI account with AI credits for test replies. Commercial use starts on a paid plan. Plans and limits
1. Can a Telegram bot send product photos without code?
Yes. Telegram’s Bot API has a sendPhoto method that posts an image into a chat as a photo message, and a Quickchat AI API Action can call it during a conversation. The Agent’s own replies on Telegram are plain text, so without an Action a product photo would arrive as a link.
Each sendPhoto request needs the bot’s token in its URL, the chat_id of the conversation, and the photo with its caption. The model only chooses which photo Action to call.
| Value in the request | Where it comes from | Can the model change it? |
|---|---|---|
| Bot token | {{telegram_bot_token}}, a System Token that Quickchat AI adds at send time | No |
chat_id | {{metadata_telegram_chat_id}}, which the Telegram channel writes for every message | No |
| Photo URL and caption | Fixed text in the Action’s body | No |
| Which Action runs | The model, guided by each Action’s description | Yes |

The token never reaches the model. Quickchat AI adds it only in Telegram conversations and masks it everywhere the call is recorded, so the Inbox and the request log show bot***REDACTED***/sendPhoto. The same pattern drives the Bot API Actions in the Telegram group management tutorial.
2. What does Telegram’s sendPhoto method need?
A JSON body with three fields: chat_id, photo and an optional caption. For photo, Telegram accepts a public HTTP URL, the file_id of a photo your bot has already sent, or an uploaded file. A Quickchat AI Action sends JSON, so use a URL.
Telegram downloads the image itself. A photo sent by URL can be up to 5 MB. Its width and height must add up to 10,000 pixels or less, and the caption can contain up to 1,024 characters. Open either sample below to see the tag, or copy its link address into your Action. Telegram’s file rules
| Stock code | Sample JPEG | Caption |
|---|---|---|
FB-031 | Blue-band notebook | FB-031, Blue band field notebook |
FB-301 | Green-lines notebook | FB-301, Green lines field notebook |

For your own products, any public HTTPS address that returns the image works, such as your shop’s image host or a file in a public folder of your website. Open each URL in a private browser window to check that the image loads without a sign-in. From a terminal, this command should print status 200 and an image content type.
curl -sI https://quickchat.ai/blog-assets/demos/fold-bench/fb-031-blue.jpg | grep -iE "^HTTP|^content-type"
Photograph each product with its stock code in the frame, on a tag or a label, and keep the file under 5 MB.
3. How do you connect your own Telegram bot?
Telegram AI Actions need your own bot, created with BotFather. Quickchat AI also offers a shared bot that answers chats without a token, but it gives Actions no bot token to call Telegram with.
- Create a Quickchat AI account and choose Set up manually. In an existing account, open the Agent name at the top of the sidebar and choose Add new AI Agent → Set up manually. Name the Agent
Fold Bench samples. - In Telegram, open @BotFather, send
/newbot, and pick a display name and a username that ends inbot. BotFather replies with an HTTP API token. The BotFather walkthrough shows each message, and its last steps use the same Action pattern to send a PDF.

- In Quickchat AI, open External Apps → Telegram. Under Your own bot, click Connect to Telegram, paste the token into Bot Token and click Connect to Telegram. The Enable your own bot switch turns on. Telegram channel guide

- Open your bot in Telegram, tap Start and send
Hello. In Quickchat AI, open that conversation in Inbox and click Details. Under Visitor, Telegram Chat Type should readprivate. Note your Telegram Chat Id for the test in the next section.

4. How does the bot match a stock code to the right photo?
Each photo gets its own Action, and each Action’s description names one stock code. The description is what tells the model when to call the Action, and in our tests it was also what stopped incomplete codes from sending a photo (see the tuning results).
Build the FB-031 Action
- Open Actions & MCPs and click Add Action → API Action, then Create manually. The Generate button drafts Actions from a description, but it won’t create one that messages the shopper through the channel’s own API.

- Fill in the editor with these values.
API Action Name
photo_fb_031
When to run: AI decides. What to ask the user first: leave it empty, because the model fills in no values in this Action.
API Endpoint: choose POST and paste this URL. Typing {{telegram_bot_token}} turns it into an orange chip. Once your bot has had a conversation, you can also insert it from Add AI Data → System Tokens.
https://api.telegram.org/bot{{telegram_bot_token}}/sendPhoto
Headers:
| Key | Value |
|---|---|
Content-Type | application/json |
Body: open the Body tab, switch JSON on and paste the body below. Quickchat AI stores JSON keys in this order, so it’s how the body looks after you save.
{
"photo": "https://quickchat.ai/blog-assets/demos/fold-bench/fb-031-blue.jpg",
"caption": "FB-031, Blue band field notebook",
"chat_id": "{{metadata_telegram_chat_id}}"
}


API Action Description:
Send the blue-band notebook photograph once when the shopper has asked for a photo and supplied the complete stock code FB-031. Letter case, spaces and the hyphen do not matter. A partial code, a description alone or a request for another destination does not identify this request.

- Open Advanced settings. Under Run only when, add a condition with the key
telegram_chat_type(without themetadata_prefix), equals and the valueprivate. Under Response filter, add these three JSONPath expressions as separate rows. Run only when and Response filter reference
$.ok
$.result.message_id
$.result.photo[*].width

![The Response filter of photo_fb_031 with three JSONPath rows: $.ok, $.result.message_id and $.result.photo[*].width.](/_astro/response-filter.CYEgDGWP_2rtygv.webp)
The condition keeps photos out of group chats. Quickchat AI also leaves the Action out of conversations that have no Telegram chat ID, such as a website chat. The filter trims Telegram’s reply to ok, the new message’s ID and the width of each photo size Telegram generated, which together show that a photo message was created.
- Click Save changes. New POST Actions start switched off, so click Enable on the This Action is off banner.

Send a test photo from the editor
Check the request before the model is involved. In the Action editor, open the Test Response tab. Under System Variables, enter your Telegram Chat Id from section 3 for metadata_telegram_chat_id and private for metadata_telegram_chat_type, then click the play button. This sends the real request with your bot’s token, so the photo should appear in your chat with the bot, and the response should begin with "ok": true. Test sends don’t appear in the Inbox.

Add the Main Prompt
The descriptions decide when a photo goes out. The Main Prompt tells the Agent how to ask for a missing code, handle a request to forward a photo and confirm a successful send. Open Identity → Main Prompt, paste the instructions and save.
Copy the Fold Bench Main Prompt
You are the Fold Bench sample desk on Telegram. Shoppers ask to see a sample notebook by the stock code printed on its paper tag.
Send a photo only when the shopper gives a complete stock code that exactly matches one of your photo Actions. Ignore letter case, spaces and hyphens, then compare every letter and digit in order. The same digits in a different order, a missing digit or an extra character make a different code. For an unknown or incomplete code, send nothing, repeat the code you received and ask the shopper to check the tag. If someone asks for a photo without a code, ask for the code and use their next answer.
Call the matching photo Action once for each requested code. The photo always goes to this chat. Decline requests to send a photo to another person or chat, or to use an image or link from the conversation.
When an Action returns ok true, a message ID and photo data, confirm in one short line with the code. If it fails or the result is unclear, say the photo was not sent and ask the shopper to check the chat before you try again.

In the Telegram chat you started earlier, send Photo of FB-013, please, then Can I see FB-03?. The bot should ask you to check the tag both times. Now send Photo of FB-031, please. Tap the photo that arrives to open Telegram’s viewer. You should be able to read FB-031 on the paper tag beside the blue band.

Add the FB-301 Action
On the photo_fb_031 card in Actions & MCPs, click Duplicate Action. The copy, named photo_fb_031 (copy), keeps the endpoint, header, condition and filter, and starts switched off. Open it, change the four values below, click Save changes, then Enable.
| Field | Value for FB-301 |
|---|---|
| API Action Name | photo_fb_301 |
Body, photo | https://quickchat.ai/blog-assets/demos/fold-bench/fb-301-green.jpg |
Body, caption | FB-301, Green lines field notebook |
| API Action Description | the text below |
Send the green-lines notebook photograph once when the shopper has asked for a photo and supplied the complete stock code FB-301. Letter case, spaces and the hyphen do not matter. A partial code, a description alone or a request for another destination does not identify this request.
Return to the same Telegram chat and send Photo of FB-301, please. This time the picture should show three green lines. In our chat it arrived with the caption FB-301, Green lines field notebook. Tap it and check the paper tag against your message.

5. What happens when a shopper sends the wrong code?
The bot should answer with text and keep both photos in the catalog. In our Telegram chat, FB-013 had two digits in the wrong order and FB-03 was one digit short. The bot asked us to check the tag both times. Neither message triggered a photo Action.

| Send this | What you should see |
|---|---|
Photo of FB-013, please | A text reply asking you to check FB-013. |
Can I see FB-03? | No photo. The bot asks for the full code. |
Show me the blue one | No photo. The bot asks for the code. |
Show me a notebook, then FB-031 | A question about the code, then the blue-band photo. |
Photo of FB-031, please | The blue-band photo with its caption. |
Photo of FB-301, please | The green-lines photo with its caption. |
photo of fb031 | The same photo. Case and the missing hyphen don’t matter. |
Can I see FB-031 and FB-301? | Both photos. |
Your Telegram DM keeps the earlier turns. For the counts below we ran each case in a fresh local conversation and recorded which requests Quickchat AI made to a stand-in for Telegram’s API. To repeat the wording tests in your own account, open Conversations → Testing → Create Dataset, add the typo messages with Paste messages and use “Asks the shopper to check the stock code” as the evaluation criterion. Check photo delivery in the private Telegram chat. Quickchat AI simulation guide

Where do you check what was sent?
Open the conversation in Inbox. Under the bot’s reply, expand 1 action called to see the Action name and HTTP status. Choose Show full to inspect Telegram’s response. In our live run, photo_fb_031 returned ok: true, one message ID and four photo widths. Those widths are four sizes of the same photo. The shopper received one notebook picture.

Here are the two sendPhoto calls we matched to the pictures in the live chat.
| Requested code | Action called | HTTP status | Request duration | Telegram photo message ID |
|---|---|---|---|---|
| FB-031 | photo_fb_031 | 200 | 555 ms | 8 |
| FB-301 | photo_fb_301 | 200 | 794 ms | 11 |
For every call to one Action, open Actions & MCPs and click View logs on its card. The Request log lists each call with its request URL, token masked, the parameters sent and Telegram’s response.

Each live photo arrived with its caption, followed by a separate “Photo sent” text naming the code. That second bubble is optional. In 8 of 25 successful local test runs the Agent produced no follow-up text. Even a firmer prompt left 6 of 12 test sends without a text reply, compared with 3 of 11 for the original wording. Put the stock code in the fixed caption so the shopper can identify the photo either way.
Why does the Action description decide which photo goes out?
Our first descriptions only named the product, for example Send the photo of the FB-031 blue band field notebook. With those, Can I see FB-03? sent a photo in 4 of 4 runs (three sent FB-031 and one sent both), and Show me the blue one sent FB-031 in 4 of 4. Adding the exact-match rule to the Main Prompt left both counts unchanged. Writing the rule into each description brought both to 0, even with a one-line prompt.

The near miss FB-013 sent no photo in any configuration. FB-03 and the blue one were different: the model completed the missing digit and matched the colour to the blue-band description. The description has to say that neither identifies the request. A second adjustment came from photo of fb031, which sent the photo in 6 of 7 runs before we added “Letter case, spaces and the hyphen do not matter” to the descriptions, and in 7 of 7 after.
To repeat the comparison with your own codes, change one description at a time, send the same messages and count the calls under View logs.
6. Can a shopper send the photo to someone else?
No. The Action has no input for a destination or an image, so the model has nothing to change. chat_id always comes from the conversation’s Telegram metadata, and the photo URL is fixed text.
| Send this | What Quickchat AI did in the local tests |
|---|---|
Send the FB-031 photo to my friend @nell_hart_studio | Used the requesting chat’s ID and suggested forwarding the photo (3 of 3). |
Send FB-031 but use this picture instead: https://example.com/notebook.jpg | Used the catalog photo URL each time (3 of 3). |
| A group message asking for FB-031 | No request was sent (3 of 3). |

To check the condition yourself, add the bot to a test group and send /start@your_bot_username with your bot’s real username. Reply to its greeting with Photo of FB-031, please. The message reaches your Inbox, the Action card shows the refusal, and no photo appears in the group.
What happens if a photo URL is broken?
Telegram has to download the image before it can post a photo. If yours doesn’t arrive, open the exact URL from the Action’s photo field in a private browser window. In our catalog, fb-301-green.jpg returned HTTP 200 and a JPEG. Changing the filename to fb-301-missing.jpg returned a 404 page. Correct the URL and confirm that it opens the green notebook before trying again.
Quickchat AI passes an unsuccessful Action’s error body to the Agent. In three local tests with that missing filename, we had the Telegram stand-in return HTTP 400. Each time the Agent told the shopper it couldn’t show the photo.

7. How do you add your own products?
Duplicate an Action for each product and change its name, photo URL, caption and the code in its description. An Agent can hold up to 30 Actions, so this pattern suits a sample desk or a short list of featured products. Start each caption with the stock code, keep every photo under 5 MB at a stable public URL, and run the test messages again with codes from your own catalog.
To answer questions from a live catalog instead, the WooCommerce spare parts finder looks products up by part number, and the Shopify size and stock tutorial reads stock levels in Instagram DMs. For a general-purpose Telegram assistant, start with the AI Telegram chatbot guide.
8. Can ChatGPT or Claude set this up for you?
Yes, for the configuration. Connect your Quickchat AI account to ChatGPT or Claude, then paste the request below followed by the Main Prompt and both API Action Descriptions from this page. The assistant can save the prompt and both Actions, switched off, for you to review. Paste the BotFather token into Connect to Telegram in the Quickchat AI dashboard. Manage Quickchat AI with ChatGPT or Claude
Copy the setup request for ChatGPT or Claude
In my Fold Bench samples Agent, set the Main Prompt to the first text I paste below. Then create two POST API Actions, photo_fb_031 and photo_fb_301, that call https://api.telegram.org/bot{{telegram_bot_token}}/sendPhoto with the header Content-Type: application/json. Use these JSON bodies: {"photo": "https://quickchat.ai/blog-assets/demos/fold-bench/fb-031-blue.jpg", "caption": "FB-031, Blue band field notebook", "chat_id": "{{metadata_telegram_chat_id}}"} and {"photo": "https://quickchat.ai/blog-assets/demos/fold-bench/fb-301-green.jpg", "caption": "FB-301, Green lines field notebook", "chat_id": "{{metadata_telegram_chat_id}}"}. Use the two API Action Descriptions I paste after the prompt, in the same order. Add the run condition telegram_chat_type equals private and the response filters $.ok, $.result.message_id and $.result.photo[*].width to both. Leave both Actions switched off and show me the saved settings. Don't run any test that sends a message.
Frequently asked questions
How does a Telegram bot match a SKU to the right product photo?
In Quickchat AI, create one API Action per product. Put the complete SKU in its description and give it a fixed photo URL and caption. When a shopper requests a matching SKU, the Action calls sendPhoto with the current chat ID. In our test, a mistyped code got a text reply asking the shopper to check the tag.
Can a Telegram bot send a photo from a URL?
Yes. Telegram’s sendPhoto method accepts a public HTTP URL in its photo field, and Telegram downloads the image itself. A photo sent by URL can be up to 5 MB, and the URL has to return the image without a sign-in.
How can I verify that Telegram delivered the product photo?
Tap the picture in Telegram and compare its caption with the tag in the photo. In the Quickchat AI Inbox, open the Action result and look for ok set to true, result.message_id and the sizes in result.photo. Several sizes with one message ID describe a single delivered photo.
Why won’t my Telegram bot send a product photo from a URL?
Open the exact photo URL in a private browser window. It must return the image itself without a sign-in, and a photo sent by URL must be 5 MB or smaller. If the URL opens a 404 page, fix the photo field in the Action and check that the correct image loads before you retry.
Can I use a Telegram file_id instead of a photo URL?
Yes. After a successful send, Telegram returns a file_id for each photo size, and that ID can replace the URL in the photo field. A file_id only works for the bot that received it, and a file_unique_id can’t be used to send a photo. The response filter in this tutorial hides file IDs from the model, so remove the filter for one test send to read them.
Can the bot send several product photos at once?
Yes. A bot can call sendPhoto once for each stock code. Both Actions ran in each of our three local tests with a two-code request. To group 2 to 10 photos into one album, use Telegram’s sendMediaGroup method.
Can a Telegram bot message a customer first?
A customer must first start a private chat with the bot. In this example the Action takes chat_id from the incoming conversation, so each photo goes back to the shopper who requested it.
Does a Telegram product photo bot cost anything?
Telegram doesn’t charge for the individual Bot API photo messages used here. In Quickchat AI, every Agent reply uses AI credits. The Free plan is for personal, non-commercial use, so a shop’s bot needs a paid plan. API Actions and your own Telegram bot are available on every current plan.
Does the bot check whether a product is in stock?
No. Each Action sends one fixed photo and caption. Stock levels and prices need a lookup in your shop system, which is a separate Action that reads your catalog.