1const postData = {
2 client_id: APP_ID,
3 scope: MS_GRAPH_SCOPE,
4 client_secret: APP_SECERET,
5 grant_type: 'client_credentials'
6};
7
8axios.defaults.headers.post['Content-Type'] =
9 'application/x-www-form-urlencoded';
10
11axios
12 .post(TOKEN_ENDPOINT, qs.stringify(postData))
13 .then(response => {
14 console.log(response.data);
15 })
16 .catch(error => {
17 console.log(error);
18 });