Creating a registration in virtual event returns 401 Unauthorized

Monica Wittwer 0 Reputation points
2025-02-26T10:43:39.5+00:00

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"
        }
    }
}
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. CarlZhao-MSFT 46,376 Reputation points
    2025-02-27T07:08:31.4033333+00:00

    Hi @Monica Wittwer

    If you are registering anonymous users for the webinar, then make sure you are using application permissions (client credentials flow).

    User's image

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    1 person found this answer helpful.
    0 comments No comments

  2. Akhil Nasalwai - MSFT 1,685 Reputation points Microsoft External Staff
    2025-02-26T17:28:23.5633333+00:00

    Hello Monica Wittwer,

    Thank you for reaching out to Microsoft support!

    The 401 error typically indicates the access token is either missing, invalid or expired.

    Please ensure that the access token you are using is valid and not expired. You can decode the token using a tool like jwt.ms or jwt.io

    Ensure that the Authorization header in your request is correctly formatted and includes the word Bearer followed by a space and then access token.

    Also double check the webinarId is properly replaced with the actual ID of the webinar and the endpoint is used as per the documentation.

    Above steps might help resolve the issue.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.