graph api me/messages endpoint doesn't allow start and end DateTime in select list - microsoft-graph-api

I am trying to list down all my meetings with a certain email id. I only want to select few things out of the huge response. Duration is one of the main insight and it won't allow to return the start and end datetime.
URL:
https://graph.microsoft.com/v1.0/me/messages?$select=startDateTime,subject,from,sender,toRecipients&$search="participants:xyz#contoso.com and kind:meetings"
Error I am getting is
"message": "Could not find a property named 'startDateTime' on type 'Microsoft.OutlookServices.Message'
Is this expected?

Are you looking for how to query all meetings ? but your query is for messages. Can you please clarify?
If you are looking for help with messages from specific person along with created data time you can update your query like this -
https://graph.microsoft.com/v1.0/me/messages?$select=createdDateTime,Id,lastModifiedDateTime,from,subject&$filter=from/emailAddress/name eq 'XYZ A'

Related

querying mails without categories not supported

We are trying to use Microsoft graph to query a mailbox and return us all uncategorized mails.
Following the OData spec here: https://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part2-url-conventions/odata-v4.0-errata03-os-part2-url-conventions-complete.html#_Toc453752358
We should be able to do something like this:
$filter=Categories/$count eq 0
But the call returns an operation not supported exception.
Is there another way to query for uncategorized Mail messages?
Querying mails without categories doesn't appear to be supported at this time. Please add a feature request to Microsoft Graph User Voice. I might as well share what I found in case it is useful to someone.
Unfortunately, the following doesn't work:
https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messages?$filter=not categories/any()&$select=categories
https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messages?$filter=categories/$count eq 0
This will return all mail with categories:
https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messages?$filter=categories/any()&$select=categories
This will return all mail of a particular category:
https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messages?$filter=categories/any(x:x eq 'particular category')&$select=categories

Trying to get a list of Teams a user has ownership

Trying to get a list of Teams a specific user has ownership with Graph api.
Any assistance is much appreciated.
This command will provide a list of teams but you need to get the group id first:
https://graph.microsoft.com/beta/groups/{id}/owners
I tried the following but I couldn't get the correct results.
https://graph.microsoft.com/beta/groups?$expand=owners($filter=userprinciplename eq '<>'&$select=id,displayname,userprinciplename)&$filter=resourceProvisioningOptions/Any(x:x eq 'Team')
You can use ownedObjects to get the list of directory objects that are owned by the user. This includes Unified Groups in the groupTypes and output the resourceProvisioningOptions here too.
https://graph.microsoft.com/v1.0/me/ownedObjects
more documentation on that here https://learn.microsoft.com/en-us/graph/api/user-list-ownedobjects?view=graph-rest-1.0&tabs=cs .
Unfortunately it is not supported to use $filter like this. So you'll have to do on your side. So this won't work
https://graph.microsoft.com/v1.0/me/ownedObjects?$filter=resourceProvisioningOptions/Any(x:x eq 'Team')
Your query was incorrect. Please try the below updated query.
https://graph.microsoft.com/beta/groups?$expand=owners($filter=userprinciplename eq 'add your mail id here')&select=id,displayname&$filter=resourceProvisioningOptions/Any(x:x eq 'Team')

Multiple nesting in Falcor query

