Back to Aligni.com

GET /api/v2/:api_token/parts/:part_id/revisions/:id
Show the part revision.

Retrieve one particular part revision.

Examples

# request
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/parts/728/revisions/231
# response
<part_revision>
  <id>206</id>
  <revision_name>A</revision_name>
  <revision_description/>
  <creator_id>8</creator_id>
  <released_at>2016-01-24 20:11:47 -0800</released_at>
  <releasor_id>8</releasor_id>
  <comment></comment>
  <description>Assembly to test unit handling</description>
  <rohs>1</rohs>
  <status>Active</status>
  <x_mass value_text="3.5">3.5</x_mass>
  <part>
    <id>761</id>
    <partnumber>000226</partnumber>
    <manufacturer_pn>ASSY-TESTUNITS</manufacturer_pn>
    <manufacturer_id>170</manufacturer_id>
    <parttype_id>55</parttype_id>
    <value/>
    <value_text></value_text>
    <created_on>2011-11-10 18:03:19 -0800</created_on>
    <updated_on>2015-02-28 15:02:26 -0800</updated_on>
    <inventory_price>10.0</inventory_price>
    <reorder_quantity>100</reorder_quantity>
    <inventory_maximum>110</inventory_maximum>
  </part>
  <subparts>
    <subpart>
      <id>100</id>
      <part_id>565</part_id>
      <part_revision_id>206</part_revision_id>
      <quantity>3</quantity>
      <comment></comment>
      <designator>C1, C2, C3</designator>
      <no_load>false</no_load>
      <position>1</position>
    </subpart>
    ...
  </subparts>
</part_revision>

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
id
required

Revision ID


Value: Must be a number.
part_id
required

ID of the part to which the part revision belongs.


Value: Must be a number.

GET /api/v2/:api_token/parts/:part_id/revisions/:id/part_ancestors
List part revision's part ancestors.

Retrieve the list of all part ancestors for a part revision.

Examples

# request
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/parts/728/revisions/231/part_ancestors

# response
<part_ancestors>
  <part>
    <id>747</id>
    <partnumber>000211</partnumber>
    <manufacturer_pn>FPGA-1200-v1</manufacturer_pn>
  </part>
  ...
</part_ancestors>

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
id
required

Revision ID


Value: Must be a number.
part_id
required

ID of the part to which the part revision belongs.


Value: Must be a number.

POST /api/v2/:api_token/parts/:part_id/revisions/:id/subparts
Add subparts to the part revision.

Add parts to a part revision as subparts. Subparts can only be added to draft part revisions. Requires the permission to create draft part revisions.

Examples

# request
curl -X POST -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d "
<part_revision>
  <remove_existing>true</remove_existing>
  <subparts type='array'>
    <subpart>
      <subpart_id>728</subpart_id>
      <quantity>2</quantity>
      <build_sequence>1</build_sequence>
      <designator>A1, A2</designator>
      <no_load>true</no_load>
      <comment>Base of enclosure.</comment>
    </subpart>
    <subpart>
      <subpart_id>754</subpart_id>
      <subpart_part_revision_id>199</subpart_part_revision_id>
      <quantity>4</quantity>
      <build_sequence>2</build_sequence>
      <designator>B1</designator>
      <no_load>false</no_load>
      <comment>Lid for enclosure.</comment>
    </subpart>
  </subparts>
</part_revision>" \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/parts/764/revisions/210/subparts

