Microsoft Graph Api Onedrive sharing links missing users info - microsoft-graph-api

When sharing a file on Onedrive with specific people the user got to connect using a one-time code.
How do I get those people allowed to use the shared link using the Microsoft Graph API?
Currently, the permission data only states the scope: "users", I was unable to find the users connected to the URL using the Graph Api.
This Info is available in the Onedrive UI itself.
Users in the Onedrive UI
API Response for the same link:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives('b***')/items('0***')/permissions/$entity",
"id": "***-c555beee2324",
"roles": [
"read"
],
"link": {
"scope": "users",
"type": "view",
"webUrl": "***qbagBM9ioYBhgkVqZx4blggM7Ow"
}
}

Related

Microsoft Graph API - Microsoft Teams Create Event with gmail user as attendee

I want to send an MS Teams meeting invite to a Gmail user(guest) using graph API.
I can send it to people under my organization or to another organization with an AD account.
When I add a Gmail user, a meeting is getting created but not sent an invite to a gmail user.
There are no records in the Gmail spam folder also. Any reason or I'm missing something.
One thing noticed one thing in MS Teams desktop app, when I add a Gmail user to teams, it's asking to invite that user. Is there anything I should do related to that when I'm using it from API?
Another thing I have noticed is that there is a setting in Azure portal inside authentication support account type :
Who can use this application or access this API?
Accounts in any organizational directory (Any Azure AD directory - Multitenant)
Attaching the sample code which I have tried. This is working when I add the same AD or different AD account as an attendee but not Gmail(personal account)
curl --location --request POST 'https://graph.microsoft.com/v1.0/users/{{userid}}/events' \
--header 'Authorization: Bearer <token>' \
--header 'Prefer: outlook.timezone="Asia/Dubai"' \
--header 'Content-type: application/json' \
--data-raw '{
"subject": "Let'\''s Meet for Demo",
"body": {
"contentType": "HTML",
"content": "Does noon work for you?"
},
"start": {
"dateTime": "2021-08-27T12:00:00",
"timeZone": "Asia/Dubai"
},
"end": {
"dateTime": "2021-08-27T13:00:00",
"timeZone": "Asia/Dubai"
},
"location":{
"displayName":"John'\''s Dev Room"
},
"attendees": [
{
"emailAddress": {
"address":"user1#gmail.com",
"name": "User1"
},
"type": "required"
}
],
"allowNewTimeProposals": true,
"isOnlineMeeting": true,
"onlineMeetingProvider": "teamsForBusiness"
}
Invitation adds an external user to the organization. When the user is invited, a user entity (of userType Guest) is created and can now be used to control access to resources. The invited user has to go through the redemption process to access any resources he has been invited to.
You can follow this link to create an invite: https://learn.microsoft.com/en-us/graph/api/invitation-post?view=graph-rest-beta&tabs=http
Also as mentioned in create OnlineMeeting doc, Administrators must create an application access policy and grant it to a user, authorizing the app configured in the policy to create an online meeting on behalf of that user (user ID specified in the request path).
Please make sure you have added all the required policies and permissions.

livePermissionBlocked error from Youtube liveBroadcast/insert API

When attempting to call the liveBroadcasts/insert API I receive a livePermissionBlocked error. I have two google cloud projects, and both have been verified to be able to use auth/youtube scope. In one project with the same google user I can call that api without any issue. In the other project using the same user I receive livePermissionBlocked error. How can I investigate further why that API fails in one of the google cloud projects?
See below the full error response
{
"error": {
"code": 403,
"message": "The user is blocked from live streaming.",
"errors": [
{
"message": "The user is blocked from live streaming.",
"domain": "youtube.liveBroadcast",
"reason": "livePermissionBlocked",
"extendedHelp": "https://support.google.com/youtube/answer/2853834"
}
]
}
}
Also please note I have verified that the user I am testing with has Youtube streaming enabled. I am able to live stream on Youtube and also using one of my google cloud projects.

Use web app permissions in Site Collection app catalog

