# Links not working when creating task with API

**URL:** <https://forum.asana.com/t/links-not-working-when-creating-task-with-api/95429>\
**Category:** API & Developers\
**Created:** [24 September 2020 18:30 UTC](https://forum.asana.com/t/links-not-working-when-creating-task-with-api/95429 "2020-09-24T18:30:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sunny\_Techo](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/sunny_techo/32/62223_2.png) [@Sunny\_Techo](https://forum.asana.com/u/Sunny_Techo)\
**Post date:** [24 September 2020 18:30 UTC](https://forum.asana.com/t/links-not-working-when-creating-task-with-api/95429/1 "2020-09-24T18:30:31Z")

</div>

Hello,

Links not working when creating task with API.

---

<div class="post-metadata">

**Author:** ![Phil\_Seeman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/phil_seeman/32/81525_2.png) [@Phil\_Seeman](https://forum.asana.com/u/Phil_Seeman)\
**Post date:** [24 September 2020 18:43 UTC](https://forum.asana.com/t/links-not-working-when-creating-task-with-api/95429/2 "2020-09-24T18:43:10Z")

</div>

Hi @Sunny_Techo,

We’ll need more detail than that to be able to provide any feedback or help.

How are you creating the link? What does one look like once you’ve created it? Exactly what happens - what is the result in your browser - when you click on it? Etc.

---

<div class="post-metadata">

**Author:** ![Sunny\_Techo](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/sunny_techo/32/62223_2.png) [@Sunny\_Techo](https://forum.asana.com/u/Sunny_Techo)\
**Post date:** [24 September 2020 18:46 UTC](https://forum.asana.com/t/links-not-working-when-creating-task-with-api/95429/3 "2020-09-24T18:46:58Z")

</div>

Hello Phil,  
Thanks for your response.

So, I’m sending link as a text without any anchor tag and It’s automatically created in links. Today, When I checked it’s seems links no longer automatically applied anchor tag on it.

Please see shared image.

![screenshot-app.asana.com-2020.09.25-00_14_42](https://us1.discourse-cdn.com/asana/original/3X/1/3/138ae0b416ebeec9c886f2ea8f5eb615000c1654.png)

---

<div class="post-metadata">

**Author:** ![Sunny\_Techo](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/sunny_techo/32/62223_2.png) [@Sunny\_Techo](https://forum.asana.com/u/Sunny_Techo)\
**Post date:** [24 September 2020 19:03 UTC](https://forum.asana.com/t/links-not-working-when-creating-task-with-api/95429/4 "2020-09-24T19:03:20Z")

</div>

So, here more detailed description:  
 → Creating task using API and sending all description information with **html\_notes**.  
Description include text and some tags but I’m sending link as a text without any anchor link on them.  
 → In Asana, task created successfully and Initially, I’t converting text link into anchor tag link but when we observe today. It seems it’s not working that way.

To confirm this, when I tried to edit same task with my Asana mobile app. It’s seems to be working fine their means all link text will be converted into anchor tag link and they are clickable.

But, this is not working in browser.

---

<div class="post-metadata">

**Author:** ![Phil\_Seeman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/phil_seeman/32/81525_2.png) [@Phil\_Seeman](https://forum.asana.com/u/Phil_Seeman)\
**Post date:** [24 September 2020 19:09 UTC](https://forum.asana.com/t/links-not-working-when-creating-task-with-api/95429/5 "2020-09-24T19:09:57Z")

</div>

I think what I would do is format your link tag as indicated here:

> **[Rich text](https://developers.asana.com/docs/rich-text#writing-rich-text)**
>
> 📘New rich text formatsWe are actively adding new rich texts formats to various objects in Asana. This may break existing apps. New apps should be built using parsers and display logic that is forward compatible with the forthcoming rich text formats....

---

<div class="post-metadata">

**Author:** ![Sunny\_Techo](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/sunny_techo/32/62223_2.png) [@Sunny\_Techo](https://forum.asana.com/u/Sunny_Techo)\
**Post date:** [24 September 2020 19:13 UTC](https://forum.asana.com/t/links-not-working-when-creating-task-with-api/95429/6 "2020-09-24T19:13:20Z")

</div>

Yes, I got it but It’s automatically converted before and this a tag is introduced recently?

---

<div class="post-metadata">

**Author:** ![Phil\_Seeman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/phil_seeman/32/81525_2.png) [@Phil\_Seeman](https://forum.asana.com/u/Phil_Seeman)\
**Post date:** [24 September 2020 19:18 UTC](https://forum.asana.com/t/links-not-working-when-creating-task-with-api/95429/7 "2020-09-24T19:18:55Z")

</div>

Make sure you’re not being caught by what I believe is a typo in the docs:

> [@Typo in API documentation?](https://forum.asana.com/t/typo-in-api-documentation/95436):
>
> Hi @Ross_Grambo, I think there is a typo in [https://developers.asana.com/docs/writing-rich-text](https://developers.asana.com/docs/writing-rich-text)… Where it says To keep the contents of your tag and make a custom vanity link, include the property data-asana-dynamic="true" when setting the contents of the tag. You would send \<a data-asana-gid="123" data-asana-dynamic="false"\>This is some custom text!\</a\> and receive `This is some custom text! shouldn’t the value be indicated as false not true? I.e. To keep the contents of your tag an…

  

> [@Sunny\_Techo](#):
>
> this a tag is introduced recently

It was introduced on March 13 of this year:

> [@Vanity links are now in the API](https://forum.asana.com/t/vanity-links-are-now-in-the-api/77394):
>
> Hello all! Some of you may have noticed that Asana has recently added “vanity hyperlinks,” i.e., links that can have text that is different from the target, of the form \<a href="some location"\>different text\</a\>. We recently finished rolling out this feature to all users of the web app, and we can now announce that it’s available in the API as well. It works exactly as you’d expect: the API will no longer ignore the contents of \<a\> tags when you write to any HTML text field, and you can populate…

---

<div class="post-metadata">

**Author:** ![Sunny\_Techo](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/sunny_techo/32/62223_2.png) [@Sunny\_Techo](https://forum.asana.com/u/Sunny_Techo)\
**Post date:** [24 September 2020 19:22 UTC](https://forum.asana.com/t/links-not-working-when-creating-task-with-api/95429/8 "2020-09-24T19:22:08Z")

</div>

> [@Phil\_Seeman](#):
>
> It was introduced on March 13 of this year:

This is really strange. It’s working for us till yesterday but suddenly stopped.

---

<div class="post-metadata">

**Author:** ![Phil\_Seeman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/phil_seeman/32/81525_2.png) [@Phil\_Seeman](https://forum.asana.com/u/Phil_Seeman)\
**Post date:** [24 September 2020 19:29 UTC](https://forum.asana.com/t/links-not-working-when-creating-task-with-api/95429/9 "2020-09-24T19:29:36Z")

</div>

Hmm, afraid I’m stumped on that one then.

@Ross_Grambo you guys didn’t just change anything with rich-text link formatting, right?

---

<div class="post-metadata">

**Author:** ![Ross\_Grambo](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/ross_grambo/32/68568_2.png) [@Ross\_Grambo](https://forum.asana.com/u/Ross_Grambo)\
**Post date:** [24 September 2020 20:46 UTC](https://forum.asana.com/t/links-not-working-when-creating-task-with-api/95429/10 "2020-09-24T20:46:04Z")

</div>

Soooo something did change here and I’ll explain my understanding.

There was a change at the beginning of the year where the API stopped auto-formatted hyperlinks for you (the link @Phil_Seeman mentioned). This meant when you send `https://example.com` in `html_notes` we no longer automatically turn that into `<a href="https://example.com">https://example.com</a>`. I believe the reasoning was because `html_notes` is explicit and gives the dev the power to determine what should be linkify-ed and what shouldn’t (meaning if you pass `https://example.com` in `notes`, we will linkify it for you).

The yesterday part is that the team that handles how text is displayed in Asana the product, was auto-linkifying items on read still until yesterday. So developers didn’t see their integrations break back in March and are instead seeing it break now.

In summary: If you want auto-linkifying, you should use `notes` instead of `html_notes`, or explicitly declare the link inside of your `html_notes`.

---

<div class="post-metadata">

**Author:** ![Sunny\_Techo](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/sunny_techo/32/62223_2.png) [@Sunny\_Techo](https://forum.asana.com/u/Sunny_Techo)\
**Post date:** [25 September 2020 06:02 UTC](https://forum.asana.com/t/links-not-working-when-creating-task-with-api/95429/11 "2020-09-25T06:02:55Z")

</div>

Thanks Ross, for your explanation but it’s also affected task already created and not updated recently. Do you confirm it’s work like that?

So If I start using notes, do I rely on them or start adding link explicitly?

---

<div class="post-metadata">

**Author:** ![Sunny\_Techo](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/sunny_techo/32/62223_2.png) [@Sunny\_Techo](https://forum.asana.com/u/Sunny_Techo)\
**Post date:** [25 September 2020 07:01 UTC](https://forum.asana.com/t/links-not-working-when-creating-task-with-api/95429/12 "2020-09-25T07:01:09Z")

</div>

Also one more observation, when I tried to edit using mobile app then it’s working like before but not in browsers.

---

<div class="post-metadata">

**Author:** ![Ross\_Grambo](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/ross_grambo/32/68568_2.png) [@Ross\_Grambo](https://forum.asana.com/u/Ross_Grambo)\
**Post date:** [25 September 2020 17:55 UTC](https://forum.asana.com/t/links-not-working-when-creating-task-with-api/95429/13 "2020-09-25T17:55:25Z")

</div>

Any task created since we rolled out vanity links in March could have unlinkified notes (due to that API change). The web app was automatically adding `<a>` tags around [www.example.com](http://www.example.com) on read (but no longer does), and the mobile app continues to do that.

I would recommend sticking with html\_notes but explicitly setting `<a>` tags around things you want linked. That way, if you want to use other features of html\_notes in the future, you’re good to go.

---

<div class="post-metadata">

**Author:** ![Sunny\_Techo](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/sunny_techo/32/62223_2.png) [@Sunny\_Techo](https://forum.asana.com/u/Sunny_Techo)\
**Post date:** [26 September 2020 05:46 UTC](https://forum.asana.com/t/links-not-working-when-creating-task-with-api/95429/14 "2020-09-26T05:46:53Z")

</div>

Thanks Ross\_Grambo,  
I’ll make changes and unfortunately I’ve to stick with html\_notes because we are using some other html tags too.  
I believe that’s answer my question. So, I marked it as a solution.

Thanks for your response.  
Have a good day and stay safe.

---

<div class="post-metadata">

**Author:** ![Hema\_Sri\_Sankarneni](https://luna1.co/8d76cd.png) [@Hema\_Sri\_Sankarneni](https://forum.asana.com/u/Hema_Sri_Sankarneni)\
**Post date:** [19 April 2021 10:25 UTC](https://forum.asana.com/t/links-not-working-when-creating-task-with-api/95429/15 "2021-04-19T10:25:53Z")

</div>

Hi @Sunny_Techo ,  
If you used vanity link in html notes could you please give the sample code. I tried below 2 formats and it says bad request through API. I am tring to add a link in descirption field of task in update scenario.  
Format 1:  
String httpBody = ‘{’ +  
‘“data”: {’ +  
‘“html\_notes”: “Here”}}’;  
Format 2:   
String httpBody = ‘{’ +  
‘“data”: {’ +  
‘“html\_notes”: “Here”}}’;  
@Phil_Seeman @Ross_Grambo

---

<div class="post-metadata">

**Author:** ![Hema\_Sri\_Sankarneni](https://luna1.co/8d76cd.png) [@Hema\_Sri\_Sankarneni](https://forum.asana.com/u/Hema_Sri_Sankarneni)\
**Post date:** [19 April 2021 10:27 UTC](https://forum.asana.com/t/links-not-working-when-creating-task-with-api/95429/16 "2021-04-19T10:27:32Z")

</div>

![image](https://us1.discourse-cdn.com/asana/original/3X/6/4/6416e6f33f9dd66447159973f97b05090fe6104c.png)  
sorry website turned them into links after I posted code. Attaching image instead. @Phil_Seeman@Sunny_Techo

---

<div class="post-metadata">

**Author:** ![Phil\_Seeman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/phil_seeman/32/81525_2.png) [@Phil\_Seeman](https://forum.asana.com/u/Phil_Seeman)\
**Post date:** [19 April 2021 13:56 UTC](https://forum.asana.com/t/links-not-working-when-creating-task-with-api/95429/17 "2021-04-19T13:56:04Z")

</div>

Hi @Hema_Sri_Sankarneni,

There should be an error message also coming back with your error code, which might provide more clues as to the exact problem. What’s the text of the message it’s sending you?

---

<div class="post-metadata">

**Author:** ![Hema\_Sri\_Sankarneni](https://luna1.co/8d76cd.png) [@Hema\_Sri\_Sankarneni](https://forum.asana.com/u/Hema_Sri_Sankarneni)\
**Post date:** [20 April 2021 09:32 UTC](https://forum.asana.com/t/links-not-working-when-creating-task-with-api/95429/18 "2021-04-20T09:32:53Z")

</div>

Hi @Phil_Seeman ,  
body code:  
String httpBody = ‘{’ +  
‘“data”: {’ +  
‘“html\_notes”: “Here”}}’;

 ![image](https://us1.discourse-cdn.com/asana/original/3X/2/1/21fd509af9edbbf0660cbcd2c9375d54a4aa399f.png)  
error message: {“errors”:[{“message”:“Could not parse request data, invalid JSON”,“help”:“For more information on API status codes and how to handle them, read the docs on errors: [Build an app with Asana](https://asana.com/developers/documentation/getting-started/errors)”}]}

In postman, I tried with same html notes as above and update worked fine.

 ![image](https://us1.discourse-cdn.com/asana/original/3X/b/d/bdbe3f17bbfaf864387f35cbcb00abe93086e924.png)  
In the same body as above, if we add remove anchor tag and try to hit the api update worked fine.   
String httpBody = ‘{’ +  
‘“data”: {’ +  
‘“html\_notes”: “Test Test”}}’;

---

<div class="post-metadata">

**Author:** ![Phil\_Seeman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/phil_seeman/32/81525_2.png) [@Phil\_Seeman](https://forum.asana.com/u/Phil_Seeman)\
**Post date:** [20 April 2021 14:12 UTC](https://forum.asana.com/t/links-not-working-when-creating-task-with-api/95429/19 "2021-04-20T14:12:52Z")

</div>

If it worked fine in Postman, then it’s not an API issue, must be something with the client code. Not sure what you’re using to do the programmatic access (one of the official libraries or rolling your own?) but I’m thinking perhaps there needs to be some escaping of some of the string elements?

---

<div class="post-metadata">

**Author:** ![Service\_Account](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/service_account/32/74174_2.png) [@Service\_Account](https://forum.asana.com/u/Service_Account)\
**Post date:** [20 April 2021 16:46 UTC](https://forum.asana.com/t/links-not-working-when-creating-task-with-api/95429/20 "2021-04-20T16:46:42Z")

</div>

Hi @Phil_Seeman , I am not sure this what you asked for but I added a remote site setting in salesforce and using the callouts to post into and retrieve from ASANA. I am using REST API(http).

[Next page](https://forum.asana.com/t/links-not-working-when-creating-task-with-api/95429.md?page=2)
