getOffice365ActivationsUserDetail Graph API returns UnknownTenantId - json

I am trying to get the information about the users that have Activated Office 365 using:
/beta/reports/getOffice365ActivationsUserDetail?$format=text/csv
I am getting an error:
{
"code": "UnknownTenantId",
"message": "We do not recognize this tenant ID {MyTenantID}. Please double-check the tenant ID and try again."
}
The Read.Report.All permission is already assigned, and I am able to get other information from O365 using the Graph API.
Any suggestions how to resolve this issue?

You shouldn't be using the /beta/ release as this report is available in /v1.0/ and returns test/csv by default.
You also need to provide a valid period to the getOffice365ActiveUserDetail endpoint:
Specifies the length of time over which the report is aggregated. The supported values for {period_value} are: D7, D30, D90, and D180. These values follow the format Dn where n represents the number of days over which the report is aggregated.
For example, to get details for users active in past 7 days you would request:
https://graph.microsoft.com/v1.0/reports/getOffice365ActiveUserDetail(period='D7')

Related

Creating an activity alias returns either 404 or 400

I have just created an activity with the name of InventorParams. I would like to add an alias as right now it shows up as: Guasamt.InventorParams+$LATEST in the activities list.
Now when POSTing the following request:
[
"id" => "prod"
]
Laravel will turn this into json. The Authorization header is also present
to https://developer.api.autodesk.com/da/us-east/v3/activities/:id/aliases. It either returns 400 or 404 errors. The 400 error is presented when using a fully qualified activity name. The 404 error is returned on all of the the following activity names:
Guasamt.InventorParams+LATEST (without $);
Guasamt.InventorParams;
InventorParams;
Now I'm wondering what should be the unqualified name of an activity?
When you create an Activity in FDA it gets a version number (since you just created it, it would be 1). This number needs to be used when creating Activity Alias, which is later used in the Work Item.
Your fully qualified name consist of <your_nick_name>.<activity_name>+<activity_version>. Where <your_nick_name> can be your ClientId if nickname was not specified.
Anyway I would recommend to follow the FDA tutorial. Another option on how to get quickly up to speed with FDA is to use the Autodesk Forge Tools addin to VS Code.

Make weather app using openweathermap api to display LAST x Days' Weather(3 hourly basis)

I want to make an app displaying LAST x days' temperature on 3 hourly basis using the openweathermap API only. I went through the available APIs. They either have the predicted forecast of next 5 days or the historical data expecting start and end as parameters which I tried to use then (https://openweathermap.org/history).
So just to check whether I have understood the params correctly or not, I tried fetching(through the address bar):
http://history.openweathermap.org/data/2.5/history/city?id=1275339&type=hour&appid=df78dcfa9580e72b15fdf62d406d34ec&start=1369728000&end=1369789200".
But I got HTTP error 401:
{"cod":401, "message": "Invalid API key. Please see http://openweathermap.org/faq#error401 for more info."}
I fail to understand how should the parameters be entered to get the desired results (last 5 days temperature on 3 hourly basis) and also how do I enter "cnt" (if needed to) such that it gives me 3 hourly data.

Office 365 Rest API - Changing message Id

Is there any scenario in which the Id field on a message could change?
We received a message at today (Thu, 19 Feb 2015 10:29:48 GMT +00:00) with an ID ending in 'MT80AAA='. However when trying to retrieve message details at a later time I get a 404 error with the message:
{ "error" : { "code": "ErrorItemNotFound", "message" : "The specified object was not found in the store." } }
When I do another request to get all messages from that inbox the same message appears however it has another ID ending in 'TwDlAAA='.
Both the message ID and the Attachment ID have been changed at some point from the first time receiving the message and now.
Is this a common occurrence? What could cause this? Or is it a bug?
It's not a bug, it's definitely a common occurrence with Exchange. Entry ID's aren't static, and can change in a number of scenarios. Common ones are moving the item (which is essentially a copy and delete operation, copy gets a new ID since it's a new item), or mailbox move (which may be applicable to your case).
Typically I would advise a strategy of optimistically storing the ID and using it first, since it will usually work. Then I'd recommend storing the record key and search key as a backup, so you could try searching for the item in the event the Id no longer works. However, the REST API doesn't expose these fields! So you'd have to make do with searching for the item based on whatever fields are important to you, which isn't ideal. I'll provide this feedback to our developers.

MailChimp Interested Value in "Group" always false after "subscribing"

I send over proper json formatted code, according to v2 api docs:
lists/subscribe.json
"GROUPINGS":[{"id":removed_id,"name":"grouping_name","groups":["group_name"]}]
I get back information about a member... It does not say they are interested in that group name..
lists/member-info.json
"GROUPINGS":[{"id":removed_id,"name":"grouping_name","form_field":"hidden","groups":
[{"name":"group_name","interested":false},{"name":"other_group_name","interested":false},
{"name":"other_group_name2","interested":false},{"name":"other_group_name3","interested":false}]}]
I do not understand how I can get these users to show up as "subscribed" to a group within my grouping. I have been trying for nearly 5 hours now. I have tried:
making sure the groups: value is an [] array.
trying out making that value a string (which surprisingly did not throw errors)
capitalizing "GROUPINGS" when sending it in merge_vars
not capitalizing "groupings" when sending in merge_vars
using the lists/update-member.json method to update these groups
using the name of my interest group instead of grouping in the grouping array.
using the option replace_interests on both true and false
In conclusion,
I had to email mailchimp a support ticket. Without changing my code at all - it works this morning. Interestingly enough, mailchimp was experiencing many issues yesterday with servers being down and alleged email hackings.
To be clear about which version of my code worked - following the API exactly for v2.
It was an error on mailchimp's end.
{
"id":"MY LIST ID",
"email":{
"email":"THE EMAIL TO SUBSCRIBE"
},
"merge_vars":{
"GROUPINGS":[
{
"id":THE GROUPING ID,
"groups":[
"THE NAME OF MY GROUP"
]
}
]
},
"double_optin":false,
"replace_interests":true,
"apikey":"MY API KEY"
}
Also, in case you are curious, replace_interests is true when the groups you send are supposed to replace existing groups the subscriber is interested in. False indicates that the groups you pass should be added to the interest groups.
If you are updating a member (method: lists/update-member), it may be best to set replace_interests to false just to make sure it does not overwrite your existing interest groups (possibly with blank groups). The default value for it is true, so this could be another place prone to error.

Box API: Get_managed_users returning all users

Using the Box 1.0 REST API, I am trying to work with the functions in SOAP UI.
The API doc for get_managed_users with user_id=12345 (internal id retrieved with get_user_id call correctly) is returning all the users. The docs say that would be the case if you do not specify a user_id value. But my full command is: (Token and API key changed to protect the clueless)
https://www.box.com/api/1.0/rest?user_id=27360&auth_token=blahbalhblah1234&action=get_managed_users&api_key=someKeyYouShouldNotSee
Now I could work with the complete result list, but that won't scale as we get thousands of users into the system.
I can make a call with edit_managed_user, using the same user_id value and the change is reflected in the UI, and in the next get_managed_users call. Thus I do have the correct user_id value, I would so assume.
I tried testuser#gmail.com as the user_id value as well, and get the entire list back. This leads me to believe that somehow I am sending user_id wrong, but I just do not see it.
Any hints? Why, with what seems like a valid user_id value is it acting like it is absent or incorrect?
Most likely you have either called this method with an invalid user_id, or one that is not in your set of managed users. Can you double check that the user comes back in your list of already managed users?