How to get details of high importance mails via Graph API - outlook

I am trying to get list of mails that are with high importance via Graph API.
For that, I am using below query:
https://graph.microsoft.com/v1.0/me/messages?$select=importance,subject
But that's not working out as it is giving all :(
I found that I have to add filter in the query and tried like below:
https://graph.microsoft.com/v1.0/me/messages?$select=importance,subject &
$filter=importance eq high
But I'm getting error like below:
{
"error": {
"code": "RequestBroker--ParseUri",
"message": "Could not find a property named 'high' on type 'Microsoft.OutlookServices.Message'.",
"innerError": {
"date": "2022-06-10T04:29:52",
"request-id": "",
"client-request-id": ""
}
}
}
I think I'm using query in a wrong way. Can anyone suggest me what's wrong?

Use single quotation mark '' for the specific name of the importance
https://graph.microsoft.com/v1.0/me/messages?$select=importance,subject&$filter=importance eq 'high'

Related

Microsoft Teams Chat Messages Order By Query Parameter

I tried to retrieve my Ms-Teams Chat(Direct/Group) messages using Ms-Graph API along with the Query Parameter "OrderBy" to sort the response using "createdDateTime", but I faced this error.
{
"error": {
"code": "",
"message": "The query specified in the URI is not valid. Query option 'OrderBy' is not allowed. To allow it, set the 'AllowedQueryOptions' property on EnableQueryAttribute or QueryValidationSettings.",
"innerError": {
"message": "Query option 'OrderBy' is not allowed. To allow it, set the 'AllowedQueryOptions' property on EnableQueryAttribute or QueryValidationSettings.",
"date": "2020-08-20T07:28:36",
}
}
}
Is there any other way to retrieve my Ms-Teams Chat(Direct/Group) Message Response in an Ascending order with respect to the "createdDateTime"?

" Mandatory fields missing" error while using ServiceNow API

I am using ServiceNow API to create a Catalog request.
URL:
https://<ServiceNow>/api/sn_sc/servicecatalog/items/6e2cc01d4f51ce08d4fb2b8ca310c7a6/order_now
BODY:
{
"sysparm_quantity":"1",
"variables": {
"requestor":"6e2cc01d4f51ce08d4fb2b8ca310c7a6",
"Requested For":"6e2cc01d4f51ce08d4fb2b8ca310c7a6",
"Group Name":"01304c6ddbef9f0827673672399619c4",
"Group Domain":"FG",
"Rationale for Approver Only (this will not be viewed by fulfillment team)":"testing"
}
}
I got this error :
{
"error": {
"detail": "",
"message": "Mandatory Variables are required"
},
"status": "failure"
}
How can I know what are the mandatory fields?
I figured out that this ID will be used to get the mandatory variables.
https://<ServiceNow>/api/sn_sc/servicecatalog/items/<Item_ID>/variables
However, I don't find it on the service now official documentation.
It should be a scripted API.
Check the elements tab in your browser (F12 for Chrome) while you have the form opened and search for "variable_tab" there you will see all expected variables. You can figure out how the mandatory ones are calle by looking at the form.

Mailchimp API 2.0 lists/subscribe responding with error 250 List_MergeFieldRequired MMERGE4 is required

I'm attempting to use the lists/subscribe Mailchimp API 2.0 endpoint to subscribe an email to a list, but I keep getting a puzzling error. My request looks like:
{
"apikey":"myapikey-us5",
"id":"listid",
"email":{"email":"my#email.com"},
"double_optin":false,
"send_welcome":true
}
I'm sending this to https://us5.api.mailchimp.com/2.0/lists/subscribe.json and getting this response:
{
"status": "error",
"code": 250,
"name": "List_MergeFieldRequired",
"error": "MMERGE4 must be provided - Please enter a value"
}
And if I specify "merge_vars": {} I still get the same error. What am I missing here?
It means you need to provide a value for MMERGE4 merge field. How you do this depends on what type of merge field MMERGE4 is, but It would be like this:
{
"apikey":"myapikey-us5",
"id":"listid",
"email":{"email":"my#email.com"},
"double_optin":false,
"send_welcome":true,
"merge_vars": {
"MMERGE4": "something"
}
}
But you should look and see what type of data that is, otherwise you might cause issues for whomever set that up as a required field.

Google Genomics API Callsets Search "Unknown field name: datasetIds"

