单个 REST 调用中的数据导出

在本例中,你将探索如何通过基于 REST 契约的 API 在一次调用中从 Acumatica ERP 导出以下数据:

  • 应用程序中存在的所有库存项目
  • IN 类型的所有销售订单

如果你需要从 Acumatica ERP 导出记录,请使用以下 URL:http://<Acumatica ERP instance URL>/entity/<Endpoint name>/<Endpoint version>/<Top-level entity>

<Top-level entity> 是你要导出的实体的名称

要在单个 REST 调用中导出所有库存项目:

要使用版本 6.00.001默认端点从本地 AcumaticaERP 实例导出库存项目记录,你应使用以下 URL:http://localhost/AcumaticaERP/entity/Default/6.00.001/StockItem ******

下面是用 C#编写的示例代码,用于通过向版本 6.00.001默认端点发送单个 REST 调用来导出所有库存项 : ******

using (RestService rs = new RestService(
    @"http://localhost/AcumaticaERP/", "Default/6.00.001",
    username, password, company, branch))
{
    string stockItems = rs.GetList("StockItem");
}

要在单个 REST 调用中导出 IN 类型的所有销售订单:

要使用版本 6.00.001默认端点从本地 AcumaticaERP 实例导出 IN 类型的销售订单,你应使用以下 URL:http://localhost/AcumaticaERP/entity/Default/6.00.001/SalesOrder?$filter=OrderType eq 'IN' ****** ******

下面是用 C#编写的示例代码,通过向版本 6.00.001默认端点发送单个 REST 调用来导出 IN 类型的所有销售订单 : ****** ******

using (RestService rs = new RestService(
    @"http://localhost/StackOverflow/", "Default/6.00.001",
    username, password, company, branch))
{
    var parameters = "$filter=OrderType eq 'IN'";
    string inSalesOrders = rs.GetList("SalesOrder", parameters);
}