Forum Discussion
Deleted
Nov 28, 2017How to form the URL for a parameter which is a Collection of items? - Retrieve Messages(mail)
Hello,
I am trying to retrieve a message from my inbox using a GET call.
Messages API has a property "Categories" which is a collection.
https://msdn.microsoft.com/en-us/office/office365/api/complex-types-for-mail-contacts-calendar#MessageResource
While forming the URL for for GET call with filter parameters, how should I represent the collection items such as Categories ?
Eg: https://outlook.office.com/api/v2.0/me/MailFolders/AWI2NgEtNGUwNCWZkNjRkOG05NDI5LTNiYRjNvkF-nB91jOjwAAAgEMAAAA/messages?$filter=Subject eq 'appconrhw6lql3exn8w43x47vi' and (Categories eq 'Inbox') and IsDeliveryReceiptRequested eq true
https://outlook.office.com/api/v2.0/me/MailFolders/AWI2NgEtNGUwNCWZkNjRkOG05NDI5LTNiYRjNvkF-nB91jOjwAAAgEMAAAA/messages?$filter=Subject eq 'appconrhw6lql3exn8w43x47vi' and (Categories eq 'Inbox') and IsDeliveryReceiptRequested eq true
The above URL always returns :
{ "error": { "code": "RequestBroker-ParseUri", "message": "The operand for a binary operator 'Equal' is not a single value. Binary operators require both operands to be single values." } }
How should I form the URL to add the query param for collections such as Catergories ?
NOTE: While creating a message via POST APIs, if the Categories is given as an Array, the message gets created successfully. But not for Retrieve.
This is the same case for other API Objects like Contacts, Calendar, etc too in Office365 - whichever parameter is of type collection.
No Replies