You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在使用API Key时开启账户信息访问权限?Django示例权限咨询

Answers to Your Evernote API Permission Questions

Hey there! Since both your questions revolve around getting access to account-level data via the Evernote API, let's tackle them together step by step:

1. Enabling Account Info Access for Your API Key

To grant your app permission to pull account details like bandwidth limits or billing cycle dates, you need to configure this in the Evernote Developer Console:

  • Log into your Evernote developer account and navigate to your registered application.
  • Look for the Permissions section (usually under "App Settings" or "API Configuration").
  • Find and enable the specific permission for account information—this is typically labeled account_info (Evernote's API scopes use this identifier for accessing user account metadata).
  • Save your changes. Note that updating permissions might require you to re-authenticate any existing users, since their previous grants won't include the new scope.

2. Requesting Account Info Permissions in the Django Example

The Evernote Python SDK's Django sample uses OAuth for authorization, so you'll need to explicitly include the account_info scope when generating the authorization URL. Here's how to adjust the code:

  • Locate the part of the Django view where you create the Evernote OAuth client or generate the authorization redirect.
  • When setting the scope parameter, add account_info to the existing scope list. For example, if the original code uses:
    scope = "basic"
    
    Update it to:
    scope = "basic,account_info"
    
  • When users are redirected to the Evernote authorization page, they'll now see your app requesting access to their account information alongside any other scopes you've enabled.
  • Once the user authorizes your app, you can use the Evernote UserStore API to fetch the account details you need. For example:
    from evernote.api.client import EvernoteClient
    
    client = EvernoteClient(token=user_auth_token, sandbox=True)
    user_store = client.get_user_store()
    user = user_store.getUser()
    # Access account details like remaining bandwidth
    remaining_bandwidth = user.remainingBandwidth
    cycle_start = user.billingCycleStart
    

Just a quick note: Make sure you're using the correct environment (sandbox vs production) in your client setup, as permissions and API endpoints can differ between the two.

内容的提问来源于stack exchange,提问作者user7433432

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 12:04:08