# success response
<?xml version="1.0" encoding="UTF-8"?>
<part_revision>
  <id>210</id>
  <revision_name>A</revision_name>
  <revision_description></revision_description>
  <creator_id>9</creator_id>
  <released_at>2016-01-28 20:11:47 -0800</released_at>
  <releasor_id>9</releasor_id>
  <comment>SM-0603, 1%, 1/10W</comment>
  <description>Thick-film resistor</description>
  <rohs>1</rohs>
  <status>Active</status>
  <x_package/>
  <x_packaging>Tape and Reel</x_packaging>
  <x_tolerance>1.0</x_tolerance>
  <x_mass value_text="6 m">0.006</x_mass>
  <x_schematic_symbol>Resistor</x_schematic_symbol>
  <x_serialized>false</x_serialized>
  <x_pcb_footprint_1>RESC1608N</x_pcb_footprint_1>
  <x_power value_text=""/>
  <x_pcb_footprint_2>Digikey website | http://www.digikey.com</x_pcb_footprint_2>
  <x_pcb_footprint_3/>
  <x_link/>
  <x_lifecycle_status/>
  <part>
    <id>764</id>
    <partnumber>000229</partnumber>
    <manufacturer_pn>CRCW060344K2FKEA</manufacturer_pn>
    <manufacturer_id>152</manufacturer_id>
    <parttype_id>48</parttype_id>
    <value>44200.0</value>
    <value_text>44.2 k</value_text>
    <created_on>2015-02-28 15:07:57 -0800</created_on>
    <updated_on>2017-08-05 16:58:34 -0700</updated_on>
    <inventory_price>0.0011</inventory_price>
    <estimated_cost>0.0011</estimated_cost>
    <estimated_cost_currency>USD</estimated_cost_currency>
    <reorder_quantity></reorder_quantity>
    <inventory_maximum></inventory_maximum>
    <preferred_vendor>Digi-Key</preferred_vendor>
  </part>
  <subparts>
    <subpart>
      <id>231</id>
      <part_id>728</part_id>
      <part_revision_id>171</part_revision_id>
      <quantity>2</quantity>
      <build_sequence>1</build_sequence>
      <comment>Base of enclosure.</comment>
      <designator>A1, A2</designator>
      <no_load>true</no_load>
      <position>1</position>
    </subpart>
    <subpart>
      <id>232</id>
      <part_id>754</part_id>
      <part_revision_id>199</part_revision_id>
      <quantity>4</quantity>
      <build_sequence>2</build_sequence>
      <comment>Lid for enclosure.</comment>
      <designator>B1</designator>
      <no_load>false</no_load>
      <position>2</position>
    </subpart>
  </subparts>
</part_revision>

# example error response #1
<?xml version="1.0"?>
<subparts type="array">
  <subpart>
    <number>1</number>
    <errors type="array">
      <error>Quantity must be nonnegative.</error>
    </errors>
  </subpart>
  <subpart>
    <number>2</number>
    <errors type="array">
      <error>You must specify a valid subpart.</error>
      <error>Must belong to a valid subpart part revision.</error>
    </errors>
  </subpart>
</subparts>

# example error response #2
<?xml version="1.0"?>
<errors type="array">
  <error>No subparts specified.</error>
</errors>

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
part_id
required

Part revision part ID.


Value: Must be a number.
id
required

Part revision ID.


Value: Must be a number.
remove_existing
optional

Remove existing subparts on the part revision.


Value: Must be one of: <code>true</code>, <code>false</code>.
subparts
optional

An array of subpart attributes.


Value: Must be an Array of nested elements
subparts[subpart]
required

Value: Must be a Hash
subparts[subpart][subpart_id]
required

ID of the part being added to the part revision as a subpart.


Value: Must be a number.
subparts[subpart][subpart_part_revision_id]
optional

ID of the part revision of the part being added to the part revision as a subpart. Defaults to the active revision if not specified.


Value: Must be a number.
subparts[subpart][quantity]
required

Quantity. Must be a non-negative number.


Value: Must be a number.
subparts[subpart][build_sequence]
optional

Build sequence.


Value: Must be a number.
subparts[subpart][designator]
optional

Designator(s).


Value: Must be a String
subparts[subpart][no_load]
optional

Don't include the subpart on cost sheet, short list, or computations.


Value: Must be one of: <code>true</code>, <code>false</code>.
subparts[subpart][comment]
optional

Comment.


Value: Must be a String

GET /api/v2/:api_token/parts/:part_id/revisions
List part revisions.

