Detect Archived Spaces in API
AnsweredWe're looking into putting together a tool to create an aggregated view of tasks across multiple workspaces. We don't want to include spaces that have been archived. I can't find a response in the get spaces calls from the API that details whether or not a space is archived. Is there a way to determine this? What am I missing?
-
Hi Andreas,
Sorry to bring this up again so many months later, but this was an internal project that got shelved for a bit while we dealt with client work. We're getting back to it now and finding that adding the fields=archived parameter isn't providing an archived field as you suggested.
We are using podio-php and attempting to hit the /space/org/{org_id}/ endpoint using the following line:
PodioSpaces::get_for_org($org_id, array('fields' = 'archived');
But we aren't finding an archived attribute in the response. We also tried hitting the /space/{space_id} for each space, again using podio-php and adding the fields=archived parameter, but those calls also do not appear to return archived. Is the option not supported any more or is it specific to select space endpoints?
-
Hi Andreas,
It turns out the podio-php client library doesn't support undocumented fields. The get_for_org method doesn't support adding a query by default. When it is modified to accept the fields=archived param, the raw response does return the archived field, however the PodioSpace class doesn't contain that field as a property, so it gets ignored when PodioObject wraps the response in a class.
The solution ended up requiring the creation of a subclass of PodioSpace that adds the archived property and extends get_for_org to allow it to accept query strings.
Thanks for the help.
Please sign in to leave a comment.
Comments
4 comments