Hey , I'm trying to add people as agents to particular service desk and after resolving bunch of problems with authentication etc i finally stumbled upon
['Invalid request payload. Refer to the REST API documentation and try again.']}
My guess would be that
data = {"accountId": account_id} is somehow wrong and maybe something else needs to be used. Seems that the projectID, roleID and accountId are all printed and correct for e-mail i'm using.
Block of code making the request:
# Make an API request to add the agent to the project
add_url = f'{jira_url}/rest/api/latest/project/{ProjectID}/role/{RoleID}'
headers = {'Content-Type': 'application/json'}
data = {"accountId": account_id}
add_response = requests.post(add_url, auth=auth, headers=headers, data=json.dumps(data))