Retrieve the list of all part revisions.

Examples

# request
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/parts/754/revisions

# response
<part_revisions>
  <part_revision>
    <id>206</id>
    <revision_name>A</revision_name>
    <revision_description/>
    <creator_id>8</creator_id>
    <released_at>2016-01-24 20:11:47 -0800</released_at>
    <releasor_id>8</releasor_id>
    <comment></comment>
    <description>Assembly to test unit handling</description>
    <rohs>1</rohs>
    <status>Active</status>
    <x_mass value_text="3.5">3.5</x_mass>
  </part_revision>
  <part_revision>
    ...
  </part_revision>
</part_revisions>

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
part_id
required

Revisions for this part will be listed.


Value: Must be a number.

POST /api/v2/:api_token/parts/:part_id/revisions?id=:source_part_revision_id
Create a new part revision.

Create a new part revision.

Examples

# request
curl -X POST -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d "
<part_revision>
  <revision_name>A05</revision_name>
  <revision_description>A05 modified</revision_description>
</part_revision>" \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/parts/754/revisions?id=199&copy_subparts=false

# response (For detailed part revision XML see the index action.)
<part_revision>
  ...
</part_revision>

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
part_id
required

New revision will be created for this part.


Value: Must be a number.
source_part_revision_id
required

New revision will be based on this one.


Value: Must be a number.
copy_subparts
optional

Copy the subparts from the source revision. Defaults to 'true'.


Value: Must be one of: <code>true</code>, <code>false</code>.

POST /api/v2/:api_token/parts/:part_id/revisions/:id/release
Release a part revision.

Release a part revision.

In XML request revision_name and revision_description are optional. Set them only if you want to modify name and description.

For inventory_units you can specify either 'keep' or 'dispose' for action to be taken on particular inventory_unit with an optional comment in case of 'dispose'. inventory_units that are not explicitly specified in the request will be automatically marked as 'keep'.

For part_ancestors you can specify either 'up' (up revision) or 'keep' for action to be taken on particular part_ancestor. part_ancestors that are not explicitly specified in the request will be automatically marked as 'up'.

Examples

# request
curl -X POST -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d "
<part_revision>
  <revision_name>B</revision_name>
  <revision_description>Rev B has some improvements</revision_description>
  <inventory_units>
    <inventory_unit>
      <id>52</id>
      <action>dispose</action>
      <disposition_comment>Reason for dispose</disposition_comment>
    </inventory_unit>
  </inventory_units>
  <part_ancestors>
    <part_ancestor>
      <id>25</id>
      <action>keep</action>
    </part_ancestor>
    <part_ancestor>
      <id>143</id>
      <action>keep</action>
    </part_ancestor>
  </part_ancestors>
</part_revision>" \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/parts/728/revisions/231/release

# no response
# request with bypass_part_ancestor_up_rev_guard when up-reving a part ancestor
curl -X POST -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d "
<part_revision>
  <revision_name>BBC</revision_name>
  <revision_description>Rev B has some improvements</revision_description>
    <part_ancestors>
    <part_ancestor>
      <id>105</id>
      <action>up</action>
    </part_ancestor>
  </part_ancestors>
</part_revision>" \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/parts/755/revisions/214/release?bypass_part_ancestor_up_rev_guard=true

# no response

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
id
required

ID of a revision to be released.


Value: Must be a number.
part_id
required

Release a revision belonging to this part.


Value: Must be a number.
bypass_part_ancestor_up_rev_guard
optional

If added to the URI it will allow up-rev of part ancestors.


Value: Must be a String

DELETE /api/v2/:api_token/parts/:part_id/revisions/:id
Delete a part revision.

Delete a part revision by its id and part's id.

Examples

# request
curl -X DELETE -H 'Accept: application/xml' -H 'Content-Type: application/xml' \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/parts/754/revisions/229

# no response

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
id
required

ID of a revision to be deleted.


Value: Must be a number.
part_id
required

Delete a revision belonging to this part.


Value: Must be a number.