how do I get user email and full name using instagram graph api - instagram-graph-api

I'm using a consumer facebook developer account. I need to get user media information from the following endpoint. Particularly need to get user full name, email and profile picture url
Request:
https://graph.instagram.com/{user-id}?fields=id,username,account_type,media_count&access_token=xxxxxxxxxxxxxxxxxxxxxxx
Response:
{
id: "3454354543543345",
username: "test",
account_type: "PERSONAL",
media_count: 22
}
Referred from the doc: getting-profile-info user-fields

Related

Remove scopes from Firebase OAuthProvider('google.com')

I am using a vanilla configuration of the firebase Auth SDK. It is currently asking for all of these scopes.
I do not need profile picture or name, and would love to remove them. Is it possible?
Simple answer is No name, and picture permissions are granted to your application when you request the profile scope as part of signin.
explanation
Assuming you are following the example found here. If you check the lines called addScopes.
provider.addScope('profile');
provider.addScope('email');
This is where you define what permissions your applicating needs. The email and profile scopes are part of Google sign in (Open Id Connect) The profile scope give you access to some basic profile information about the user. Part of basic profile information is their picture.
These two claims are actually returned by the user info endpoint. This is the response from the userinfo endpoint when I authorized only with the profile scope.
{
"family_name": "Lawton",
"name": "Linda Lawton",
"picture": "https://lh3.googleusercontent.com/a-/AOh14GhroCYJp2P9xeYeYk1npchBPK-zbtTxzNQo0WAHI20=s96-c",
"locale": "en",
"given_name": "Linda",
"id": "1172004755376"
}
This is all default, so its not something you can change.
full example
// Using a redirect.
firebase.auth().getRedirectResult().then(function(result) {
if (result.credential) {
// This gives you the OAuth Access Token for that provider.
var token = result.credential.accessToken;
}
var user = result.user;
});
// Start a sign in process for an unauthenticated user.
var provider = new firebase.auth.OAuthProvider('google.com');
provider.addScope('profile');
provider.addScope('email');
firebase.auth().signInWithRedirect(provider);

How to get first name and profile picture from id token google sign in

so I'm making the integration with google sign in from a web-site, so basically the flow here is:
google sign in -> get the token id and send to an auth rest api -> rest api get the user Name, profile picture and email then signup the user.
My problem is that I'm not beeing able to discover how to get the user name and profile picture. Even with the userinfo.email & userinfo.profile scopes, the token id only stores in the payload the UserId and the email. Here is what my token id payload is looking now:
{
"iss": "accounts.google.com",
"azp": "######",
"aud": "######",
"sub": "######",
"email": "gsalomaoc#gmail.com",
"email_verified": true,
"iat": 1639009337,
"exp": 1639012937,
"jti": "######"
}
I was expecting the profile picture and the first&last name to bee sent at the payload. Can any one give me a hand to figure out how to get this fields?
Appreciate any help.
You can use this:
www.googleapis.com/oauth2/v1/userinfo
instead of:
oauth2.googleapis.com/tokeninfo
Try it out: https://developers.google.com/oauthplayground/
Source: How to get user profile picture from Google Chat Bot using Google App Script?

Send Message to Users In Group

I have a group on azure, I have been able to get the members of the group using MS Graph API.
I have the details of the users in this format:
{
'#odata.type': '#microsoft.graph.user',
id: 'xxx-xxxxx-xxxxx',
businessPhones: [],
displayName: 'USER__FULL_NAME',
givenName: 'USER_FIRST_NAME',
jobTitle: null,
mail: 'USER_EMAIL',
mobilePhone: null,
officeLocation: null,
preferredLanguage: 'en-US',
surname: 'USER_LAST_NAME',
userPrincipalName: 'USER_EMAIL'
}
I want to send a message to the members of the group using BotFramework Node.js SDK.
I have checked Microsoft Bot Service Documentation, I can't find anything related
there are two approaches :
Using pro-active messages via the bot's Teams Channel.
https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/send-proactive-messages?tabs=dotnet
if you do not need/want a bot that there are options to 'just' start a new 1:1 or group-chat with a Graph call.
https://learn.microsoft.com/en-us/graph/api/chat-post?view=graph-rest-beta&tabs=http

Fetch events from shared calendar with Office 365 REST API

Loading shared calendar from a user works so far.
However, as soon as you want to load the events, we get the following error message:
ErrorAccessDenied
Access is denied. Check credentials and try again.
The URL looks like this:
https://outlook.office.com/api/v2.0/users/{userName}/calendars/{sharedCalendarId}/calendarView
Query:
{
"query": {
"$select": "Subject,Location,Start,End,IsAllDay,BodyPreview,Extensions",
"$expand": "Extensions($filter=Id eq \"Microsoft.OutlookServices.OpenTypeExtension.custom.string.here\")",
"startDateTime": "2018-07-09T22:00:00.000Z",
"endDateTime": "2018-11-09T23:00:00.000Z"
},
"headers": {
"Prefer": [
"odata.track-changes",
"odata.maxpagesize=200"
]
}
}
The following scopes were set:
"openid",
"profiles",
"offline_access", // for refresh token
"https://outlook.office.com/calendars.readwrite",
"https://outlook.office.com/calendars.read.shared",
"https://outlook.office.com/calendars.readwrite.shared"
The Outlook REST API requests are always performed on behalf of the current user (authenticated user). That's why the endpoint /me/calendars works but users/{userId}/calendars does not. You can not get access to another user's calendar using this API. More information is provided here.
To access the other user's calendar you should switch to Microsoft Graph API. Then you could use the following endpoints:
Using https://graph.microsoft.com/v1.0/
GET /me/calendar/calendarView
GET /users/{id | userPrincipalName}/calendar/calendarView
GET /groups/{id}/calendar/calendarView
Remember to specify permissions for accessing user's calendars.

Get follower List with userID Instagram

How can I get Following/Followers List with UserID rather than "self" using Instagram API, the service for getting list of follows for current instagram user logged in and it works
https://api.instagram.com/v1/users/self/follows?access_token=ACCESS-TOKEN
I try to modify self with an ID of Instagram User
https://api.instagram.com/v1/users/6675420875/follows?access_token=XXXX
but without success,the response is:
{
"meta": {
"code": 400,
"error_type": "APINotAllowedError",
"error_message": "you cannot view this resource"
}
}
this user "6675420875" already invited and added in sandbox mode.
I know the supported Api of Instagram doesn't support this anymore since June 16 but is there any workaround for this?
You cannot get followers/following for any user other than logged in users anymore, As of June 1 2016, you can only get followers/following of self and also only if you have been approved permission for following_list before Oct 1 2017.

Resources