Solved

How to create a link to the webapp for a view of a draft (or message)

  • 19 January 2024
  • 9 replies
  • 55 views

Badge +2

Use case: I created a draft and I want to share it with my colleagues so they can edit it. They just have to click on this url and it opens the front webapp on a page where they can see and edit the draft / message.

 

How do I create that url?

icon

Best answer by guillaume 9 February 2024, 14:30

View original

9 replies

Userlevel 1
Badge +5

Hi Guillaume,

When you create a draft through the API, there should be a URL provided in the response body under response._links.self that contains the URL which should open this exact draft. You can provide this URL to your teammates and they should be able to then click it to open Front and edit the draft from there.

Badge +2

No, this is not the correct answer. The url is of the format https://louve.api.frontapp.com/messages/msg_24dyrgsy As you can see it is a url to the api not to the webapp. All the url in the _links property are property to the api.

 

>    _links: {
>      self: 'https://louve.api.frontapp.com/messages/msg_24dyrgsy',
>      related: {
>        conversation: 'https://louve.api.frontapp.com/conversations/cnv_16pf52du',
>        message_seen: 'https://louve.api.frontapp.com/messages/msg_24dyrgsy/seen'
>      }
>    }

Userlevel 1
Badge +5

Hi Guillaume,

My apologies - I had forgotten that we append the ‘.api’ part to the URL. If you remove that portion then the URL should be formatted in a way that teammates can click it to take them to the message. One thing to be aware of - the ‘mode’ field needs to be set to ‘shared’ such that teammates can access the draft. The response._links.self URL should then take you to the message provided that you remove the ‘api’ string.

Badge +2

Hi, I tried removing the `.api` part of the url and it still doesn’t work. It just redirect me to whatever last draft in my inbox there is, not the specific draft I want to display.

I fear the link to the fontapp is not in the `_links` property. Where can I create a link to the webapp to display a specific draft or message ?

Userlevel 3
Badge +7

Hi, Guillaume 👋
 

The URLs in _links are URLs that are only useful for the API; they should not be used (either directly or by manipulating the URL) to redirect the user to the app. Our apologies for any prior confusion on the viability of this path.

That being said, our documentation explains how to open Front with a message ID or a conversation ID.

Best, 
Justin 

Badge +2

This does not work  https://app.frontapp.com/open/{message_id} with a draft id. It only works with a conversation id of a draft.

I had to extract the conversation id of the draft at the end of `_links.related.conversation` to append it at the end of https://app.frontapp.com/open/{message_id}

Userlevel 3
Badge +7

Thanks for the update, Guillaume. 

For a message in a draft state, we would recommend using the conversation ID method, as you’ve confirmed. The message ID url to open is operational for messages that are not in a draft state. 

As a result, we’ve added a note to our documentation of this to help clarify for our users. 

Best, 
Justin 

Badge +2

It’s great you’ve updated the documentation, but :

Userlevel 3
Badge +7

Thanks, Guillaume. 

Happy to provide the feedback and request to our Product teams. 

Best,
Justin 

Reply