@abtasty-innovation/abtasty-api 中文文档教程
AB Tasty Innovation
AB Tasty API package
Authentication :
如果您已经有了访问令牌
const abtasty = require("abtasty-api")();
await abtasty.setToken('USER TOKEN');
如果想使用用户凭据登录
const abtasty = require("abtasty-api")();
await abtasty.logAsUser(client_id, client_secret, grant_type, username, password);
如果想使用服务帐户登录
const abtasty = require("abtasty-api")();
await abtasty.logAsService(client_id, client_secret, grant_type);
Usage:
// See Authentication section before.
abtasty.account.get.all()
.then((response) => {
console.log(response);
})
.catch((error) => {
console.log(error);
});
Available methods:
abtasty.account.get.all()
=> Get all accounts linked to this userabtasty.account.get.one(account_id)
=> Get one accountabtasty.account.rights.all(account_id)
=> Get rights for an accountabtasty.account.current()
=> Get current accountabtasty.account.additional_information.get.all(account_id)
=> Get all additional informationabtasty.account.additional_information.get.one(account_id, key)
=> Get one additional information per keyabtasty.account.additional_information.create.post(account_id, body)
=> Create an additional informationabtasty.account.additional_information.create.patch(account_id, infoId, body)
=> Patch a given additional informationabtasty.account.test.get.all(account_id)
=> Get all test for an account idabtasty.account.test.get.one(account_id, test_id)
=> Get one testabtasty.account.test.variation.get.all(account_id, test_id)
=> Get all variations for a testabtasty.account.test.variation.get.one(account_id, test_id, variation_id)
=> Get one variationabtasty.profile.get()
=> Get logged user profile
Author : Elias Cédric Laouiti @eliaslaouiti elias@abtasty.com
AB Tasty Innovation
AB Tasty API package
Authentication :
If you already have an access token
const abtasty = require("abtasty-api")();
await abtasty.setToken('USER TOKEN');
If want to log in with user credentials
const abtasty = require("abtasty-api")();
await abtasty.logAsUser(client_id, client_secret, grant_type, username, password);
If want to log in with service account
const abtasty = require("abtasty-api")();
await abtasty.logAsService(client_id, client_secret, grant_type);
Usage:
// See Authentication section before.
abtasty.account.get.all()
.then((response) => {
console.log(response);
})
.catch((error) => {
console.log(error);
});
Available methods:
abtasty.account.get.all()
=> Get all accounts linked to this userabtasty.account.get.one(account_id)
=> Get one accountabtasty.account.rights.all(account_id)
=> Get rights for an accountabtasty.account.current()
=> Get current accountabtasty.account.additional_information.get.all(account_id)
=> Get all additional informationabtasty.account.additional_information.get.one(account_id, key)
=> Get one additional information per keyabtasty.account.additional_information.create.post(account_id, body)
=> Create an additional informationabtasty.account.additional_information.create.patch(account_id, infoId, body)
=> Patch a given additional informationabtasty.account.test.get.all(account_id)
=> Get all test for an account idabtasty.account.test.get.one(account_id, test_id)
=> Get one testabtasty.account.test.variation.get.all(account_id, test_id)
=> Get all variations for a testabtasty.account.test.variation.get.one(account_id, test_id, variation_id)
=> Get one variationabtasty.profile.get()
=> Get logged user profile