2

I am trying to filter by conversationId to get messages and replies for mail, but I am getting an error each time:

Unexpected error value: 
{
  statusCode: 400, 
  code: "BadRequest",
  message: "Invalid filter clause"

Example code:

let response = 
  await client.api(`/me/messages?$filter=conversationId eq '${conversationId}'`)
  .get();

The request path outputs like this:

/me/messages?$filter=conversationId eq 'AAQkADJkZTNiN2ZlLTg2M2QtNGZjMC1hNDUxLTdlNjgzZDVjZDljMAAQAKVNpsZfVhlEtPFltSQuNJ8='

When trying the exact same path in Graph Explorer there is no issue at all.

Has it something to do with the spaces? Should I add %20?

Marc LaFleur
  • 31,987
  • 4
  • 37
  • 63
vemund
  • 1,667
  • 4
  • 29
  • 43

1 Answers1

5

Solved it by using this instead from the documentation:

.filter(`conversationId eq '${id}'`)
vemund
  • 1,667
  • 4
  • 29
  • 43