Graph API: reportDate attribute not available in getEmailActivityCounts - microsoft-graph-api

I have been using the getEmailActivityCounts(Beta version) in graph api for the past 3 years.
But recently facing issues on retrieving the reportDate in the graph data when JSON export type is used. Without reportDate, we couldn't map on which date the metrics count had happened.
Any help would be appreciated.
Request : https://graph.microsoft.com/beta/reports/getEmailActivityCounts(period='D180')?$format=application/json
Response : {
"reportRefreshDate": "2022-01-19",
"send": 3,
"receive": 14,
"read": null,
"meetingCreated": 0,
"meetingInteracted": null,
"reportPeriod": "180"
},
{
"reportRefreshDate": "2022-01-19",
"send": 1,
"receive": 1,
"read": null,
"meetingCreated": 0,
"meetingInteracted": null,
"reportPeriod": "180"
}
Thanks in Advance,
Maerona Wynn

Related

Getting labels from Planner with Microsoft Graph API

Is it possible to get the labels and priority from a Microsoft Planner task with the Microsoft Graph API?
See screenshot below to have an idea:
Using next endpoint: https://graph.microsoft.com/v1.0/planner/plans/<plan-id>/tasks I get next data:
{
"#odata.etag": "W/\"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBBWCc=\"",
"planId": "r4g58er4grregrg7848",
"bucketId": "64g8df54hhktohk487",
"title": "Title of a task",
"orderHint": "545457845775LM",
"assigneePriority": "",
"percentComplete": 0,
"startDateTime": null,
"createdDateTime": "2022-01-07T13:58:14.5355148Z",
"dueDateTime": null,
"hasDescription": true,
"previewType": "description",
"completedDateTime": null,
"completedBy": null,
"referenceCount": 0,
"checklistItemCount": 1,
"activeChecklistItemCount": 3,
"conversationThreadId": null,
"id": "grejgopreg645647",
"createdBy": {
"user": {
"displayName": null,
"id": "74463467-d67d-4512-9086-c9e279dde6ae"
}
},
"appliedCategories": {
"category5": true
},
"assignments": {}
}
I've next comments on this JSON:
What is assigneePriority? When a priority is filled in, will always be an empty string.
What is appliedCategories? Can these categories being used for the labels? But what is category5?
While it's not the most straightforward answer, you can figure out what labels are assigned to a task. You'll need both the planid and taskid to get it.
The appliedCategories are actually the labels applied to a particular task. Their identifieres are just category##. To find the corresponding label name, you'll need to make a call to get the plan details.
Graph API URL: https://graph.microsoft.com/beta/planner/plans/{planid}/details
This will return a JSON object containing each of the categories and their descriptions. You can find more info here about the plannerPlanDetails type. Note: the v1.0 graph endpoint only returns the first 6 categories, while the beta version will return 25.
"categoryDescriptions": {
"category1": "Some name",
"category2": "Some other name",
"category3": "Another",
"category4": null,
...
"category25": null
}
Within the task details, appliedCategories object will contain any labels assigned to that task.
For the priority, you will find a priority property on the task object when using the beta version of the endpoint. It's an integer, but from my testing, the following are the corresponding priority titles
9 - Low
5 - Important
3 - Medium
1 - Urgent
You'll have to do some correlation on your own to match them up, but this is how you can get the information you're looking for.

Is HTTParty clearing a variable in responses

I found a weird case using httparty, in one of the API I do receive expected JSON object expect one key which has an empty value. This key's name is PaymentToken. Wondering if this is some configuration to hide / clear value of variables with Token / Payment in the name?
I was trying to reproduce the same issue on Postman, with exactly the same request and receiving the same structure of object with the same keys values + PaymentToken value is there.
Postman:
{
"ActionType": "RES",
"IsActive": false,
"BookingCode": null,
"PaymentToken": "/ON9lFhfw2VYR9BiIep/peByEOtPSmtI7t+vxbcHFtsJctezBgS3mwKcVxSNCzZqKHXi4qPh8pMPGRMJOU6+1ZhSQ=",
"Customer": null,
"Mode": 0
}
HTTParty:
{
"ActionType": "RES",
"IsActive": false,
"BookingCode": null,
"PaymentToken": "",
"Customer": null,
"Mode": 0
}
Has anyone experienced the same issue?

Fitbit API: Not returning the steps for a time range on a date

