indirect document search using the REST API

I'm not sure what I'm doing wrong, I've got an object type "Contract" with then there is Contract Type which is an attribute of Contract.

If I wanted to return all of the documents where the contract type is 5 as an example, would I use something like this:

/REST/objects/0?limit=20&p1027.p1039=5

Where 0 is the document class,

1027 is the property of Contract

and Contract type's property is 1039.

This is not throwing any errors, just not returning results when I know that there are documents.

Parents
  • Hi there Johan,

    Are you set on using that way of filtering out results or are you open to trying something different because the way my co-workers and I have done it is by using filters like this for example

    string result = "";
    using (var client = new HttpClient())
    {
    client.BaseAddress = new Uri(baseUrl);
    client.DefaultRequestHeaders.Add("X-Authentication", GetSessionTokenAsync());

    var filters = new[]
    {
    new {
    PropertyDef = {Your Definition},
    TypedValue = new {
    DataType = {Your DataType},
    Lookup = new { Item = {Your lookup item id} }
    },
    ConditionType = 1
    }
    };
    string url = $"{baseUrl}/objects/{Your Object ID}/search";
    var response = client.PostAsJsonAsync(url, filters).Result;
    result = response.Content.ReadAsStringAsync().Result;

    Right now that's only code to get objects based on a property but I'm pretty sure, if adjusted, it should get the results you are looking for.

  • Thanks for this Bryce, I'll try your suggestion out.

Reply Children
No Data