ARAS RESTful API: How do I get a list of all generations for a part?

I'm attempting to get a full part history (14 generations worth) of a part.  I know the config_id is a value shared between all 14 parts; however, I can't seem to construct the REST call to return all 14 records using the config_id.

I get the config_id with ... GET {base url}/Part('<id>')/config_id/id/$value

Then I tried using the config_id in a filter like this ... GET {base url}/Part?$config_id eq '<config_id>'  That just returned one part record, the latest one.

Using the config_id is what I would have done using an AML query, but is there another way with the REST API?

I'm running Aras Innovator 11.0 SP12

  • I am not sure how this is done in REST. But your use case describes a typical Innovator behavior. When you just query for config_id, you will only get the latest version. 

    Try to add an additional Filter for <id condition="is not null"/> . 

    Would be cool if you can share the final result!

  •  GET {base url}/Part?$config_id eq '<config_id>' and id is not null

    {
        "error": {
            "code""NotImplemented",
            "message""Binary operation is not implemented"
        }
    }
    Can anyone confirm if this functionality is in Aras Innovator 12's Restful API??
  • I have to check but I think we finally choose the SOAP to get all generation since the rest was only providing

    - a specific version if you ask with the id or the generation number

    - or by default the latest  generation like in your case.

    Best regards

    Hadrien

  • Hello,

    When querying for items in Aras Innovator, only the most recent item is returned by default. In AML, you can bypass this check by including the generation property in your AML search like the query below.

    <AML>
      <Item type="Part" action="get">
        <config_id>B9F8E908144948E48A1747AD88716D02</config_id>
        <generation condition="gt">0</generation>
      </Item>
    </AML>

    Note that the generation property needs to be included in the body of the AML request. Including it in a where attribute would not result in all generations of the item being returned. I've tried adding generation to the $filter attribute of a REST call, and I was unable to get multiple versions of the item to return. It seems that the $filter attribute is treated much like the where attribute of an AML call. This means that it's not currently possible to return multiple versions of an item through a pure REST request.

    With that explanation, there is an alternative solution that you could use. You could write a server method that would build a query like the one I mentioned above that includes generation as a property. You could then call that server method via REST in order to get multiple versions of the item.


    Chris

    Christopher Gillis

    Aras Labs Software Engineer

  • Hello,

    It work on 11.0 SP15, I Can't test on SP12

    use GET {base url}/Part?$filter=generation gt 0 or GET {base url}/Part?$filter=id ne null

    With a body  : "config_id" : "<config_id>"}

  • That did it!  All the documentation I found didn't include any guidance on putting anything in the BODY of the RESTful GET message.  A POST needed inputs in the body (obviously) if you are creating something, but not for the GET.

    Did you find this documented somewhere or were you just experimenting?  I had resigned to creating a server method, but this is the actual answer.  Thank you!

  • Only experimentation, sure this is not a supported feature.