---
source_url: https://www.pubnub.com/docs/chat/unreal-chat-sdk/build/features/channels/details
title: Get channel details
updated_at: 2026-05-22T11:04:41.895Z
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Get channel details

Fetch a specific [channel's](https://www.pubnub.com/docs/chat/unreal-chat-sdk/learn/chat-entities/channel) metadata with `GetChannel()`.

:::note Requires App Context
Enable [App Context](https://youtu.be/9UEoSlngpYI) for your keyset in the [Admin Portal](https://admin.pubnub.com/).
:::

##### Usage in Blueprints and C++

You can use PubNub's functionality via Blueprints or directly in C++ code.

* In Blueprints, you can access PubNub from any Widget or Actor. Start by [initializing chat](https://www.pubnub.com/docs/chat/unreal-chat-sdk/build/configuration#initialize-pubnub-chat) using `InitChat` on `UPubnubChatSubsystem`. Afterwards, you can use the returned `UPubnubChat` object reference to call all Chat SDK functions.

:::warning Blueprint functions
The Blueprints provided in the documentation show how you can structure your application and may contain utility methods and elements like buttons that are not part of the Unreal Chat SDK and are meant to serve as guidance.
:::

* In C++, you can use UPubnubChatSubsystem as any other Game Instance Subsystem. #include "Kismet/GameplayStatics.h" #include "Engine/GameInstance.h" #include "PubnubChatSubsystem.h" // ACTION REQUIRED: Replace ASample_ChatSubsystem with name of your Actor class void ASample_ChatSubsystem::InitChatSample() { // Get PubnubChatSubsystem from GameInstance UGameInstance* GameInstance = UGameplayStatics::GetGameInstance(this); UPubnubChatSubsystem* PubnubChatSubsystem = GameInstance->GetSubsystem<UPubnubChatSubsystem>(); // Initialize Chat - InitChat may fail under some conditions so make sure to check the Result for errors before using the Chat FPubnubChatInitChatResult InitChatResult = PubnubChatSubsystem->InitChat(TEXT("demo"), TEXT("demo"), TEXT("Player_001")); UPubnubChat* PubnubChat = InitChatResult.Chat; } Chat now allows you to call all Chat SDK functions, for example, Chat->GetChannel("my_channel").

:::note Asynchronous and synchronous method execution
Most PubNub Unreal SDK methods are available in both asynchronous and synchronous variants.
* Asynchronous methods (Async suffix) return void and take an optional delegate parameter that fires when the operation completes. 1Chat->GetChannelAsync("support", OnGetChannelResponseDelegate); You can also use native callbacks that accept lambdas instead of dynamic delegates. Native callback types have the Native suffix (for example, FOnPubnubChatChannelResponseNative).
* Synchronous methods (no suffix) block the main game thread until the operation completes and return a result struct directly. 1FPubnubChatChannelResult Result = Chat->GetChannel("support");
:::

## Get channel

### Method signature

#### C++ / Input parameters

```cpp
Chat->GetChannel(FString ChannelID)
```

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| ChannelID | FString | Yes |  | Unique channel identifier (up to 92 UTF-8 byte sequences). |

#### Blueprint

#### Output

| Parameter | Description |
| --- | --- |
| `FPubnubChatChannelResult`Type: `struct` | Returned object containing `Result` and `Channel`. |
| → `Result`Type: `FPubnubChatOperationResult` | Operation result with `Error` (bool) and `ErrorMessage` (FString). |
| → `Channel`Type: `UPubnubChatChannel*` | The requested channel object, or `nullptr` if the channel doesn't exist. |

### Sample code

:::tip Reference code
This example is a self-contained code snippet ready to be run. Set up your Unreal project and follow the instructions in the lines marked with `ACTION REQUIRED` before running the code. Use it as a reference when working with other examples in this document.
:::

Fetch a channel by ID asynchronously.

###### C++

###### Actor.h

```cpp
// blueprint.opsk7ay9
UFUNCTION(BlueprintCallable, Category = "PubnubChat|Samples|Chat|Channel")
void GetChannelSample();

UFUNCTION()
void OnGetChannelResponse(const FPubnubChatChannelResult& Result);
```

###### Actor.cpp

```cpp
// ACTION REQUIRED: Replace ASample_Chat with name of your Actor class
void ASample_Chat::GetChannelSample()
{
	// snippet.hide
	UPubnubChat* Chat = nullptr;
	// snippet.show

	// Assumes Chat is a valid and initialized instance of UPubnubChat

	// Fetch a channel by ID asynchronously (e.g. to show details or join)
	FOnPubnubChatChannelResponseNative Callback;
	// ACTION REQUIRED: Replace ASample_Chat with name of your Actor class
	Callback.BindUObject(this, &ASample_Chat::OnGetChannelResponse);
	Chat->GetChannelAsync(TEXT("Lobby_001"), Callback);
}

// ACTION REQUIRED: Replace ASample_Chat with name of your Actor class
void ASample_Chat::OnGetChannelResponse(const FPubnubChatChannelResult& Result)
{
	if (Result.Result.Error) { return; }
	UPubnubChatChannel* Channel = Result.Channel;
}
```

###### Blueprint

## Get channel ID

`GetChannelID` is a getter method that returns the channel's ID.

### Method signature

#### C++ / Input parameters

```cpp
Channel->GetChannelID();
```

#### Blueprint

#### Output

| Type | Description |
| --- | --- |
| `FString` | Returned channel ID. |

### Sample code

Return the ID of the channel `support`.

#### C++

```cpp
// ACTION REQUIRED: Replace ASample_ChatChannel with name of your Actor class
void ASample_ChatChannel::GetChannelIDSample()
{
	// snippet.hide
	UPubnubChatChannel* Channel = nullptr;
	// snippet.show

	// Assumes Channel is a valid UPubnubChatChannel (e.g. from GetChannel)

	// Get the channel ID (local, no network call)
	FString ChannelID = Channel->GetChannelID();
}
```

#### Blueprint

## Get channel data

`GetChannelData` is a getter method that returns the channel's data.

### Method signature

#### C++ / Input parameters

```cpp
Channel->GetChannelData();
```

#### Blueprint

#### Output

| Type | Description |
| --- | --- |
| `FPubnubChatChannelData` | Returned [channel data](https://www.pubnub.com/docs/chat/unreal-chat-sdk/learn/chat-entities/channel). |

### Sample code

Return channel data from the `support` channel.

#### C++

```cpp
// ACTION REQUIRED: Replace ASample_ChatChannel with name of your Actor class
void ASample_ChatChannel::GetChannelDataSample()
{
	// snippet.hide
	UPubnubChatChannel* Channel = nullptr;
	// snippet.show

	// Assumes Channel is a valid UPubnubChatChannel (e.g. from GetChannel)

	// Get channel metadata from local cache (local, no network call)
	FPubnubChatChannelData ChannelData = Channel->GetChannelData();
	FString ChannelName = ChannelData.ChannelName;
}
```

#### Blueprint