# API Search for Tasks by Assignee or Follower

**URL:** <https://forum.asana.com/t/api-search-for-tasks-by-assignee-or-follower/82583>\
**Category:** API & Developers\
**Created:** [6 May 2020 05:01 UTC](https://forum.asana.com/t/api-search-for-tasks-by-assignee-or-follower/82583 "2020-05-06T05:01:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrismo](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/chrismo/32/25958_2.png) [@chrismo](https://forum.asana.com/u/chrismo)\
**Post date:** [6 May 2020 05:01 UTC](https://forum.asana.com/t/api-search-for-tasks-by-assignee-or-follower/82583/1 "2020-05-06T05:01:35Z")

</div>

I have the following API call (via the Ruby client)

[Asana::HttpClient] GET [https://app.asana.com/api/1.0/workspaces/{workspace\_gid}/tasks/search](https://app.asana.com/api/1.0/workspaces/%7Bworkspace_gid%7D/tasks/search) ({:text=\>“\*”, :assignee\_any=\>“8033…”, :followers\_any=\>“8033…”, :modified\_at\_after=\>“2020-05-02T23:48:33-05:00”, :opt\_fields=\>“gid,name,modified\_at,assignee,followers”})

And the hits are all the most recently modified tasks that have no matches at all on assignee or follower, as if it’s just ignoring that criteria. I’m just looking for the most recent tasks where a specific user is the assignee or a follower. I tried it also with just assignee\_any or followers\_any - same results either way. This seems broken?

I am shoe-horning in an asterisk wildcard in for the text, which I couldn’t find any documentation support for, though I’d think if that’s not a wildcard, it just wouldn’t return anything (or would return tasks with a literal asterisk in it)

I can search only by assignee with this API, this seems to work, but I can’t find modified tasks I’m following:

[Asana::HttpClient] GET [https://app.asana.com/api/1.0/tasks](https://app.asana.com/api/1.0/tasks) ({:assignee=\>“8033…”, :workspace=\>“499…”, :modified\_since=\>“2020-05-03T00:00:34-05:00”, :limit=\>20, :opt\_fields=\>“gid,name,modified\_at,assignee,followers”})

---

<div class="post-metadata">

**Author:** ![Frederic\_Malenfant](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/frederic_malenfant/32/8358_2.png) [@Frederic\_Malenfant](https://forum.asana.com/u/Frederic_Malenfant)\
**Post date:** [6 May 2020 14:21 UTC](https://forum.asana.com/t/api-search-for-tasks-by-assignee-or-follower/82583/2 "2020-05-06T14:21:13Z")

</div>

> [@chrismo](#):
>
> :text=\>“\*”

I think you should try to remove that parameter, text “\*”. I use that endpoint to search for other criterias and I never add any “text” parameter, just ids or dates that I need to filter.

---

<div class="post-metadata">

**Author:** ![chrismo](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/chrismo/32/25958_2.png) [@chrismo](https://forum.asana.com/u/chrismo)\
**Post date:** [6 May 2020 16:15 UTC](https://forum.asana.com/t/api-search-for-tasks-by-assignee-or-follower/82583/3 "2020-05-06T16:15:25Z")

</div>

When I remove the text param, the call fails, telling me:

`[Asana::HttpClient] GET https://app.asana.com/api/1.0/workspaces/499.../tasks/search ({:assignee_any=>"803...", :followers_any=>"803...", :modified_at_after=>"2020-05-03T11:13:43-05:00", :opt_fields=>"gid,name,modified_at,assignee,followers"})`

`Asana::Errors::InvalidRequest: You must specify at least one search filter.`

I was presuming `text` was a required search filter. So … maybe I overlooked it in the documentation.

---

<div class="post-metadata">

**Author:** ![Frederic\_Malenfant](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/frederic_malenfant/32/8358_2.png) [@Frederic\_Malenfant](https://forum.asana.com/u/Frederic_Malenfant)\
**Post date:** [6 May 2020 17:09 UTC](https://forum.asana.com/t/api-search-for-tasks-by-assignee-or-follower/82583/4 "2020-05-06T17:09:25Z")

</div>

Oh I see. The error is right, you did not provide any search filter.  
Because, the parameters are:  
followers.any instead of followers\_any. Same for modified\_at.after, …

---

<div class="post-metadata">

**Author:** ![chrismo](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/chrismo/32/25958_2.png) [@chrismo](https://forum.asana.com/u/chrismo)\
**Post date:** [6 May 2020 22:25 UTC](https://forum.asana.com/t/api-search-for-tasks-by-assignee-or-follower/82583/5 "2020-05-06T22:25:16Z")

</div>

Ah! A flaw in the code generator of the params for the Ruby gem. The params get translated as Hash keys for the Ruby code, but a period isn’t a legal character in a key symbol for the Hash key, so something, I’m guessing, is translating the periods to underscores. At one point I briefly noted the params having periods in the docs, but since the gem had one instance of this API call with explicit key name args with underscores, I presumed they’d be doing the proper magic underneath.

There is a second way inside the Ruby library to call this same API endpoint, without the key name method arguments, which can allow the special “string symbol” syntax in Ruby to include the period. Changing to that has this working!

I’ve filed this issue: [Searching workspace bugs/confusion · Issue #93 · Asana/ruby-asana · GitHub](https://github.com/Asana/ruby-asana/issues/93)

Thx @Frederic_Malenfant!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/system/32/276370_2.png) [@system](https://forum.asana.com/u/system)\
**Post date:** [30 May 2025 19:06 UTC](https://forum.asana.com/t/api-search-for-tasks-by-assignee-or-follower/82583/6 "2025-05-30T19:06:55Z")

</div>

Closed on 30 May 2025 19:06 UTC


