PipedreamHQ / pipedream

Connect APIs, remarkably fast. Free for developers.
https://pipedream.com
Other
8.82k stars 5.27k forks source link

Microsoft Graph API #10016

Open pipedream-component-development opened 8 months ago

pipedream-component-development commented 8 months ago

App

Microsoft Graph API https://developer.microsoft.com/en-us/graph

nule56 commented 8 months ago

Hi Team,

We would like to be able to select scopes when using pipedream. Currently when trying to make requests we get the following errors.

AxiosError - Request failed with status code 403 {"error":{"code":"Forbidden","message":"Missing scope permissions on the request. API requires one of 'TeamworkDevice.Read.All, TeamworkDevice.ReadWrite.All'. Scopes on the request 'Calendars.Read, Calendars.Read.Shared, Calendars.ReadWrite, Calendars.ReadWrite.Shared, Directory.ReadWrite.All, email, Files.Read, Files.Read.All, Files.ReadWrite, Mail.Send, Notes.ReadWrite.All, openid, profile, Sites.ReadWrite.All, Tasks.Read, Tasks.Read.Shared, Tasks.ReadWrite, Tasks.ReadWrite.Shared, Team.ReadBasic.All, User.Read, User.ReadWrite.All'","innerError":{"date":"2024-01-19T03:29:58","request-id":"50f37c57-4fd4-402c-a551-6727c55b92cb","client-request-id":"50f37c57-4fd4-402c-a551-6727c55b92cb"}}}

The code we are trying to run is as follows:

import { axios } from "@pipedream/platform" export default defineComponent({ props: { microsoft_graph_api: { type: "app", app: "microsoft_graph_api", } }, async run({steps, $}) { return await axios($, { url: https://graph.microsoft.com/beta/teamwork/devices/, headers: { Authorization: Bearer ${this.microsoft_graph_api.$auth.oauth_access_token}, }, }) }, })

malexanderlim commented 8 months ago

Hi @nule56 , can you try using the Microsoft Teams Admin app which has the TeamworkDevice.Read.All scope that you're looking to use? Let me know if this works for you!

nule56 commented 8 months ago

Hi @malexanderlim, we get the following error when using the Microsoft Teams Admin app.

The error is just invalid client but the URL is https://api.pipedream.com/connect/oauth/oa_Gybijd/callback?error=invalid_client&error_description=AADSTS650053%3a+The+application+%27Pipedream%27+asked+for+scope+%27Chat.Read.All%27+that+doesn%27t+exist+on+the+resource+%2700000003-0000-0000-c000-000000000000%27.+Contact+the+app+vendor.+Trace+ID%3a+b38434cf-ab57-4523-a5a4-bf4eee082f00+Correlation+ID%3a+d1a7dcb5-af49-40e2-af4a-0e7e50c5f958+Timestamp%3a+2024-01-24+00%3a42%3a34Z&state=21754b16c8aad3ad8d2993e2f5c21322

The Cisco Webex integration on pipedream was recently modified to allow us to select the scopes we required for the integration. Would it be possible to have a Graph API integration similar, so that we can select the scopes?

malexanderlim commented 8 months ago

Hi @nule56 , I've fixed the scopes issue with the Microsoft Teams Admin app - let me know if this would work for your use case.

If the desire is to create your own application, similar to the Cisco Webex (Custom App) setup, I'll have to do a bit more research to see how this would work, as the process of setting up a custom app on the Microsoft Graph side is a lot more involved than with Cisco Webex.

nule56 commented 8 months ago

@malexanderlim Yes, we would like to have something similar to the Cisco Webex (Custom App) setup.

nule56 commented 7 months ago

@malexanderlim @vunguyenhung are you able to provide an update on this feature request?