/api/user/v1/accounts/replace_usernames/

I am trying to see if I can use the API call to replace usernames via Postman and my local Nutmeg Environment, running with Tutor.

I was told in the OpenEdx slack channel that calling this specific API: /api/user/v1/accounts/replace_usernames/, would only work if called by a user with the username: USERNAME_REPLACEMENT_WORKER. I made a new superuser with that username and set them as a user on the django application and obtained a JWT with that user and then verified that the user was the one making API calls by requesting /api/user/v1/me to retrieve the username.

I am still receiving the error of: "detail": "Authentication credentials were not provided." when trying to call /api/user/v1/accounts/replace_usernames/. I am passing a JSON format object in the body which matches the schema mentioned in the API docs for this call. What else could I be missing?

@boonehm that’s a bit misleading I think because USERNAME_REPLACEMENT_WORKER is the name of setting not the actual name of the user. The default value for this username is actually 'REPLACE WITH VALID USERNAME` so you’ll probably want to update that value in your local settings overrides.

It also seems like maybe they way you’re making the rest call might not be correct, it looks like this endpoint only accepts JwtAuthentication which means you’ll need to pass the JWT for that user as the value of the Authorization header.

See the example here for more details: