Use this method to send photos.

Log in to see full request history
timestatususer agent
Retrieving recent requests…
LoadingLoading…

Use this method to send photos. On success, the sent Message is returned.

See sendPhoto official docs for a list of supported parameters and other info.

Sending Photo Using Image URL

The ability to send an image directly from a URL is also supported in the library. Instead of supplying a local path and filename, you may just pass the image URL and it'll take care of downloading and sending it to the Telegram directly.

Example

use Telegram\Bot\Api; $telegram = new Api('BOT TOKEN'); $response = $telegram->sendPhoto([ 'chat_id' => 'CHAT_ID', 'photo' => 'http://example.com/photos/image.jpg', 'caption' => 'Some caption' ]); $messageId = $response->getMessageId();
$response = Telegram::sendPhoto([ 'chat_id' => 'CHAT_ID', 'photo' => 'http://example.com/photos/image.jpg', 'caption' => 'Some caption' ]); $messageId = $response->getMessageId();

🚧

Sending Photo using a File or URL!

The API Explorer below doesn't support file upload or URL based photo sending. You can only use it to test using an existing file_id, if you have one.

This is a limitation of this API Explorer, Not the SDK.

Path Params
string
required

Your Bot Token

Body Params
string

Unique identifier for the target chat or username of the target channel (in the format @channelusername)

string
Defaults to Required

Photo to send. You can either pass a file_id as String to resend a photo that is already on the Telegram servers, or upload a new photo by just passing the path to the file as String and the SDK will take care of uploading the file for you. You can also directly pass Image URL as String to automatically download and send it to Telegram.

string
Defaults to Optional

Photo caption (may also be used when resending photos by file_id), 0-200 characters

boolean
Defaults to false

Sends the message (silently)[https://telegram.org/blog/channels-2-0#silent-messages]. iOS users will not receive a notification, Android users will receive a notification with no sound. Other apps coming soon.

int32
Defaults to null

If the message is a reply, ID of the original message

Responses

Language
Request
Click Try It! to start a request and see the response here! Or choose an example:
application/json