# Class ChannelsController | EchoHub Documentation

# Class ChannelsController

Namespace
  EchoHub.Server.Controllers

Assembly
  EchoHub.Server.dll

    [ApiController]
    [Route("api/channels")]
    [Authorize]
    [EnableRateLimiting("general")]
    public class ChannelsController : ControllerBase

Inheritance
  object
  ControllerBase
  ChannelsController

Inherited Members
  object.GetType()
  object.MemberwiseClone()
  object.ToString()
  object.Equals(object)
  object.Equals(object, object)
  object.ReferenceEquals(object, object)
  object.GetHashCode()

## Constructors

### ChannelsController(EchoHubDbContext, FileStorageService, ImageToAsciiService, IHttpClientFactory, IChatService)

    public ChannelsController(EchoHubDbContext db, FileStorageService fileStorage, ImageToAsciiService asciiService, IHttpClientFactory httpClientFactory, IChatService chatService)

#### Parameters

`db` EchoHubDbContext
`fileStorage` FileStorageService
`asciiService` ImageToAsciiService
`httpClientFactory` IHttpClientFactory
`chatService` IChatService

## Methods

### CreateChannel(CreateChannelRequest)

    [HttpPost]
    public Task<IActionResult> CreateChannel(CreateChannelRequest request)

#### Parameters

`request` CreateChannelRequest

#### Returns

Task<IActionResult>

### DeleteChannel(string)

    [HttpDelete("{channel}")]
    public Task<IActionResult> DeleteChannel(string channel)

#### Parameters

`channel` string

#### Returns

Task<IActionResult>

### GetChannels(int, int)

    [HttpGet]
    public Task<IActionResult> GetChannels(int offset = 0, int limit = 50)

#### Parameters

`offset` int
`limit` int

#### Returns

Task<IActionResult>

### SendUrl(string, SendUrlRequest)

    [HttpPost("{channel}/send-url")]
    [EnableRateLimiting("upload")]
    public Task<IActionResult> SendUrl(string channel, SendUrlRequest request)

#### Parameters

`channel` string
`request` SendUrlRequest

#### Returns

Task<IActionResult>

### UpdateTopic(string, UpdateTopicRequest)

    [HttpPut("{channel}/topic")]
    public Task<IActionResult> UpdateTopic(string channel, UpdateTopicRequest request)

#### Parameters

`channel` string
`request` UpdateTopicRequest

#### Returns

Task<IActionResult>

### Upload(string)

    [HttpPost("{channel}/upload")]
    [EnableRateLimiting("upload")]
    public Task<IActionResult> Upload(string channel)

#### Parameters

`channel` string

#### Returns

Task<IActionResult>