0

我需要使用 Web API 在交叉引用字段中获取记录的 ID。是否有解决此类任务的 API 方法?或者至少我想知道,如何获取特定字段的值?

文档中描述了许多不同的方法来操作列表字段(例如GetValuesListValue),我想知道是否有相同的方法来解决我的任务。我可以使用ExecuteSeach方法,但不是很方便。

4

1 回答 1

1

Alexander,您可以使用 REST 或 Webservices API。

REST API

使用通过 id 获取内容,/api/core/content/*contentid* 然后您可以通过 OData 通过在正文中传递以下内容来获取字段(id)内容 {"Value":"?$filter=FieldId eq '*field id of cross-reference field*'"}

网络服务 API

您可以通过以下方式调用 /ws/record.asmx GetRecordById

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetRecordById xmlns="http://archer-tech.com/webservices/">
      <sessionToken>session token</sessionToken>
      <moduleId>int</moduleId>
      <contentId>int</contentId>
    </GetRecordById>
  </soap:Body>
</soap:Envelope>

然后,您必须遍历返回的 XML 以获取字段内容。

于 2019-05-28T11:49:59.783 回答