question

KevinThankachan-4898 avatar image
0 Votes"
KevinThankachan-4898 asked JagadeeshLankiReddy-5847 commented

Accessing Graph Api from Team Toolkit personal tab

I'm trying to access the graph API from a personal tab setup using Microsoft teams tool kit.
I have created an Azure app and given the appropriate permissions.
I'm trying to read the current users details. All i get is the generic error- No response from the server.
Please let me know what additional steps i need to do to fix this.


 import { graph } from '@pnp/graph/presets/all'  ;
 import { AdalFetchClient } from "@pnp/nodejs";
 graph.setup({
   graph: {
       fetchClientFactory: () => {
           return new AdalFetchClient("***********-f3bf-4315-******", "d36b0cfb-368c-4573-b488-940b4de29514", "Password");
       },
   },
 });
 private async getUserDetails()
   {
       await graph.me().then(u=>{
           this.setState({
             UserEmail:u['mail']!,
             UserName:u['displayName']!  
           })
           console.log(JSON.stringify(u));
       }).catch((err) => {  
           console.log("Graph API Error "+err);
         });
           
   }



office-teams-app-devmicrosoft-graph-teamwork
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@KevinThankachan-4898 Please post the actual error message you get to help debug the problem.

0 Votes 0 ·

Hi @KevinThankachan-4898, could you please share the query and error message, so that we can investigate on this.

0 Votes 0 ·

1 Answer

KevinThankachan-4898 avatar image
0 Votes"
KevinThankachan-4898 answered JagadeeshLankiReddy-5847 commented

Apologies for the late reply..From the console log, all i could get is "No response from the server."

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @KevinThankachan-4898, In fetchClientFactory order, should be: fetchClientFactory("{tenant}.onmicrosoft.com", "{app id}", "{app secret}") like this.

0 Votes 0 ·