Microsoft Graph API get all user messages for tenant in single API call - microsoft-graph-api

Is there a way to get all user messages (emails) for a tenant in a single API call? This would be for a daemon app with admin consent not logging in on behalf of a user.
such as:
"endpoint": "https://graph.microsoft.com/v1.0/users/messages"
instead of:
GET /users/{id | userPrincipalName}/messages
Or is it required to get a list of active users first and make API calls for each user id to get messages individually?

Obviously, you could not get all user's messages directly with the single API. As you said, you could get a list of users then loop to call this API by the user's object id.
There is a sample as a reference about looping to query using Powershell.

Related

How do I get an object ID of a user, by display name, from Microsoft Graph API?

I am creating a Power App which is supposed to modify custom attributes on users on an Azure B2C tenant. However, the only way to update said users is by a Patch call referencing "https://graph.microsoft.com/v1.0/users/object-id" (which I am calling via a Power Automate flow). Since these are b2c users, their actual UPN does not match their email. I need to find a way to get this object ID beforehand so I can pass the appropriate patch call. Any tips? Thanks!
I tried using an Azure AD connector in Power Automate flow using the email of the user, but that is not their actual upn.
https://graph.microsoft.com/v1.0/users?$filter=displayName eq 'USER DISPLAY NAME'&$select=id
will return user id

Get activities of user based on user id

I am looking to fetch activities of user based on their user id. I can see that there is a Get user activities API to get my activities but is there any way to get activity of other users? Given the fact that i have admin account and i can assign permissions.
To get the activity of other users you can use this API
GET https://graph.microsoft.com/v1.0/users/{id}/activities
It requires UserActivity.ReadWrite.CreatedByApp permission.

Is it possible to read FB page ratings server-side?

I need to create ratings grabber from my Facebook fanpage. It can by PHP, Python or Ruby code fired once a day by cron.
I've created an FB_APP so I get APP_ID, APP_SECRET and CLIENT_TOKEN.
When I use Graph API Explorer, there is a access_token which I can use to temporary call to API. Using generated USER_ACCES_TOKEN I can get PAGE_ACCESS_TOKEN by call
GET https://graph.facebook.com/v9.0/me/accounts
then grab page and token
To get ratings I use
GET https://graph.facebook.com/v9.0/{page_id}/ratings?fields=review_text,reviewer&access_token=xxxx
Parameter access_token is a PAGE_ACCESS_TOKEN.
Is it possible to get USER_ACCES_TOKEN or PAGE_ACCESS_TOKEN server-side only without show user login dialog? My script should download ratings without any user attention.
I tried to use OAuth APP_ACCESS_TOKEN, but it is not permitted to access pages.

How to get checkins of a user's particular friend from foursquare?

I am trying to get checkin information of a user's particular friend in my application. In application, user authenticates to foursquare at the start which make me able to get his/her friend list.
I am getting the friend list with this API end point : https://api.foursquare.com/v2/users/self/friends. According to documentation it's response should include user objects which should have include checkins field but it seems there is no checkins field in the response. I can get other informations like first name, bio etc.
I also tried this API endpoint with user ID of friend which I want to get information of https://api.foursquare.com/v2/users/USER_ID/checkins but it returns an error states that I am not authorized for getting this information.
What am I doing wrong? Should I be authorized for this information since the information is about checkins of user's friends?
Thanks in advance.
Unfortunately this isn't a use case that's supported very well by the API. The way to see a list of check-ins of a particular user is through users/self/checkins. This will return the check-ins of the owner of the OAuth token that made the call.
As stated here https://developer.foursquare.com/docs/users/checkins:
USER_ID | self | For now, only self is supported

Automatic AWeber Authentication? How do I access one user's data programmatically without them having to log in?

How can I use the AWeber API to automatically check whether an email address exists on a given user's list? The AWeber paradigm is baffling to me and their docs are poor. Essentially, what you get is the ability to put the AWeber login form on your site (just like this one: https://www.aweber.com/login.htm), so ANY AWeber user could use my site to log into their AWeber account and view their subscriber and list data. This is useless.
The API keys are moot: they simply establish that yes, I am a developer and yes, I have registered my app. The API keys have nothing to do with USER data.
This is not at all how MailChimp handles logins: each user can download their own API keys and use them to authenticate and then programmatically retrieve the subscriber data from their lists.
What I need to do is to create a "Members' Area" on my website, and in order for visitors to see the content in the members-only content, they must join my list. It's a simplified login form that would ask only for the email address (no password is necessary). But I cannot see how to do this with AWeber's convoluted oAuth restrictions. The only way I can currently check email addresses is by logging into my own form (the local copy of the https://www.aweber.com/login.htm form) and then checking the email address. That won't work programmatically. If I can't automatically access subscriber data, then what's the point of the API?
How can I automate authentication so my application can retrieve subscriber information from my user's lists without me having to log in?
The consumer keys identify your application, the access keys are what give the application access to an account, both are needed to make requests to the API.
There is a php quickstart for accessing an aweber accounts' subscriber data. http://engineering.aweber.com/quick-start-api-script-in-php/
Once you have the access keys generated, you must store them for future requests.

Resources