• Resolved jiraky90

    (@jiraky90)


    Hello,
    I’m having difficulties in adding multiple roles via API using something like this python call:
    requests.put(ENDPOINT + "/wp-json/wp/v2/users/4", headers={"Authorization":"Bearer "+token['jwt_token'], data={"roles": ["author", "customer"]}}
    When I retrieve the user, only the first role has been saved, while the second (and all the rest of the old ones already assigned) are deleted.
    I tried also manipulating the ‘extra_capabilities’ field, but I haven’t obtained any success either.

    Cheers

Viewing 1 replies (of 1 total)
  • Plugin Author Caseproof

    (@caseproof)

    Hi @jiraky90

    That doesn’t sound like a Members-specific issue, but more like a general WordPress REST API issue. It seems that you’re sending JSON data in your request, so my first recommendation would be to set the Content-Type header to application/json. Also, you’re using a PUT request, but the documentation says to use a POST request.

    Kind regards

Viewing 1 replies (of 1 total)
  • The topic ‘User roles update via API’ is closed to new replies.