How do i get meeting/appointmens for more than one resource (mailbox) with EWS java api? - exchangewebservices

I have general question regarding using Exchange Web Service.
I am using ews-java-api
https://github.com/OfficeDev/ews-java-api
and also tried using JEC - Java exhange connector.
http://elich11.freeshell.org/index.html
If a company have 100 to 500 rooms our goal is to get a total list of appointments/meetings for all of these rooms at once as fast as possible.
Using this api what is the best solution for this issue that uses the least time to get a total list of appointments from a list of already known room addresses.
List attendees = new ArrayList();
attendees.add("room1#domain.com");
attendees.add("room2#domain.com");
attendees.add("room4#domain.com");
attendees.add("User1#domain.com");
attendees.add("User2#domain.com");
attendees.add("Room5#domain.com");
attendees.add("Room6#domain.com");
attendees.add("room10#domain.com");
attendees.add("room11#domain.com");
attendees.add("room12#domain.com");
attendees.add("room13#domain.com");
attendees.add("room14#domain.com");
attendees.add("room15#domain.com");
attendees.add("room16#domain.com");
I tried running through a list of email adresses in an array using impersonation for each mailbox to gain acces to the meetings. I have also tried to grant delegation to each mailbox for one specific user, so i dont have to impersonate each mailbox for the user this user to get the appointments.
My problem is with the number of rooms companies can have, both of these methods i slow because the number of webservice calls increases with the amount of mailboxes.
Is there any suppported method og workaround for extracting appointments for more than one mailbox without having to perform a webservicecall for each resource (mailbox)?

It depends of the level of detail you need for each appointment. If you need the full Appointment object there is no other way you can do it. However you may want to consider running multiple concurrent queries (you need to consider throttling will affect you a some point if you push this too far).
Otherwise if you can deal with just having the Subject,Start,EndTime for appointments then GetUserAvailbility https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/getuseravailability-operation should work okay in batches of 100.

Related

Forge API: Get all changed items

I need to get a list of all changed items in my project in BIM 360. Can I do this using forge-api.
Ho, regarding with the latest question [If my service is not available and I will miss some webhook events, how can I get all the changes that were made after the last webhook event received] :
If your requirement is to know which items are changed in one folder of Docs, Search API with filter can be of use. e.g. the endpoint below will return all items which are updated since a certain time.
https://developer.api.autodesk.com/data/v1/projects/{{project_id_with_b}}/folders/{{one_folder_id}}/search?filter[attributes.lastModifiedTime]-ge=2019-10-15
More filters options are described at
https://forge.autodesk.com/en/docs/data/v2/developers_guide/filtering/
While if you wanted to know all updates in one call, I do not see currently the way is available. While, Activity API is on the way, it might be helpful to know all activities during a certain dates, then you could filter out what you are interested in and locate the corresponding module>>files/resources etc.. but Activities may probably be categorized with specific scopes e.g. admin activities, project actives, issue activities etc. so it is not one call knows all updates.. And these APIs may not be exposed in the same time.

Gmail add-on to pull data from many URLs

We are writing a Gmail add-on for synching the user's work schedule into his/her Google calendar. This requires logging into the the employer's workforce management application and fetching data from it. Every different employer is a different customer with a different URL. So, for every customer who wants its employees to be able to use this, we have to add another URL to urlFetchWhitelist and openLinkUrlPrefixes in appsscript.json. We could potentially have hundreds of customers using it. Is there a limit to how many URLs we can put into urlFetchWhitelist and openLinkUrlPrefixes? Or is there another way to solve this?

Problems with addSiteAccount1

I'm following the Quick Start Guide, as I've just received my credentials. I went through the coblogin and user (consumer) creation successfully. For test purposes, I was able to search and list sites and infos.
When I try to invoke addSiteAccount1 using the user session token for the consumer that I create, I get an HTTP 200 response and no apparent error, no exceptions or messages. The JSON response is basically the same as the one listed in the API documentation page, however there's no ID I can use to list transactions. I'm using a real login/password account information on Chase (site ID 643).
By the way, if I use random strings for credentialFields[0].value (username) and credentialFields[1].value (password), I get the same JSON response.
Please help me clarify what is not working here.
addSiteAccount1 API will give you a response which should contain "siteAccountId" field this is the identifier for that particular user's Chase bank site.
This siteAccountId will have itemIDs which resembles different 'container'(in Yodlee terminology) like, all saving and checking accounts comes under bank container,while credit card comes under credit's container similarly loan and mortgages are other containers.
Now even under a specific container you might have multiple accounts for e.g., Chase Bank container you might have 1 saving's account and 1 checking account, for each there will be an itemAccountId available. This uniquely identifies that specific account and you can pass this itemAccountId (which you can get from getItemSummariesForSite API) in executeUserSearchRequest API to get the transactions belongs to this specific account.
For further help here is the link for the API flow which will give you an idea about how and when to use different APIs.
OK, I think I got it working, but maybe some documentation clarification is needed. Provided that all mandatory parameters in the addSiteAccount1 are present and contain no errors, the method call will be successful for a given consumer.
I then visited the getAllSiteAccounts method, which would show me all account aggregation for that user/consumer. I was able to see all accounts added, some had a message like "REFRESH_COMPLETE" and others would have "AUTH_FAILED". It seems that once one adds an account, the Yodlee robots will try to login and then synchronize the data for a given account. Makes sense?
I was only able to verify if the bank credentials were OK by calling another method.

Refreshing Box API token from multiple servers

We are planning on migrating our Box v1 integration to v2.
Our integration implementation includes API calls accessing user box account and files from different servers at the same time.
With v2, and the introduction of refresh token, we would like to know whether multiple refresh token requests can be made concurrently from multiple servers over the same user account.
Moreover, and as a consequence of multiple refresh calls, we would also like to know whether it is possible to have more than one access key per user at any given time.
Thanks for the help
Assaf
We recommend that you use some sort of coordination between your servers to manage auth tokens and refresh tokens. While a user can have multiple access tokens for the same service, they will have to authenticate multiple times in order to get them. You can't mint extra auth tokens off a single auth-token/refresh-token pair.
Here's what we recommend.
Create a pair of encrypted columns in your database to store the auth token, the refresh token, a datetime for "token_expires", and a flag for "token_refresh_in_progress". Identify it by userID.
Write your code so that when you are about to make a call, if you are close (say, within a minute) of the token-expires datetime, instead of making your call, you check to see if the refresh-flag has been set, or if there's already a new token pair. If the flag hasn't been by some other server in the cluster, set the flag that you are doing the refresh. Make the refresh-grant call, and update the database with the new pair, and of course reset the flag.

Is there any way to get a information on activities performed by a specific box user through box api?

Say I want to know what all operation a box user "x" has performed in last week. Is there any way to acheive this via box api??
Or for that matter given a file id can we get a list of all the activities performed.??
If you are the administrator of a Box enterprise and the user is within your enterprise, you can do one of two things:
Fetch all events in the enterprise within your timespan of interest and manually filter them to the particular user using the event.created_by.login. You can filter to a particular file using the event.source.id property.
Fetch the particular user's events using the On Behalf Of API.
Otherwise, you can only fetch events for the user represented by the Bearer token.