【问题标题】:LinkedIn-API r_emailaddress not retruning emailLinkedIn-API r_emailaddress 不返回电子邮件
【发布时间】:2022-02-07 08:29:10
【问题描述】:

我正在使用linkedin Oauth API(我的应用程序完全正常工作并使用范围r_emailaddress正确设置)并且我似乎无法返回电子邮件,我可以使用curl返回它但不能使用我的代码,

const userEmail = await fetch("https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~))", {
            method: "GET",
            headers: {
                "Authorization": "Bearer " + accessToken,
                "Accept": "application/json"
            }
        });
        const userMail = await userEmail.json();
        console.log(userMail)

此代码返回elements: [ { 'handle~': [Object], handle: 'urn:li:emailAddress:8238802378' } ]

应该"elements": [{"handle~": {"emailAddress": "example.dev@gmail.com"},"handle": "urn:li:emailAddress:8238802378"}]

【问题讨论】:

    标签: node.js oauth-2.0 linkedin-api


    【解决方案1】:

    哈哈,这解决了它userMail.elements[0]["handle~"].emailAddress,感谢 Xrysh✅

    【讨论】:

      猜你喜欢
      • 2023-03-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-29
      • 1970-01-01
      • 2020-06-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多