I am retrieving a list of users via the v1/orgs/{org_id}/users/search API.
From that list I extract the accountId and with that call the API
"https://api.atlassian.com/users/"+accountId+")}/manage/profile".
And I get the following answer:
{ "context": { "message": "Request validation failed: Parameter (accountId) does not match required pattern: ^[a-zA-Z0-9_|:-]{1,128}$", "paramName": "accountId", "path": "paths->/users/{accountId}/manage/profile->get->parameters->0" }, "errorDetail": { "message": "Request validation failed: Parameter (accountId) does not match required pattern: ^[a-zA-Z0-9_|:-]{1,128}$", "paramName": "accountId", "path": "paths->/users/{accountId}/manage/profile->get->parameters->0" }, "errorKey": "bad-request-format", "key": "badRequestFormat" }
How can the accountId retrieved via API not be correct?
Hi, @Sylvie R_
Welcome to Atlassian Community
Looking at your url, I think, it's the reason. You included ")} in it.
This is, for example, my script in python, which I use to work with users data
def get_profile(account_id):
url = f"https://api.atlassian.com/users/{account_id}/manage/profile"
response = requests.get(url, headers=admin_headers)
if response.status_code == 200:
return response.json()
else:
pass
Also pay attention, that you need to check, that user "accountType" == "atlassian".
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.