[Halted] Upcoming changes that impact getting and setting memberships and access levels

which endpoint are you using? Are you setting any Asana-Enable headers?

POST’ing to https://app.asana.com/api/1.0/memberships - but wondering if I’ve got an invalid header. What should that Asana-Enable be set to for this?

To avoid potential confusion (“I set them as comment-only via the API but they can still edit stuff!”), I’d recommend that you document this as a note in the API docs.

1 Like

Is GET /workspaces affected too?
We got the error about this change in response, but this endpoint is not mentioned here

@sasha_f

Set editor access level foe user in project from example

url = "https://app.asana.com/api/1.0/memberships?parent=1201287477610898&member=1201428734740686&opt_fields="

payload = {"data": {'standard_access_level': "editor"}}


response = requests.post(url, json=payload, headers=headers)

print(response.text)

But user ger comment_only access to project. How to change my request to fet the opportunity to give editor access level to a project?

With the previous Team Membership API endpoint (/users/<usergid>/team_memberships) you had the option to get all the teams belonging (= being a member of) to the given user. What is the alternative with the current endpoint?

A parent parameter along with a member parameter are available. Member should obviously be the user, but the parent is required too. Therefore, you cannot get a list of all related teams. The only alternative I can think of right now is to list all teams inside a workspace and loop through all teams to see if the given user is a member, but that will require a lot of calls for something that should be simple.

There must be a better way to do this right? :thinking:

1 Like

You can find these values in the header record that’s returned from any API call. For example, this is what I see as of this writing:
image

So the answer to your question is new_memberships

1 Like

Hello. Recently I started getting some warning messages in my application that uses Asana client for Java. The warning is the following:

This request is affected by the "new_memberships" deprecation. Please visit this url for more info: https://forum.asana.com/t/upcoming-changes-that-impact-getting-and-setting-memberships-and-access-levels/232106?u
Adding "new_memberships" to your "Asana-Enable" or "Asana-Disable" header will opt in/out to this deprecation and suppress this warning.
  1. Is it possible that the requests that I make with the help of java Asana client will stop working in the future due to the api changes?
  2. Are there going to be some updates of the java Asana client so that it will start utilizing the new version of asana memberships endpoints?
  3. Is it possible to turn off these warnings somehow now? I mean these particular warnings only, not the whole warning level of logger?

Thank you in advance.

Hi @anon34195150,

Yes! Per this timeline above, they will stop working on 3/10 unless you add an Asana-Disable="new_memberships" header, and they will stop working altogether on 4/19.

I’m sure there will be, but the question of course is, when? @sasha_f @AndrewWong ?

Not sure but perhaps if you add the header I mentioned above, it might stop the warnings (though I wouldn’t bet on it).

FYI if you want to set the header in the current Java client, this post shows an example of how you can do that:

1 Like

Nailed it, thanks so much! The Asana-Enable = new_memberships did the trick. And follow-up on my other comment. Those standard_access_levels are (unsurprisingly) documented correctly, so comment_only instead of CONTRIBUTOR, per the error. The custom header fixed that. :+1:

Also did a bit of tinkering re: potential mapping of standard_access_levels to the membership’s notifications settings—no dice, even with the most restrictive comment_only. Based on the docs for this endpoint, I just assume that’s not a thing…yet.

@sasha_f that ability to set notifications via these endpoints (or something similar/related) would, IMHO and for our use-case, make this feature complete…for what it’s worth. :grinning: Thanks again, to you and the team, for all your work + communication on this!

1 Like

Thank you, it helped. The warnings are gone now. The question is: does this header do anything except for negating the warnings? I mean could there be any side effects in current behavior of the requests after adding this header?

1 Like

What a header of Asana-Disable="new_memberships" does is to keep the behavior of your API usage to the current API for as long as possible; that is, until April 19. However, on that date the new endpoints and behavior discussed in this thread will be the behavior of the API, regardless of any headers.

Noted!

1 Like

@_Sander FYI Asana is looking into this question and should have some info on it to come.

1 Like

When I attempt to remove members from a portfolio using Delete a membership, I get a 403 error. I don’t have this problem when I use Remove users from a portfolio. Am I missing some permission on my app?

good evening,
I just installed the plugin “completionist” for displaying a List of taks within a membership site and running into these errors:
Warning: openssl_decrypt(): IV passed is only 15 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /homepages/31/d122145088/htdocs/ImageExpert/wp-content/plugins/completionist/src/includes/class-options.php on line 592

Warning: This request is affected by the “new_memberships” deprecation. Please visit this url for more info: [Halted] Upcoming changes that impact getting and setting memberships and access levels Adding “new_memberships” to your “Asana-Enable” or “Asana-Disable” header will opt in/out to this deprecation and suppress this warning. in /homepages/31/d122145088/htdocs/ImageExpert/wp-content/plugins/completionist/vendor/asana/asana/src/Asana/Client.php on line 181

I am not a developer, I have not even e clue how to change the “header”, is there a solution for a newbee like me? Thanks for help.
kind regards
Carmen

Hi @Carmen_Brablec,

Have you contacted the author of the “completionist” plugin? They’re going to be in the best position to know where/how in their plugin to make those changes. Also note (and I would bring this up to them) that the change they suggest will only work until 4/19 at which point a larger code change, presumably by the plugin author, will be needed.

@sasha_f Please, help! How to add a member to project with editor access? Example from documentation doesn’t work. payload = {“data”: {‘standard_access_level’: “editor”}} . I get response “write_access”:“comment_only”.

@admin33 playing with this endpoint myself as well, I could only turn someone into comment only. Any other attempt failed.

Hi folks,

Thank you all for the feedback, this has been very helpful. While we haven’t been able to respond to each message, we’ve been tracking them and routing them to the appropriate teams at Asana.

Rest assured that we’re aware of the short period of time between now and the current Opt-Out date, and we’re looking into potential timeline adjustments given the feedback. We hope to have an update about the timeline very soon.

4 Likes

Hey folks,

We’ve reviewed our existing timeline and the feedback you’ve provided and are
going to pause our deployment of these changes for the moment. Here’s what this means:

  • the change will remain available for opt-in via the
    Asana-Enable: new_memberships header
  • we will make adjustments to the interface and address some of the feedback
    and share an updated interface and make it available shortly
    • this updated interface will not be significantly different from what
      we’ve shared, but will address some of the use cases that were missing
      or difficult, and increase the ergonomics of polymorphic API responses
  • the new interface will not use the new_memberships key and will use a
    different key

Thanks,
Sasha

4 Likes