I've been using the Google Genomics API for about a day now. I've successfully called many of the APIs like Datasets.list, Datasets.get, and even Readsets.search but I'm having a problem with the Callsets.search.
I'm making POST request to:
POST https://www.googleapis.com/genomics/v1beta/callsets/search?key=MY_KEY_HERE
And my request body is:
{
"datasetIds" : [
"376902546192"
]
}
But the response I'm getting back is:
{
"error" : {
"errors": [
{
"domain": "global",
"reason": "invalid",
"message": "Unknown field name: datasetIds",
"locationType": "other",
"location": ""
}
],
"code": 400,
"message": "Unknown field name: datasetIds"
}
}
According to the documentation: https://developers.google.com/genomics/v1beta/reference/callsets/search datasetIds is a perfectly valid parameter.
The crazy thing that's perplexing me is this identical request works just fine on the readsets/search endpoint but not the callsets/search endpoint? I'm almost wondering if it's a bug in the API. Can anyone help?
Received this from Google:
The variants and callsets APIs just went
through some breaking changes so that they'll be compliant with GA4GH
v0.5 when they go fully public.
All breaking changes should be done now - and I'll try to get all the
docs and code samples updated today or tomorrow.
Until then, you can see the real parameters in the API explorer (it
can't lie :) - in this case, the datasetId field has now changed to
"variantSetIds" (still using that same value, just a rename)
I just tested it, and it works. Below are the results:
$ java -jar target/genomics-tools-client-java-v1beta.jar searchcallsets --dataset_id 376902546192
Getting call sets from: 1000 Genomes
{"created":"1410541777431","id":"376902546192-0","name":"HG00345","sampleId":"HG00345","variantSetIds":["376902546192"]}
{"created":"1410541777431","id":"376902546192-1","name":"HG00369","sampleId":"HG00369","variantSetIds":["376902546192"]}
{"created":"1410541777431","id":"376902546192-2","name":"HG01085","sampleId":"HG01085","variantSetIds":["376902546192"]}
{"created":"1410541777431","id":"376902546192-3","name":"HG01107","sampleId":"HG01107","variantSetIds":["376902546192"]}
{"created":"1410541777431","id":"376902546192-4","name":"NA12347","sampleId":"NA12347","variantSetIds":["376902546192"]}
{"created":"1410541777431","id":"376902546192-5","name":"NA18579","sampleId":"NA18579","variantSetIds":["376902546192"]}
{"created":"1410541777431","id":"376902546192-6","name":"HG00372","sampleId":"HG00372","variantSetIds":["376902546192"]}
{"created":"1410541777431","id":"376902546192-7","name":"HG01134","sampleId":"HG01134","variantSetIds":["376902546192"]}
{"created":"1410541777431","id":"376902546192-8","name":"NA18532","sampleId":"NA18532","variantSetIds":["376902546192"]}
{"created":"1410541777431","id":"376902546192-9","name":"NA18597","sampleId":"NA18597","variantSetIds":["376902546192"]}
Hope it helps,
Paul

Non unique query with Freebase MQL read google api

It seems I am only able to do unique queries (i.e. including an entity id in the query) with the new freebase MQL read api:
The following searches on id and type:
https://www.googleapis.com/freebase/v1/mqlread?query={"name":null,"id":"/en/bob_dylan","type":"/people/person"}
and successfully returns:
{
"result": {
"type": "/people/person",
"id": "/en/bob_dylan",
"name": "Bob Dylan"
}
}
The following searches with type only:
https://www.googleapis.com/freebase/v1/mqlread?query={"name":null,"type":"/people/person"}
or
https://www.googleapis.com/freebase/v1/mqlread?query={"name":[],"type":"/people/person"}
and returns the following error:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "badRequest",
"message": "Unique query may have at most one result. Got 100"
}
],
"code": 400,
"message": "Unique query may have at most one result. Got 100"
}
}
I expected it to return a list of people's names
You have to wrap your query in [ ], as in the following example:
https://www.googleapis.com/freebase/v1/mqlread?query=[{"name":[],"type":"/people/person"}]
I too faced a similar problem recently. The best way to make sure you get a single result set is to use "limit:1" parameter in your mql query.
for example:
https://www.googleapis.com/freebase/v1/mqlread?query={"type":[],"name":"india","limit":1}

Resources