如何从 NetSuite API 获取 NetSuite 帐户元数据?
How to get the NetSuite account meta-data from the NetSuite API?
我有一个分析应用程序,人们可以在其中插入他们的 NetSuite 帐户。理想情况下,我还会检索有关 NetSuite 帐户本身的一些元数据(例如:公司名称等),以使分析结果更具可读性。
NetSuite SuiteTalk SOAP API 是否提供检索有关 NetSuite 帐户本身的元数据的可能性?
NetSuite 提供了一个角色服务,其中包含一些关于帐户的非常有限的元数据(名称和 ID)。请参阅标题为“Using the REST roles Service to Get User Accounts, Roles, and Domains”的帮助文档。
是的,您可以使用配置APIs
获取大部分公司信息
var companyinfo = nlapiLoadConfiguration('companyinformation');
var companyName = companyInfo.getFieldValue('companyname');
有关完整可用字段的列表,请阅读 "Preference Names and IDs"
编辑:
因为在 SuiteTalk API 中,没有特定的 API 来获取公司信息。我建议使用上面的代码编写一个 RESTlet,然后在您的 Analytics 应用程序中通过 HTTPS 访问它。如果您的应用程序必须支持多个 NetSuite 帐户,您可能需要捆绑您的 RESTlet。
以防万一有人需要获得公司名称,我花了好几天才弄明白,所以我分享一下。您可以使用此处定义的令牌信息端点 https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/chapter_157017286140.html
Calling a token endpoint to obtain user information based on a token
The tokeninfo endpoint returns information about a user based on the access token. The endpoint is https://{accountID}.restlets.api.netsuite.com/rest/tokeninfo, where is a variable for the company’s account ID. A response to a GET request contains data in JSON format, including information such as: Company Name, Company ID (account ID), Role Name, Role ID, Entity ID
我有一个分析应用程序,人们可以在其中插入他们的 NetSuite 帐户。理想情况下,我还会检索有关 NetSuite 帐户本身的一些元数据(例如:公司名称等),以使分析结果更具可读性。
NetSuite SuiteTalk SOAP API 是否提供检索有关 NetSuite 帐户本身的元数据的可能性?
NetSuite 提供了一个角色服务,其中包含一些关于帐户的非常有限的元数据(名称和 ID)。请参阅标题为“Using the REST roles Service to Get User Accounts, Roles, and Domains”的帮助文档。
是的,您可以使用配置APIs
获取大部分公司信息var companyinfo = nlapiLoadConfiguration('companyinformation');
var companyName = companyInfo.getFieldValue('companyname');
有关完整可用字段的列表,请阅读 "Preference Names and IDs"
编辑:
因为在 SuiteTalk API 中,没有特定的 API 来获取公司信息。我建议使用上面的代码编写一个 RESTlet,然后在您的 Analytics 应用程序中通过 HTTPS 访问它。如果您的应用程序必须支持多个 NetSuite 帐户,您可能需要捆绑您的 RESTlet。
以防万一有人需要获得公司名称,我花了好几天才弄明白,所以我分享一下。您可以使用此处定义的令牌信息端点 https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/chapter_157017286140.html
Calling a token endpoint to obtain user information based on a token The tokeninfo endpoint returns information about a user based on the access token. The endpoint is https://{accountID}.restlets.api.netsuite.com/rest/tokeninfo, where is a variable for the company’s account ID. A response to a GET request contains data in JSON format, including information such as: Company Name, Company ID (account ID), Role Name, Role ID, Entity ID