I am trying to query a multiple nested object with Falcor. I have an user which has beside other the value follower which itself has properties like name.
I want to query the name of the user and the first 10 follower.
My Falcor server side can be seen on GitHub there is my router and resolver.
I query the user with user["KordonDev"]["name", "stars"]. And the follower with user["KordonDev"].follower[0.10]["name", "stars"].
The route for follower is user[{keys:logins}].follower[{integers:indexes}] but this doesn't catch the following query.
I tried to add it as string query.
user["KordonDev"]["name", "stars", "follower[0..10].name"] doesn't work.
The second try was to query with arrays of keys. ["user", "KordonDev", "follower", {"from":0, "to":10}, "name"] but here I don't know how to query the name of the user.
As far as I know and looking on the path parser. There is no way to do nested queries.
What you want to do is batch the query and do two queries.
user["KordonDev"]["name", "stars"]
user["KordonDev"]["follower"][0..10].name
It seems that falcor does not support this, there is even a somewhat old issue discussing how people trying to do nested queries.
to the point about the current syntax leading people to try this:
['lolomo', 0, 0, ['summary', ['item', 'summary']]]
I can see folks trying to do the same thing with the new syntax:
"lolomo[0][0]['summary', 'item.summary']"
As soon as they know they can do:
"lolomo[0][0]['summary', 'evidence']"
So it seems deep nested queries is not a functionality.

Magento SalesOrderList... is there a ligth weight version of this, or a way to trim down the returned value

I am attempting to get all the orders from a magento instance. Once a day we grab all the orders.. (sometimes a few thousand)
Extra stuff that's more why I ask:
I'm using ruby-on-rails to grab the orders. This involves sending the soap call to the magento instance. It's easy as.
Once I have the response, I convert it into a Hash (a tree) and then pick out the increment id's of the orders and proceed to call getOrder with the increment id.
I have two problems with what's going on now, one operational, and one religious.
Grabbing the XML response to the list request takes really really long and when you tack on the work involved in converting the XML to a hash, I'm seeing a really slow processes.
The religious bit is that I just want the increment_ids so why do I have to pay for the processing/bandwidth to support a hugely bloated response.
Ok so the question...
Is there a way to set the response returned from Magento, to include only specific fields? Only the updated_at and the increment_id for instance.
If not, is there another call I'm not aware of, that can get just the increment_ids and date?
Edit
Below is an example of what I'm looking for from magento but it's for ebay. I send this xml up to ebay, and get back a really really specific bit of info about the product. It works for orders and such too. I can say "only this" and get just that. I want the same from Magento
<GetItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<SKU>b123-332</SKU><OutputSelector>ItemId</OutputSelector>
</GetItemRequest>
I've created a rubygem that gives you your salesOrderList response in the form of a hash, and you can do what you want with the orders after you've received them back (i.e. select the fields you want including increment_id). Just run
gem install magento_api_wrapper
To do what you want to do, you would do something like this:
api = MagentoApiWrapper::Sales.new(magento_url: "yourmagentostore.com/index.php", magento_username: "soap_api_username", magento_api_key: "userkey123")
orders = api.order_list(simple_filters: [{key: "status" value: "complete"}])
orders.map {|o| [o.increment_id, o.items.first.sku] }
Rough guess, but you get the idea. You would get the array of hashes back and you can do what you want with them after that. Good luck!

RESTful nested conventional routing

I have the model:
User -1---n- Transaction(amount,description, date)
User -1---n- TransactionImport -1---n- TransactonImportField(name,value)
(personal expense tracking app).
What I want to achieve is this:
User opens URL and pastes the CSV with the list of transactions.
User submits it.
System extracts data from CSV into TransactionImport (row) + TransactionImportField (cell).
User can choose which column means what (amount, description, date) from the imported data in TransactionImport(Field).
User click save and the system transfers TransactionImport into the Transaction.
What I can't seem to get right is the fact that step 3 creates multiple records of TransactionImport (and related TransactionImportField).
So doing POST /transaction_imports?csv=abcd is expected to produce one record if we would be RESTful. But the code is supposed to be something like this:
# TransactionImportsController
def create
result = TransactionImports.parse(params[:csv])
flash[:notice] = result.message
redirect_to transaction_imports_path
end
I am probably approaching the task from a wrong angle as I feel that implementation doesn't fit in tp the inherited_resources.
Could you please advise what would be the most conventional way of implementing this?
Thanks,
Dmytrii.
REST/HTTP has no expectation that doing POST will only create one record. That maybe the default rails behaviour, but you should not constrain your design because of that.

Resources