Hi @SKate Thanks for reaching out. From the description I understand that you were trying to get a shared access token for an user using a below request url
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/token?api-version=2021-08-01
Get the user id by using the below rest api call
https://learn.microsoft.com/en-us/rest/api/apimanagement/current-ga/user/list-by-service?tabs=HTTP
API version : you can use latest api version (api-version=2021-08-01)
you need to pass the Bearer token in Authorization header and payload as below
Body:
{
"properties": {
"keyType": "primary",
"expiry": "2022-09-21T00:44:24.2845269Z"
}
}
please refer the below sample request:
let me know incase of further queries, I would be happy to assist you.
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.