I've created a spfx package containing a webpart that reads from MS Graph. The solution request the following permissions in package-solution.json:
"webApiPermissionRequests": [
{
"resource": "Microsoft Graph",
"scope": "Directory.Read.All,Directory.ReadWrite.All"
}
]
This works fine when I deploy the solution to the tenant app catalog. When I deploy the solution to a site collection app catalog it gets deployed without any error and creates an API access request (which I approve). But the webpart throws the following error when using the MSGraphClient:
Uncaught (in promise) Error: Error making HttpClient request in queryable [403] Forbidden ::> {"error":{"code":"Authorization_RequestDenied","message":"Insufficient privileges to complete the operation.","innerError":{"date":"2021-05-20T19:40:49","request-id":"82b80ddb-...","client-request-id":"82b80ddb-..."}}}
Is this scenario not supported or have I missed any steps required?
The webApiPermissionRequests is an array of webApiPermissionRequest items. Each item defines the resource and the scope of the permission request.
Change your permissions to the below
"webApiPermissionRequests": [
{
"resource": "Microsoft Graph",
"scope": "Directory.ReadWrite.All"
},
{
"resource": "Microsoft Graph",
"scope": "Directory.ReadWrite.All"
}
]
Besides, after your deploy the solution to the tenant app catalog. You need to approve the requested Microsoft Graph permissions in SharePoint Admin Center: https://learn.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/using-microsoft-graph-apis#approve-the-requested-microsoft-graph-permissions

REST APIs to manage my twilio account users?

I created a Twilio account. I have two users in my Twilio account.
Owner
Developer
I want Twilio REST API Something like GET /users which should return me above two users list
Seems OAuth is not supported by Twilio
I created master API Key for my account. ( This is not like OAuth it is valid only for my account, No cross-account call will be possible with this )
Are there any User management APIs provided by Twilio? ( I am not asking about subaccounts ) OR Any alternative OAuth like authentication for APIs?
Update
Based on a comment by #philnash I am adding few more points,
So if I create a Twilio account for my organization there I create few users for my organization, e.g.
1] Owner ( By default ) -> User1
2] Developer -> User2
3] Billing billing manager -> User3
4] Support -> User4
For the above users, I may need users API which may return my organization users list ( Provided I may need enabled REST API access & may have access_token ),
{
"users": [
{
"name": "User1",
"email": "user1#myorg.com",
"role": "owner"
},
{
"name": "User2",
"email": "user2#myorg.com",
"role": "developer"
},
{
"name": "User1",
"email": "user1#myorg.com",
"role": "billing_manager"
},
{
"name": "User1",
"email": "user1#myorg.com",
"role": "support"
}
]
}
I am looking for User management APIs for Twilio Main Account ( Close to Twilio connect but limitation there is it is for sub-accounts ).
Is it possible?
Twilio developer evangelist here.
There is not a user management API for the Twilio API. Users are really the access credentials for a person to log in to the Twilio console. Users then have access to accounts and the account credentials (account SID and auth token) and API keys created for the account.
I am still unsure what you hope to do with the list of users that have access to your account. There is no Users API though.

Stripe deauthorize webhook to Rails app

The question goes like this:
I have connected a user with Stripe through my Rails app, and such user is connected via API key.
In Stripe there is an option to deauthorize API keys. I would like to be informed in my app once a user deauthorizes my API key. I know it is possible, or should be possible.
I know I have to manage webhooks in my app, but I am wondering where to set which URL of my app Stripe will call when user deauthorizes my API key, and what data will be sent to my app?
Webhooks are used by Stripe to notify your server of events. There are two types of webhook endpoints you can set up:
"Account" endpoints will receive events that happen on your own account
"Connect" endpoints will receive events that happen on accounts that are connected to yours via Stripe Connect
In a nutshell, you'll configure an URL to your own server (the "endpoint") in your Stripe webhook settings. Whenever an event happens, Stripe will send an event object to that URL.
In the case of Connect endpoints, the object will also have an account attribute with the ID of the account that emitted the event.
To be notified of deauthorizations, you'd need to set up a Connect endpoint and catch account.application.deauthorized events. The data you will receive will look like this:
{
"created": 1326853478,
"livemode": false,
"id": "evt_00000000000000",
"type": "account.application.deauthorized",
"object": "event",
"request": null,
"pending_webhooks": 1,
"api_version": "2016-03-07",
"data": {
"object": {
"id": "ca_00000000000000",
"object": "application",
"name": "Your Application"
}
},
"account": "acct_00000000000000"
}

Resources