Share via

Bad request error, while creating teams subscription

Wocademy We-Ace 0 Reputation points
2026-03-05T13:36:31.1066667+00:00

Hi,

While creating subscription using MS Graph API. I'm getting 'Bad Request | 400' error.

Here is my request body

{
  "changeType": "updated",
  "notificationUrl": "[Moderator note: personal info removed]",
  "resource": "communications/onlineMeetings(joinWebUrl='[Moderator note: personal info removed]')/meetingCallEvents",
  "expirationDateTime": "2026-03-07T12:33:49.756Z",
  "clientState": "WE_ACE_TEAMS_ATTENDANCE_STATE"
}

and in response I'm getting

Graph subscription creation failed (HTTP 400): Bad Request - Error in query syntax.. Resource: communications/onlineMeetings(joinWebUrl='[Moderator note: personal info removed]')/meetingCallEvents. Graph error body: 
{
  "error": {
    "code": "BadRequest",
    "message": "Bad Request - Error in query syntax.",
    "innerError": {
      "date": "2026-03-05T12:33:47",
      "request-id": "[Moderator note: personal info removed]",
      "client-request-id": "[Moderator note: personal info removed]"
    }
  }
}

as a response.

Please let me know what I'm missing, or wrong parameters passed by me.

Microsoft Teams | Development
Microsoft Teams | Development

Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs

0 comments No comments

3 answers

Sort by: Most helpful
  1. Kudos-Ng 15,050 Reputation points Microsoft External Staff Moderator
    2026-03-05T14:22:34.09+00:00

    Hi Wocademy We-Ace,

    Thank you for posting your question in the Microsoft Q&A forum. 

    Please note that our forum is a public platform, and we will modify your question to hide your personal information in the description. Kindly ensure that you hide any personal or organizational information the next time you post an error or other details to protect personal data.

    Based on the official doc for Teams meeting call event change notifications, the resource path is supported as: communications/onlineMeetings(joinWebUrl='{joinWebUrl}')/meetingCallEvents. The key requirement is that joinWebUrl must be the fully URL‑encoded value of the entire Teams join link (including https://, path, and the ?context=... query string). In your payload, the join URL is only partially encoded (the 19%3ameeting... part), but the rest of the URL still contains reserved characters like /, ?, = which causes Microsoft Graph to fail parsing the OData key and return “Bad Request: Error in query syntax.”

    Please try taking the original join link from Teams and run a single full encoding pass (e.g., encodeURIComponent(rawJoinUrl)), then use that encoded string inside joinWebUrl='...'. The encoded value should look like the doc example starting with https%3A%2F%2Fteams.microsoft.com%2F...%3Fcontext%3D%257b...%257d.

    Also, if you need participant join/leave signals, consider rich notifications (includeResourceData, encryption certificate fields) as recommended in the same article.


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

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

  2. Wocademy We-Ace 0 Reputation points
    2026-03-05T13:43:24.02+00:00

    I've updated the request body to

    {
      "changeType": "updated",
      "notificationUrl": "[Moderator note: personal info removed]",
      "resource": "communications/onlineMeetings(joinWebUrl='[Moderator note: personal info removed]')/meetingCallEvents",
      "expirationDateTime": "2026-03-07T13:40:02.223Z",
      "clientState": "ATTENDANCE_STATE"
    }
    

    But response is still same.

    0 comments No comments

  3. Q&A Assist
    2026-03-05T13:36:44.1466667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The error is caused by an invalid resource string for the subscription.

    For online meeting-related change notifications, the resource must match one of the supported patterns listed for call/meeting resources. In the provided context, valid examples for call/meeting–related subscriptions include:

    • communications/callRecords
    • communications/onlineMeetings/getAllRecordings
    • communications/onlineMeetings/{onlineMeetingId}/recordings
    • users/{userId}/onlineMeetings/getAllRecordings
    • communications/onlineMeetings/getAllTranscripts
    • communications/onlineMeetings/{onlineMeetingId}/transcripts
    • users/{userId}/onlineMeetings/getAllTranscripts

    The resource used in the request:

    communications/onlineMeetings(joinWebUrl='...')/meetingCallEvents
    

    is not one of the supported resource paths and contains an OData-style filter with a URL argument, which is what triggers the Bad Request - Error in query syntax error.

    To fix this:

    1. Use a supported resource value for the type of data that needs to be monitored (for example, recordings or transcripts), following the documented patterns above.
    2. Do not embed the joinWebUrl as an OData function argument in the resource string unless there is explicit documentation showing that pattern is supported for subscriptions.
    3. Ensure the rest of the subscription payload follows the documented requirements (valid changeType, notificationUrl that passes validation, and a supported expirationDateTime for the chosen resource type). Note that for some Teams resources, if expirationDateTime is more than 1 hour in the future, a lifecycleNotificationUrl is required.

    Once the resource is changed to a documented, supported path, the 400 error from query syntax should be resolved.


    References:

Your answer

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