How to get recurrence data from JavaScript API in office365 - javascript

I need to fetch recurrence data for appointments like Repeat, From, To fields. In addition, I also need to get daily, weekly, or monthly pattern details for my Outlook office Add-in while it is in compose mode.

In an Outlook web add-in when something is not available directly from Office.js library you can try to get access to those data using Exchange Web Services.
Fortunately, Office.js provides two ways to access EWS.
You can request directly the EWS with a SOAP request from your client app. See method makeEwsRequestAsync in Office.context.mailbox
You can get an EWS token, send it to your server and make the request from there. Then you can use a nice SDK such as this one. You will invoke the method getCallbackTokenAsync from Office.Context.mailblox to retrieve such a token. In this link you will find an example on how to use this technique to retrieve email attachments (not available in Office.js)
To answer more precisely, the EWS seems to expose the information you need regarding recurrence, To etc. for appointments, see this link.

Related

Using google sheets as a database authenticating from the code

I am working on a POC (a Vue based web application) for which I require a database. I want to use the google sheet as a database
I followed the official Google Sheets API v4 documentation and I am able to perform all kinds of database operations on the google sheet. But, it requires the user to explicitly click on a button and sign in to authenticate. I want it to be done from the code itself.
I have the following keys which are required along with the user consent to use the google sheets API
// Client ID and API key from the Developer Console
var CLIENT_ID = '<YOUR_CLIENT_ID>';
var API_KEY = '<YOUR_API_KEY>';
Apart from this I also have a client secret which I have absolutely no idea how to use it in the code. From what I have read over the internet and what I have understood, it is used to authenticate the access to google sheets API from the code. But, I don't know how.
I did come across some of the third-party services like Sheetsu and SheetDB which I don't want to use. So, is there a way I can use google sheets as a database for simple CRUD operations just as we will do with any traditional database?
It is behaving that way - expecting a user to authenticate - because you are using OAuth2 authentication which is meant for scenarios where a user grants your program access to their spreadsheet.
For your scenario you want to use the other type of authentication: service account.
Actually, you can use a service account with OAuth, as described here:
Using OAuth 2.0 for Server to Server Applications
https://developers.google.com/identity/protocols/oauth2/service-account
And you could consider this because the code examples tend to use OAuth, but I'm suggesting that you instead go back to the sheets API in the console:
https://console.cloud.google.com/apis/api/sheets.googleapis.com/credentials?project=yourProjectId
And click 'create credentials' and choose a service account instead of OAuth. This method has a simpler authentication flow since it is meant for your scenario: no end-user.
Also, I haven't done this in a while, but I think I took the service account client_email (the email address of the account - the main identifier) and give it permission to access the sheet, ie. share your sheet with it.
Finally, I would note - and you probably already know this - but you mention using sheets like a database and it doesn't have the performance characteristics for this. It is more like a CRM: eg. suitable for a building a static site.

Does anyone run a service to POST data from client-side application?

I have a static JavaScript-only data visualisation. I want to collect the user's name and email before showing them the visualisation.
I have written a popup form to collect this info. But where can I store it? Do I have to add a whole back-end service and database just to store two variables?
I just need to POST two text strings, safely and reliably, from client-side JavaScript, and download the data as needed. Surely someone must offer a service that allows this? I would happily pay to avoid writing my own backend.
(I've looked at embedding a Mailchimp form, but it's too painful to style it in the way I need - I'd prefer to use my own front-end code.)
Have you looked at Campaign monitor ?
You can create a List that has the name + email then you can push this data to that list using AJAX:
https://www.campaignmonitor.com/appstore/ajax-subscription-form/
AWS Mobile Hub (DynamoDB, Lambda, API Gateway, Cognito)
-Integrated console that helps you create, build, test, and monitor your mobile apps that leverage AWS services
Parse server
-Open source server released by Parse/Facebook to replicate functionality of Parse
remoteStorage
-Everything in one place – your place. Use a storage account with a provider you trust, or set up your own storage server. Move house whenever you want. It's your data.

Using Cordova ADAL, is it possible to reach to two different API (graph.windows.net and graph.microsoft.com, for azure and office 365) ?

Using Cordova ADAL, is it possible to reach to two different API (graph.windows.net and microsoft.com, for azure and office 365) ?
I am trying to use the graph api and reach for information regarding groups tenants etc.
I would also like to query the microsoft.com, simply to retrieve pictures.
However, using cordova ADAL, I am only able to retrieve token for one of them. Is it possible to get both?
If it's not possible, would it be possible to simply get a code, so the server can ask for both, independantly?
Thanks,
MS-ADAL is using to get authenticate a particular user , plugin will return a token after successful authentication.
We can authenticate the user in active directory against office 365 products like yammer or our custom API's which are hosted in cloud.
Either you can make a graph API call separately or use some tool to extract the claims from token .

Firebase 2 (firebase.google.com) Push Notification - manage from outside

I cant find any information about managing push notification outside the firebase.google.com GUI.
We need to send pushes dynamically, therefore we need to create script, which allows us to do this. For example right now, we are using Parse, we download Parse SDK to our server, give it keys etc., and then we can send pushes dynamically.
Is there any possibility for doing this with new Firebase SDK?
Firebase does not provide a REST API for their Notifications product. You'll have to use low-level Firebase Cloud Messaging (FCM) HTTP API with topics or push tokens directly, it's very similar to Google Cloud Messaging.
There is no way to trigger push notifications to specific users (Firebase UID), or to target properties & events like you would do with the web dashboard. You should consider 3rd party services like Parse Server, Batch.com etc. if you are looking for a higher level API, open-rate analytics etc.
There was little confusion, but as mentioned by Gerrit Hoekstra, the notifications are handled by Firebase Cloud Messaging (I do not know, why they have no reference from Notification topic to make it clear).
There is no SDK, however the REST API seems quite simple, you also have possibility to implement your own XMPP server for it.

Exchange Server Javascript Api

I'm building a web application which is a client side heavy application in which I'm implementing the contacts page. The contacts page will have options of showing contacts from different sources for exporting it into the current application. I've implemented Google Contacts, Yahoo Contacts, MS Live Contacts, etc. using OAuth. Now the next option is showing the contacts from exchange server in the application. I know that the new office 365 has a JavaScript api to pull contacts from newer office version which is already in progress. But I need a solution which works with older version too.
The requirement goes like this, User will have text boxes which are necessary to connect to an exchange server like email, password, server address, port, etc. and a button which need to send an ajax call to respective servers and fetch the necessary contact details after authenticating.
I've tried various method to get the details but I couldn't. I want to know is it really possible to connect an exchange server from JavaScript to get contacts? If yes, Please suggest some method to view the details.
The new JavaScript for Office API can only be used with Office (web) Add-ins (formerly Apps for Office). Otherwise you can use Exchange Web Services (EWS) to issue SOAP calls with JavaScript to do just about anything.
See: "How to: Process contacts in batches by using EWS in Exchange"

Categories