I am using the Fitbit endpoint in iOS app to fetch the steps as below:
https://api.fitbit.com/1/user/-/activities/steps/date/2019-07-01/1d/15min/time/12:00/12:15.json
This is to fetch the steps on a date for some time interval but it returns the array of some activities like Yoga, Walking, Winter activities etc. but not returning the steps count for the time interval. Can anyone please tell me how can I fetch the data for the same?
It returns the result as:
"categories": [
{
"activities": [
{
"accessLevel": "PUBLIC",
"activityLevels": [
{
"id": 3016,
"maxSpeedMPH": -1,
"mets": 8.5,
"minSpeedMPH": -1,
"name": "6 - 8 inch step"
},
{
"id": 3017,
"maxSpeedMPH": -1,
"mets": 10,
"minSpeedMPH": -1,
"name": "10 - 12 inch step"
}
],
"hasSpeed": false,
"id": 90004,
"name": "Aerobic step"
},
{
"accessLevel": "PUBLIC",
"hasSpeed": false,
"id": 3015,
"mets": 6.5,
"name": "Aerobic, general"
},
I found the reason behind Fitbit returning such data. It is just because the intraday data fetch requires the review from Fitbit or we can use the "personal" application type to get the data.

How to fetch latest Apple podcast date with Google Sheets?

I have a spreadsheet with Apple Podcasts URLs.
What I want to do is to get newest podcast date.
So basically content of "sort-value" tag of first grid cell element:
<td role="gridcell" sort-value="2017/12/22" class="release-date">
Can it be done with IMPORTHTML function?
Example podcast URL: https://itunes.apple.com/us/podcast/modern-sewciety-podcast/id742393907
How about this?
=INDEX(IMPORTXML(A1, "//td[#class='release-date']//span[#class='text']"), 1)
https://itunes.apple.com/us/podcast/modern-sewciety-podcast/id742393907 is in a cell "A1".
XPath is //td[#class='release-date']//span[#class='text'].
The top value is retrieved using INDEX.
Edit :
About the reason that the value of cell becomes 43091, It is considered that it is due to the cell format. In order to modify this situation, please try the following 2 patterns.
Modify the format for the cell with 43091.
On the spreadsheet, please select "Format" -> "Number" -> "Date"
If you want to other date format, please customize it.
Use this XPath.
=INDEX(IMPORTXML(A1, "//td[#class='release-date']/#sort-value"), 1)
In this XPath, the format of date is different from //td[#class='release-date']//span[#class='text'].
I can't give the specifics for Google Sheets, but I can tell you that you can more quickly get this data from using the Apple Media Lookup API.
Using the ID number, 742393907, make a call to this API endpoint: https://itunes.apple.com/lookup?id=742393907
That will return the following JSON:
{
"resultCount": 1,
"results": [
{
"wrapperType": "track",
"kind": "podcast",
"collectionId": 742393907,
"trackId": 742393907,
"artistName": "Stephanie Kendron: Modern Creative blogger and podcaster",
"collectionName": "Modern Sewciety Podcast",
"trackName": "Modern Sewciety Podcast",
"collectionCensoredName": "Modern Sewciety Podcast",
"trackCensoredName": "Modern Sewciety Podcast",
"collectionViewUrl": "https://podcasts.apple.com/us/podcast/modern-sewciety-podcast/id742393907?uo=4",
"feedUrl": "http://www.modernsewciety.com/feed/podcast",
"trackViewUrl": "https://podcasts.apple.com/us/podcast/modern-sewciety-podcast/id742393907?uo=4",
"artworkUrl30": "https://is5-ssl.mzstatic.com/image/thumb/Podcasts113/v4/db/f3/1d/dbf31d7f-3fae-84a6-c4b6-91adebc2394d/mza_4725542195606703711.jpg/30x30bb.jpg",
"artworkUrl60": "https://is5-ssl.mzstatic.com/image/thumb/Podcasts113/v4/db/f3/1d/dbf31d7f-3fae-84a6-c4b6-91adebc2394d/mza_4725542195606703711.jpg/60x60bb.jpg",
"artworkUrl100": "https://is5-ssl.mzstatic.com/image/thumb/Podcasts113/v4/db/f3/1d/dbf31d7f-3fae-84a6-c4b6-91adebc2394d/mza_4725542195606703711.jpg/100x100bb.jpg",
"collectionPrice": 0.00,
"trackPrice": 0.00,
"trackRentalPrice": 0,
"collectionHdPrice": 0,
"trackHdPrice": 0,
"trackHdRentalPrice": 0,
"releaseDate": "2020-03-08T16:39:00Z",
"collectionExplicitness": "cleaned",
"trackExplicitness": "cleaned",
"trackCount": 50,
"country": "USA",
"currency": "USD",
"primaryGenreName": "Design",
"contentAdvisoryRating": "Clean",
"artworkUrl600": "https://is5-ssl.mzstatic.com/image/thumb/Podcasts113/v4/db/f3/1d/dbf31d7f-3fae-84a6-c4b6-91adebc2394d/mza_4725542195606703711.jpg/600x600bb.jpg",
"genreIds": [
"1402",
"26",
"1301"
],
"genres": [
"Design",
"Podcasts",
"Arts"
]
}
]
}
You would want the releaseDate field, which is pulled from the podcast's latest episode.

Full text search in Neo4j, is it possible to get the score?

I am trying to use cypher to perform the query in full text index. It returns results, but they are not ranked. Is there a way to get the match score?
start recordEmployee=node:fidx_RecordEmployee("F01:Leela* OR F01:Ph*") return recordEmployee.F01
Returns this, and I cannot find match score:
{
"results": [
{
"columns": [
"recordEmployee.F01"
],
"data": [
{
"row": [
"Philip"
],
"graph": {
"nodes": [],
"relationships": []
}
},
{
"row": [
"Leela"
],
"graph": {
"nodes": [],
"relationships": []
}
}
],
"stats": {
"contains_updates": false,
"nodes_created": 0,
"nodes_deleted": 0,
"properties_set": 0,
"relationships_created": 0,
"relationship_deleted": 0,
"labels_added": 0,
"labels_removed": 0,
"indexes_added": 0,
"indexes_removed": 0,
"constraints_added": 0,
"constraints_removed": 0
}
}
],
"errors": []
}
It's not possible in Cypher yet, but with stored procedures in Neo4j 3.0 it will be again.
Until then if you really need the score you can use the REST endpoint.
http://neo4j.com/docs/stable/rest-api-indexes.html#rest-api-find-node-by-query
Getting the results with a predefined ordering requires adding the
request parameter
?order=<ordering>
where <ordering> is one of index, relevance or score. In this case an
additional field will be added to each result, named score, that holds
the float value that is the score reported by the query result.

Resources