How to add links to a conversation with name?
Hi there,
In your documentation, you state that with
client.add_conversation_links!("cnv_55c8c149", {
link_links: ["https://example.com"]
})
one can add URLs to a conversation.
Now, this works great, but what I want is to add links with a name. I know I can do that via the Links API, but how can I do that with the add_conversation_links! method?
Thanks!
P.S.: According to your API documentation the parameter is called link_external_urls and not link_links.
Hi @cspeer, I am not a maintainer of this gem but doing the same thing right now.
I believe this is more of a limitation of the Front API, based on https://dev.frontapp.com/reference/add-conversation-link only allowing link_ids or link_external_urls.
I found that you can first add a link to Front:
my_link = front_client.create_link!(
name: 'New link 2025-03-06',
external_url: 'https://example.com/new-link-2025-03-06',
)
# Return value looks like:
#
# {
# "_links" => { "self" => "https://some.api.frontapp.com/links/top_23456" },
# "id" => "top_23456",
# "name" => "New link 2025-03-06",
# "type" => "web",
# "external_url" => "https://www.example.com/new-link-2025-03-06",
# "custom_fields" => {}
# }
Then you can add that newly created link to the conversation:
front_client.add_conversation_links!('cnv_12345', link_ids: [my_link['id']])
Note that multiple requests to create the same link will just return the original link, so you don't need to check to see if it exists before creating. Also, it looks like you can add multiple times to the same conversation without error.