Skip to content

Latest commit

 

History

History
125 lines (83 loc) · 2.53 KB

Channels.md

File metadata and controls

125 lines (83 loc) · 2.53 KB

Helo::Channels

Method HTTP request Description
list GET /channels List all channels
create POST /channels Create a channel
retrieve GET /channels/{id} Retrieve a channel
update PATCH /channels/{id} Update a channel
delete DELETE /channels/{id} Delete a channel

list

list(opts)

List all channels

Retrieves a list of all channels accessible to the current user.

Example

Helo.configure do |config|
  config.api_key = ENV.fetch("HELO_API_KEY")
end

opts = {
  limit: 10,
  offset: 10,
  name: "example",
  channel_ids: ["550e8400-e29b-41d4-a716-446655440000", "6ba7b810-9dad-11d1-80b4-00c04fd430c8"],
  delivery_type: "live"
}
Helo::Channels.list(opts)

create

create(create_channel_request)

Create a channel

Creates a new communication channel for organizing and routing messages.

Example

Helo.configure do |config|
  config.api_key = ENV.fetch("HELO_API_KEY")
end

create_channel_request = Helo::CreateChannelRequest.new(
  name: "test-name",
  delivery_type: Helo::DeliveryType::LIVE,
  tracking: { links: true, opens: true }
)
Helo::Channels.create(create_channel_request)

retrieve

retrieve(id)

Retrieve a channel

Fetches the details and configuration of a specific channel.

Example

Helo.configure do |config|
  config.api_key = ENV.fetch("HELO_API_KEY")
end

id = "550e8400-e29b-41d4-a716-446655440000"
Helo::Channels.retrieve(id)

update

update(id, update_channel_request)

Update a channel

Modifies an existing channel by ID.

Example

Helo.configure do |config|
  config.api_key = ENV.fetch("HELO_API_KEY")
end

id = "550e8400-e29b-41d4-a716-446655440000"
update_channel_request = Helo::UpdateChannelRequest.new(
  name: "test-name",
  delivery_type: Helo::DeliveryType::LIVE,
  tracking: { links: true, opens: true }
)
Helo::Channels.update(id, update_channel_request)

delete

delete(id)

Delete a channel

Permanently removes a channel and all associated data.

Example

Helo.configure do |config|
  config.api_key = ENV.fetch("HELO_API_KEY")
end

id = "550e8400-e29b-41d4-a716-446655440000"
Helo::Channels.delete(id)