# It is not possible to get only non-archived projects via API using node-sdk-v1

**URL:** <https://forum.asana.com/t/it-is-not-possible-to-get-only-non-archived-projects-via-api-using-node-sdk-v1/966411>\
**Category:** API & Developers\
**Created:** [4 November 2024 08:53 UTC](https://forum.asana.com/t/it-is-not-possible-to-get-only-non-archived-projects-via-api-using-node-sdk-v1/966411 "2024-11-04T08:53:25Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alberto20](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/alberto20/32/272569_2.png) [@Alberto20](https://forum.asana.com/u/Alberto20)\
**Post date:** [4 November 2024 08:53 UTC](https://forum.asana.com/t/it-is-not-possible-to-get-only-non-archived-projects-via-api-using-node-sdk-v1/966411/1 "2024-11-04T08:53:25Z")

</div>

Hello all!

Since a few hours (maybe days) it´s not possible to get only non-archived projects via API using the node-sdk-v1. I´am able to get non-archived projects using node-sdk-v3 but not using v1.

You can reproduce the issue by creating a new node project and using the code below:

```auto
const asana = require('asana');

const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');

client.projects.getProjectsForWorkspace(WORKSPACE_ID, {
    team: TEAM_ID,
    archived: false,
    limit: 10,
}).then((result) => {
    console.log(result);
});

```

We have an APP using the version v1 that is unable to update at this time… I think that v1 should works as expected too and this is an API bug.

Can you help us?

Thank you very much

---

<div class="post-metadata">

**Author:** ![FemtoVpp](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/femtovpp/32/272578_2.png) [@FemtoVpp](https://forum.asana.com/u/FemtoVpp)\
**Post date:** [4 November 2024 09:20 UTC](https://forum.asana.com/t/it-is-not-possible-to-get-only-non-archived-projects-via-api-using-node-sdk-v1/966411/2 "2024-11-04T09:20:54Z")

</div>

Hi there,

Same problem since this morning with node Asana v3.  
Even on the [API reference](https://developers.asana.com/reference/getprojects), defining the field **archived** to `false` doesn’t seem to do anything.

Could this be a bug ?

---

<div class="post-metadata">

**Author:** ![Théo\_PAVLOVIC](https://luna1.co/8d76cd.png) [@Théo\_PAVLOVIC](https://forum.asana.com/u/Th%C3%A9o_PAVLOVIC)\
**Post date:** [4 November 2024 14:41 UTC](https://forum.asana.com/t/it-is-not-possible-to-get-only-non-archived-projects-via-api-using-node-sdk-v1/966411/4 "2024-11-04T14:41:41Z")

</div>

Hello, i have the same problem, since this morning, the parameter “&archived=false” in my get request doesn’t work. What i did is, listed all projecs from a team workspace and in the optional fields i included “opt\_fields=created\_at,name, **archived** ” , then what i did is, comparing if this is equals to true or false to only get the non-archived ones.  
Hope this helps, and i hope the parameter thing is just a bug.

---

<div class="post-metadata">

**Author:** ![John\_Vu](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/john_vu/32/97235_2.png) [@John\_Vu](https://forum.asana.com/u/John_Vu)\
**Post date:** [4 November 2024 18:57 UTC](https://forum.asana.com/t/it-is-not-possible-to-get-only-non-archived-projects-via-api-using-node-sdk-v1/966411/5 "2024-11-04T18:57:02Z")

</div>

Hi @Alberto20,

This doesn’t look like a client library issue. The API behaves the same when you try this with cURL as well:

```bash
curl --location 'https://app.asana.com/api/1.0/workspaces/<WORKSPACE_GID>/projects?archived=false&team=<YOUR_TEAM>' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <YOUR_PERSONAL_ACCESS_TOKEN>'

```

It looks like you are making an API call to our [Get all projects in a workspace](https://developers.asana.com/reference/getprojectsforworkspace) endpoint. If you look at these docs under the **“QUERY PARAMS”** section `team` is not a valid query param for this endpoint.  
`archived` however is a valid query param for this endpoint. If you leave out `team` and provide `archived` it should work as expected.

 ![team_query_param](https://us1.discourse-cdn.com/asana/original/4X/d/c/9/dc913322a0ee8f6c3a7aac1d20ca82e6a8cf43a2.png)

[node-asana (v1)](https://www.npmjs.com/package/asana/v/1.0.5):

```javascript
const asana = require('asana');

const client = asana.Client.create().useAccessToken("<YOUR_PERSONAL_ACCESS_TOKEN>");

client.projects.getProjectsForWorkspace("<YOUR_WORKSPACE_GID>", {archived: "false"})
    .then((result) => {
        console.log(result);
    });

```

---

<div class="post-metadata">

**Author:** ![Alberto20](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/alberto20/32/272569_2.png) [@Alberto20](https://forum.asana.com/u/Alberto20)\
**Post date:** [5 November 2024 07:33 UTC](https://forum.asana.com/t/it-is-not-possible-to-get-only-non-archived-projects-via-api-using-node-sdk-v1/966411/6 "2024-11-05T07:33:13Z")

</div>

Hi John\_Vu,

The code you have suggested seems to work, ignoring `team` parameter makes that `archived` works. That weird because the code I provided previously works well since years until some hours ago…

In view of the above, I supposed that we need to call `getProjectsForTeam` including param `archived: false` for getting all non-archived projects from a team… But this also does not working… `archived` parameter is ignored too.

```auto
const asana = require('asana');

const client = asana.Client.create().useAccessToken('XXXXXXXXXX');

client.projects.getProjectsForTeam(XXXXXXXXXX, { archived: false })
    .then((result) => {
        console.log(result);
    });

```

Can you help to us?

Thank you so much

---

<div class="post-metadata">

**Author:** ![John\_Vu](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/john_vu/32/97235_2.png) [@John\_Vu](https://forum.asana.com/u/John_Vu)\
**Post date:** [5 November 2024 19:45 UTC](https://forum.asana.com/t/it-is-not-possible-to-get-only-non-archived-projects-via-api-using-node-sdk-v1/966411/7 "2024-11-05T19:45:24Z")

</div>

Hi @Alberto20,

> That weird because the code I provided previously works well since years until some hours ago…

I checked with our API team and we have identified this to be a bug.

Summary of the issue:

- When you make an API call to [Get all projects in a workspace (GET /workspaces/{workspace\_gid}/projects)](https://developers.asana.com/reference/getprojectsforworkspace) with `archived = false` + `team=<YOUR_TEAM_GID>`  
**- EXPECTED:** to return projects in the team that are not archived  
**- CURRENT/BUG BEHAVIOR:** projects being returned that are in the team but include archived projects

- When you make an API call to [Get a team’s projects (/teams/{team\_gid}/projects)](https://developers.asana.com/reference/getprojectsforteam) with `archived = false`  
**- EXPECTED:** to return projects in the team that are not archived  
**- CURRENT/BUG BEHAVIOR:** projects being returned that are both archived and non-archived

Workaround Soltuion (at least until we have a fix out):

- Make an API call to [Get a team’s projects (/teams/{team\_gid}/projects)](https://developers.asana.com/reference/getprojectsforteam) without any `archived` query params and do clientside filtering of those projects

Our API team is currently working on a fix for this so if you are blocked please use the workaround solution.

---

<div class="post-metadata">

**Author:** ![Alberto20](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/alberto20/32/272569_2.png) [@Alberto20](https://forum.asana.com/u/Alberto20)\
**Post date:** [6 November 2024 07:59 UTC](https://forum.asana.com/t/it-is-not-possible-to-get-only-non-archived-projects-via-api-using-node-sdk-v1/966411/8 "2024-11-06T07:59:29Z")

</div>

Many thanks [John\_Vu](https://forum.asana.com/u/John_Vu) , we hope the bug will be resolved ASAP. We look forward to hearing from you.

---

<div class="post-metadata">

**Author:** ![Alberto20](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/alberto20/32/272569_2.png) [@Alberto20](https://forum.asana.com/u/Alberto20)\
**Post date:** [7 November 2024 14:25 UTC](https://forum.asana.com/t/it-is-not-possible-to-get-only-non-archived-projects-via-api-using-node-sdk-v1/966411/9 "2024-11-07T14:25:55Z")

</div>

Hi there! It seems that is working well since this morning, our APP shows the correct projects again! 🥳 🎉 👏

---

<div class="post-metadata">

**Author:** ![John\_Vu](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/john_vu/32/97235_2.png) [@John\_Vu](https://forum.asana.com/u/John_Vu)\
**Post date:** [7 November 2024 17:26 UTC](https://forum.asana.com/t/it-is-not-possible-to-get-only-non-archived-projects-via-api-using-node-sdk-v1/966411/10 "2024-11-07T17:26:45Z")

</div>

Hi @Alberto20,

It looks like you beat me to it. We deployed the fix yesterday. I wanted to wait a bit before replying in case we had to roll back, but we are good here. Thank you for reporting and helping us test this issue 🙂

---

<div class="post-metadata">

**Author:** ![Alberto20](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/alberto20/32/272569_2.png) [@Alberto20](https://forum.asana.com/u/Alberto20)\
**Post date:** [8 November 2024 06:51 UTC](https://forum.asana.com/t/it-is-not-possible-to-get-only-non-archived-projects-via-api-using-node-sdk-v1/966411/11 "2024-11-08T06:51:06Z")

</div>

Thank you so much [John\_Vu](https://forum.asana.com/u/John_Vu) 🙂

---

<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:** [15 November 2024 06:51 UTC](https://forum.asana.com/t/it-is-not-possible-to-get-only-non-archived-projects-via-api-using-node-sdk-v1/966411/12 "2024-11-15T06:51:55Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
