Browse Source

check connection on profile + update perms

k.niemeskern 2 years ago
parent
commit
dfb5726a50
3 changed files with 4 additions and 4 deletions
  1. 1 1
      config.js
  2. 1 1
      index.js
  3. 2 2
      lib/API.js

+ 1 - 1
config.js

@@ -9,6 +9,6 @@ module.exports = {
     sessionName: '',
     sessionKeys: ['', ''],
     scopePerms :[
-        'r_liteprofile', 'r_emailaddress', 'w_member_social', 'r_1st_connections_size', 'rw_organization_admin'
+        'r_liteprofile', 'r_emailaddress', 'w_member_social', 'r_1st_connections', 'r_1st_connections_size', 'rw_organization_admin'
     ],
 };

+ 1 - 1
index.js

@@ -11,7 +11,7 @@ const mail =  require('./notification.js')
 
 let info = {
     followers: 1,
-    companyID: "991997",
+    companyID: 991997,
     orgaName: "spirit_3",
     tokens: null,
     expire: 0,

+ 2 - 2
lib/API.js

@@ -25,8 +25,8 @@ class API {
 
     static getCompanyID(info) {
         return new Promise((resolve, reject) => {
-            
-            const url = `https://api.linkedin.com/v2/organizations/${info.companyID}`;
+            // const url = `GET https://api.linkedin.com/v2/networkSizes/urn:li:organization:${info.companyID}?edgeType=CompanyFollowedByMember`
+            const url = `https://api.linkedin.com/v2/connections?q=viewer&projection=(paging)`;
             const headers = {
                 'Authorization': 'Bearer ' + info.token,
                 'cache-control': 'no-cache',