---
title: 'TelegraphResponse'
menuTitle: 'TelegraphResponse'
description: ''
category: 'Features'
fullscreen: false 
position: 34
---

all Telegraph requests return a `TelegraphResponse` that extends the original `Illuminate\Http\Client\Response` adding some useful methods:

## All `Illuminate\Http\Client\Response` methods

As `TelegraphResponse` extends `Illuminate\Http\Client\Response`, it inherits all its methods:

```php
$response = Telegraph::message('hello')->send();

$response->successful();
$response->ok();
$response->failed();
$response->body();
$response->json('path.to.json.data', 'default');

//.. and so on
```

## telegraphOk

Returns true if the Telegram request is successful and contains `['ok' => true]` in its body

```php
$response = Telegraph::message('hello')->send();

$response->telegraphOk(); //true
```

## telegraphError

Returns true if the Telegram request is not successful or is successful but doesn't contain `['ok' => true]` in its body

```php
$response = Telegraph::message('hello')->send();

$response->telegraphError(); //false
```

## telegraphMessageId

Returns the ID of the message posted on the Telegraph chat (`null` if the request failed or no message was posted)

```php
$response = Telegraph::message('hello')->send();

$response->telegraphMessageId(); //4568
```
