When attempting to get hostedContents content stream using $value, NotFound error is returned

David M 1 Reputation point
2022-01-24T17:23:50.297+00:00

When I attempt to get the content stream for a specified hostedContent using the $value filter, Graph returns NotFound.

Process...

  1. We have the team ID
  2. We have the Channel ID
  3. We have the message ID
  4. We have the hostedContent ID
  5. We make the call to get the hostedContent stream:

teams/<teamid>/channels/<channelid>/messages/<messageid>/hostedcontents/<hostedContentId>/$value
It returns NotFound (see below)

However, if you remove the $value filter, we get the hostedContent object with the hostedContent id.

NOTE:

  1. For the vast majority of our calls, the $value filter works as expected, however, there are a handful of tenants where this fails.
  2. This is done using the graph SDK but we can repro using graph explorer

Expected:
I would expect to get the content stream even if it is empty.

Example 1:
{
"error": {
"code": "NotFound",
"message": "Not Found",
"innerError": {
"date": "2022-01-24T15:48:00",
"request-id": "81ee442f-01fb-4c94-a873-f8fb7738e359",
"client-request-id": "4bdc876a-e192-41ae-925b-1cd7f301654a"
}
}
}

Example 2:
{
"error": {
"code": "NotFound",
"message": "Not Found",
"innerError": {
"date": "2022-01-24T18:42:49",
"request-id": "949b994e-da7d-40d8-b0d8-875336f1e941",
"client-request-id": "949b994e-da7d-40d8-b0d8-875336f1e941"
}
}
}

We are trying to mitigate any issues where graph returns us (un)expected errors.
What is the underlying condition that gets the content into this state?

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,103 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,620 questions
{count} votes

1 answer

Sort by: Most helpful
  1. David M 1 Reputation point
    2022-02-01T15:55:25.11+00:00

    After some investigation, it appears that it is a timing issue...

    Repro steps...

    1. Create a channel message
    2. Add a reply with hostedContent
    3. Deleted that reply
    4. Immediately attempt to get the hostedContent stream

    Results:
    This is hit or miss as the timing is difficult to pin down.
    That said, we were able to get NotFound several times following these steps.

    0 comments No comments