获取 API 令牌
要获取一个API,你需要注册你的App并获取一个令牌。 为此,请使用/api/v1/apps API (无需令牌即可访问) 创建一个新应用。将结果储存在别处以备后用。
然后使用以下参数向/api/v1/oath2发送一个请求:
client_id,你的客户端ID。client_secret,你的客户端密码。scopes, the scopes you want to access. They are separated by+, and can either beread(global read),write(global write),read:SCOPE(read only inSCOPE), orwrite:SCOPE(write only inSCOPE).usernamethe username (not the email, display name nor the fully qualified name) of the user using your app.password, the password of the user.
Plume will respond with something similar to:
{
"token": "<YOUR TOKEN HERE>"
}
To authenticate your requests you should put this token in the Authorization header:
Authorization: Bearer <YOUR TOKEN HERE>