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

Parents
  • 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

Reply
  • 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

Children
No Data