Access Microsoft Todo List via Rest API - rest

I want to get my to-dos from my Microsoft Todo (https://to-do.live.com) but I don't have a clue on how to get started. I searched online but did not find documentation for a REST API.
Does anyone know how to access certain Todo lists from MS Todo (formerly known as Wunderlist)? Is the Graph API the place to look? I don't have an Office 365 account.

You could use Graph API for to-do tasks
For example to list all the tasks categories :
To access tasks under a specific category :
https://graph.microsoft.com/v1.0/me/todo/lists/{id}/tasks
with the token in the request body to authorize the request.
Authorization : Bearer <Token>
To get Token
I understand you don't have any Office 365 Work accounts.
Access the below url and login
https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps
Login using your personal account credentials.
Register app :
Once registration is complete, you will be getting app credentials.
Once Registration done. Grant the permissions :
App --> App Name --> API Permissions --> Graph Api
Check the below Tasks delegated permissions
You can authorize the client using the below url :
https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id={client_id}&scope={scope}
&response_type=token&redirect_uri={redirect_uri}
Obtain the token.

Related

Graph API: Using client_credential grant type to read my or another signed-in user profile

I thought it would be simple to use Graph API to read my own user profile or another signed-in user profile but no luck so far.
I created an Azure app with only the following:
a) Client Secret
b) Delegated API permission of User.Read only
I then used the following simple code to try to read my own profile but it returned (400) Bad Request even though I can see that a token was returned successfully.
I was wondering if I could use the same Azure app to read another user's profile provided that a sign-in prompt could be created to switch account.
Any thoughts?
The me endpoint requires a user context. You're using the client credentials grant type, which is for client apps to use in an app-only context. The app has no awareness of who "me" is, or what "your" profile is because you haven't provided a user.
For the app to read the profiles of other users in the client credentials flow, you need to add one of the MS Graph application-type permissions, and send a request to the https://graph.microsoft.com/v1.0/users enpoint
Get user API endpoint

How to get Instagram direct API authentication

Facebook recently released a step-by-step documentation for using a GrapAPI to manage Instagram messages. To obtain the access token to use it, it's necessary to create an application in the developer center, enable login via Facebook and include the permissions "instagram_basic", "instagram_manage_messages" and "pages_manage_metadata" but to activate these options it's necessary to submit various information for approval as statement of how the integration works and descriptions of the usage flow. I don't have access to this information because I can't develop an integration without it being approved.
It's not possible to use the provided test user as the pages raised by him cannot be linked to Instagram accounts.
Tutorial followed: https://developers.facebook.com/docs/messenger-platform/instagram/get-started
Someone with some experience with the Facebook API could give me a light on how to obtain the token with access required and proceed the tests?
I have done the tutorial as well, I faced the same problem. To enable instagram_basic, instagram_manage_messages and pages_manage_metadata without app review you need to create a test-app. For test apps all permissions are granted without review.
Instructions on how to create a test-app
Another usefull tipp: If you are wondering why you need to implement facebook login to access the instagram messaging api, the logic is the following: You need to implement login to then use your own implementation to logg in your own account and obtain the page access key that will let you do api calls to the instagram messaging api. This process is obviously overkill and instagram is working on a way of getting that access token through the developer dashboard.
For now to obtain that access token you need:
implement facebook login as a simple html website and console log the response. Be sure to add the required permissions to the data-scope attribute of the facebook login button:
<div
class="fb-login-button"
data-scope="public_profile,email,instagram_basic,instagram_manage_messages,pages_manage_metadata,pages_messaging"
></div>
deploy to a website that has https enabled (logging in from
localhost will only work if you use a tunelling service like ngrok).
Open your website that has facebook login implemented and logg in with your facebook account that is also linked to the target instagram account and also is admin of your test-app.
get the access token from the response to call the other API endpoints.

MS Bot Framework / Facebook Account Linking and Messenger Extensions integration

We would like to enable the following scenario :
user can login to a web application leveraging Azure AD B2C as the identity provider.
user can also interact with a bot on FB messenger (built on MS Bot Framework). He is asked to log in so that we can get him an access token for subsequent web api calls.
user has access to a persistent menu on his FB messenger where he can navigate to some pages of the actual web site and be logged in straight away.
I have the following question :
Could Azure AD B2C be used in conjunction with Facebook Account Linking ? Could not find any samples... What I am doing now : in the FB login button, I pass a link to one of my bot server controller method as a level of indirection. Then in this method, I get the redirect Uri and account linking token that FB is adding to the url and then do a redirect to my B2C policy url passing these 2 arguments in the state and my own redirect Uri (not the one from FB). This way, once authentication is done, b2c redirects to my bot where I rebuilt the callback to fb url. Any security concern with this approach?
Thx !
After looking at this post Facebook Messenger: get access token of linked account it seems that FB account linking is not really useful in regards to access token. I was expecting similar behavior as Amazon Alexa account linking but in fact it has nothing to do with exchanging an authorization code with an access token and having this token manage by FB... So I am just going to leverage the BotAuth code https://github.com/MicrosoftDX/botauth to store the access token in the bot state... I dont really care about collecting the PSID...
Regarding the last step of the scenario, we are investigating cookies reuse from the first authentication flow.

VSTS all time integration

I have a web-site with users "site-account".
Users also are registered in VSTS / (project1.visualstudio.com, project2.visualstudio.com, ...) "vsts-account"
I need allow user once link a "site-account" to "vsts-account" (one or multiple)
After link a account i can read / write a Work-Backlog item in any time.
Example, in background read Work-Backlog and send email notification.
I cant understand how i can link and grand access to "vsts-account" from "site-account"
I can create a Extension, that will be installed in VSTS.
Thanks for any links
The simple workflow:
Create a web app with OAuth authorize, refer to this article: ASP.NET web app (OAuth sample)
The user login your web-site with "site-account"
After login, enable the link (e.g. vsts-account), the user can click the link to authorization to the VSTS
Associate the access token and refresh token to that user (store in database)
Using refresh token to get access token if the access token expired
Using access token to get work item in VSTS
More information about OAuth with VSTS, you can refer to Authorize access to REST APIs with OAuth 2.0

How to generate Facebook Marketing API access token to use it in Windows application

I am using Facebook as advertising platform to promote my application on Apple and Google stores. I would like to make windows service which will download daily report(s) about advertising status of my marketing campaign running one Facebook, preferably using 60 day token, or some permanent solution so that token is retrieved when required. I think that i understand everything to do this except how to generate access token to use it with Facebook Graph API. Which token for which Facebook account do I need and how to obtain it?
You'll need a Facebook app and to grant that app the ads_read permission in order to retrieve reports about your advertising efforts via the API (source).
You'll want a long-lived token so that you don't have to re-authenticate very often. The access token documentation details the steps to exchange a short-lived token for a long-lived one.
You may also want to consider managing the app, ad account, and access tokens (via a business system user) with the FB Business Manager.
Create a facebook app.
Go to the Graph API Explorer in Facebook's Tools & Support section.
Pick your app from the drop down.
Hit Get Token > Get User Access Token.
In Select Permissions choose required permissions or select them from extended permissions.
Use the user access token that will be presented to you in the access token form input field.