removeTag and addTag return Error 502

Hi.

No matter what I do, removeTag/addTag calls return error 502 with empty body. This error is also returned if task gid is wrong or tag gid is wrong - no difference in behavior (but these gids are correct in the example below).

+++ POST https://app.asana.com/tasks/1199173041473565/removeTag
+++ { data: { tag: '1112350714369403' } }
=== HTTP 502 (took 369 ms)

Other API requests work, e.g. below is the request which succeeded ~1 second before the above removeTag request failed:

+++ PUT https://app.asana.com/api/1.0/tasks/1199173041473565
+++ { data: { assignee: ‘1107514444678950’, name: ‘ttt4’, notes: ‘zzz’ } }
=== HTTP 200 (took 1636 ms)
=== { data:
=== { gid: ‘1199173041473565’,
=== projects: [ { gid: ‘1148413888941993’, resource_t…

Here is this task:

Oh. Never mind. I forgot to add /api/1.0 to the URLs. With the correct URLs like /api/1.0/tasks/1199173041473565/removeTag, everything works as expected.

I think what’s confusing here is error code 502. If it was e.g. 404, then it would be an immediate hint that something is wrong with the URL.

2 Likes

Congrats on finding the solution yourself :clap: