I am trying to create a new registration for the virtual event with Graph API, but it returns 401, The steps I am performing are:
- Create a virtual event (webinar)
- Create a presenter
- Publish the event
Up to this point, everything works fine, but when I try to create a registration for the event, it returns 401, I already have added the delegated permission VirtualEvent.ReadWrite
and app permission VirtualEventRegistration-Anon.ReadWrite.All
and the access token does have these permissions.
scopes which I am passing to generate the access token are as below
offline_access https://graph.microsoft.com/.default
This is the request
curl --location 'https://graph.microsoft.com/v1.0/solutions/virtualEvents/webinars/{webinarId}/registrations' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"firstName":"John",
"lastName":"Doe",
"email": "john.doe@example.com"
"preferredTimezone":"Pacific Standard Time",
"preferredLanguage":"en-us",
}'
and this is the response I receive
{
"error": {
"code": "Unauthorized",
"message": "Unauthorized",
"innerError": {
"date": "2025-02-26T10:08:15",
"request-id": "cb5f9d23-efdd-4bf2-8b41-8139190a5c22",
"client-request-id": "cb5f9d23-efdd-4bf2-8b41-8139190a5c22"
}
}
}