How do I get an access token from Microsoft Graph API? - node.js

I'm currently dealing with the fascinatingly confusing world of Microsoft. I've read several of the half-baked tutorials on how to use their Graph API and Office 365 API and I still don't really know what to do. What I HAVE figure out is how to build that authorization request URL so I can get the "code", which is supposed to be used to then get the access token. I've done this with the Google API and it works beautifully, but not with the Microsoft Graph API. Here's what I have:
https://login.microsoftonline.com/common/oauth2/authorize?client_id=123451234512345&response_type=code&redirect_uri=https://www.my-site.com/oauth-callback/microsoft
When the user clicks on this link, they are taken to the Microsoft login page. So far, so good. But, after entering my login credentials it just takes me right back to the same Microsoft login page, as opposed to redirecting the user to my redirect uri. I have an Azure account with the same redirect URI specified, but it just isn't working. What am I doing wrong? By the way, I'm using node.js. Any links to useful tutorials would be much appreciated.

To get a code you need to pass the following parameters:
response_type=code
client_id=yourClientId
redirect_uri=yourRedirectUri
resource=https://graph.microsoft.com
For example:
https://login.microsoftonline.com/common/oauth2/authorize?response_type=code&client_id=12334&redirect_uri=https://myapp.com&resource=https://graph.microsoft.com
Finally, thank you for the feedback, can you please point the articles you read where the information was not clear so we can make sure to update them? I suggest you try the following article: https://graph.microsoft.io/docs/platform/rest

This is a great video explaining the login process: https://www.youtube.com/watch?v=HOcwvuIJHXA "Deep Dive into the Office 365 RESTful APIs". It is very long, but detailed. Around 25:00 it shows with Fiddler how the login works. Helped me a lot.

Related

Instagram API - get own posts for website

I read through all the dev docs stuff at https://developers.facebook.com, but I found no simple solution to solve that one simple question. I want to display my own posts detail at my website. Is that even possible?
This is possible using IG Basic Display API and the GET /{user-id}/media endpoint
You will need to build a Login flow which is described in the Get Started guide
https://developers.facebook.com/docs/instagram-basic-display-api/getting-started
https://developers.facebook.com/docs/instagram-basic-display-api/reference/user/media

Instagram server side authentication 2019

I just can't get it right.
There are docs for instagram api that says do one call, it will redirect user to a page where he authenticate, then you get code from Redirect Url and now using this code you can get token. That is working and it is just fine. But, what if i want to do a website for myself as personal page and show my own instagram photos filtered by tag to ANYONE. I don't need OAuth, any login. I'm ok with creating Node server and make a call smth like this:
http://api.instagram.com/auth?client_id_or_login=vvinog&password=secretpassword
and get token from this call. But it looks like in the internet no one do this, or i dump?
Can you please advice some tutorial, approach that allows me to do that?
Any code snippets are super welcome.

Is it possible to access a friends Instagram pictures without his access_token?

I heard that Instagram recently changed their APIs and I have a related question to that.
Let's assume I would like to build an "Instagram feed app of people I follow". So this app would just show me the pictures of all people I follow. From what I understand this would be possible, but I would always have same manual effort:
From the Instagram developer website I understand that I need the access_token from all my friends.
Do I understand that correctly?
This would mean every time I follow someone new, I would have to get his/her access_token manually and add it into my app.
Do I understand this correctly or is there a programmatic/automated way to get the needed access_token from the new followed person?
Yes, you are correct. This is not possible at the moment. I'm not sure how you would get the access token of friends. You would have to have them login as well. BTW: This seems to be the way facebook is going (since they now control Instagram). They require that both friends have authorized your app and then they will list their followers.

Can't figure out how to access Dice.com's REST API

So I want to use Dice.com's API to grab data for an infographic type application.
http://www.dice.com/common/content/documentation/api.html
My problem is they require a Developer ID and password. I'm not sure where I can get this since it's required for the OAuth token.
I plan on using Node.js to make requests to their RESTful service. Any information would be greatly appreciated.
I emailed dicemedia#dice.com (email grabbed from http://www.programmableweb.com/api/dice-jobs) and got a reply:
Thanks for your interest in the Dice API! It's currently not available
for public use. We've been field testing it at some events and hope
to open it up by the end of Q2 2015.
We'll definitely make an announcement when it opens up.
Please let me know if you have any other questions.
Thanks!
I found it pretty easy to get started hacking around with this using Postman (actually for searches you could just start in a browser, with a JSON plugin installed or the like).
http://www.dice.com/common/content/util/apidoc/jobsearch.html

Azure CTP signup

I am trying to signup to the Azure CTP but am finding the whole process real non user friendly. On this http://www.microsoft.com/windowsazure/getstarted/ web page it gives me a link to go to get a token, but when I click it doesn't appear to do anything. It takes me to another page but doesn't tell me if a token has been sent or I have to do something else.
On the dashboard of Microsoft Connect it tells me my status in Azure is 'Participating'. What does this mean? I am not participating because I don't have a token. The whole process is very frustrating!
Is it possible to contact an actual person?
It sounds like you already submitted a request for a token. I tried to sign up a week ago or so and I haven't received anything yet. However, I did get my SQL Azure license and it seems to be working well.
Also, you are absolutely correct, their website is a mess and it's very hard to figure things out. I hope they will be cleaning it up soon!
And I don't think they have any kind of support setup yet.

Resources