Back to Aligni.com

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

Retrieve the list of all parts.

Deprecation Warning

In this version, comment, description, and rohs attributes are populated in the part object from the active revision of the part. This behavior is for API v1 compatibility only and will be removed from the next version of the API. These attributes should be taken from the active_revision object instead.

Examples

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

# Pagination
# The pagination information is included in the response X-Pagination
# header.
# {"total_entries":0,"total_pages":0,"per_page":25,"current_page":1,"first_page":true,"last_page":true,"previous_page":null,"next_page":null,"out_of_range":true}
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/part?page=1&per_page=25

# Filtering
# Currently, filtering functionality is limited to the "updated_on" field and "gte"
# (greater than or equal to) operator for list parts. This returns all parts updated on
# or after an ISO8601-formatted date is appended to the URL request.
# Note: the ISO8601 date string must be properly encoded to form a compatible URI as shown in the example.
# Specifically, + must be replaced with %2B and : must be replaced with %3A.
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/part?filter[updated_on][gte]=2019-10-02T11:15:28-07:00

# response
<parts>
  <part>
    <id>728</id>
    <partnumber>000019</partnumber>
    <manufacturer_pn>C0603C104K4RACTU</manufacturer_pn>
    <manufacturer_id>147</manufacturer_id>
    <parttype_id>47</parttype_id>
    <unit_id>2</unit_id>
    <comment>SM-0603, 10%, 16v, X7R</comment>
    <description>Ceramic capacitor</description>
    <value>1.0e-07</value>
    <value_text>0.1 u</value_text>
    <rohs>1</rohs>
    <created_on>2006-01-24 23:11:47 -0500</created_on>
    <updated_on>2018-04-10 16:41:55 -0500</updated_on>
    <inventory_price>0.009</inventory_price>
    <estimated_cost>0.009</estimated_cost>
    <estimated_cost_currency>USD</estimated_cost_currency>
    <reorder_quantity>12000.00</reorder_quantity>
    <inventory_maximum></inventory_maximum>
    <preferred_vendor_id/>
    <manufactured_here>false</manufactured_here>
    <active_revision>
      <id>171</id>
      <revision_name>A</revision_name>
      <revision_description></revision_description>
      <comment>SM-0603, 10%, 16v, X7R</comment>
      <description>Ceramic capacitor</description>
      <rohs>1</rohs>
      <x_package>0603</x_package>
      <x_tolerance>10.0</x_tolerance>
      <x_packaging>Tape and Reel</x_packaging>
      <x_schematic_symbol>Capacitor</x_schematic_symbol>
      <x_temperature-characteristic>X7R</x_temperature-characteristic>
      <x_serialized>true</x_serialized>
      <x_pcb_footprint_2/>
      <x_mass value_text="9 m">0.009</x_mass>
      <x_pcb_footprint_3/>
      <x_pcb_footprint_1>CAPC1608N</x_pcb_footprint_1>
      <x_height/>
      <x_link/>
      <x_lifecycle_status>End of Life</x_lifecycle_status>
    </active_revision>
    <part_visibility_set>
      <id>1</id>
      <name>Watch Parts<name/>
      <description/>
      <short_name/>
      <position/>
    </part_visibility_set>
  </part>
  <part>
    <id>730</id>
    <partnumber>000095</partnumber>
    <manufacturer_pn>RC0603JR-07680KL</manufacturer_pn>
    <manufacturer_id>156</manufacturer_id>
    <parttype_id>48</parttype_id>
    <unit_id>2</unit_id>
    <comment>SMD-0603, 5%, 1/10W</comment>
    <description>Thick-film resistor</description>
    <value>680000.0</value>
    <value_text>680 k</value_text>
    <rohs>1</rohs>
    <created_on>2006-01-24 23:11:38 -0500</created_on>
    <updated_on>2014-10-23 11:20:33 -0500</updated_on>
    <inventory_price/>
    <estimated_cost/>
    <estimated_cost_currency>USD</estimated_cost_currency>
    <reorder_quantity></reorder_quantity>
    <inventory_maximum></inventory_maximum>
    <preferred_vendor_id/>
    <manufactured_here>false</manufactured_here>
    <x_outsourced>false</x_outsourced>
    <x_outsourcing_location/>
    <active_revision>
      <id>173</id>
      <revision_name>A</revision_name>
      <revision_description/>
      <comment>SMD-0603, 5%, 1/10W</comment>
      <description>Thick-film resistor</description>
      <rohs>1</rohs>
      <x_package/>
      <x_tolerance>5.0</x_tolerance>
      <x_packaging/>
      <x_power value_text="100 m">0.1</x_power>
      <x_schematic_symbol/>
      <x_serialized>false</x_serialized>
      <x_pcb_footprint_2/>
      <x_mass value_text="6 m">0.006</x_mass>
      <x_pcb_footprint_3/>
      <x_pcb_footprint_1/>
      <x_link/>
      <x_lifecycle_status/>
    </active_revision>
    <part_visibility_set>
      <id>2</id>
      <name>Partners<name/>
      <description/>
      <short_name/>
      <position/>
    </part_visibility_set>
  </part>
  ...
</parts>

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
page
optional

Fetch requested page.


Value: Must be a Integer
per_page
optional

Fetch a specific number of entries per page.


Value: Must be a Integer

GET /api/v2/:api_token/part/:id
Show a part.

Retrieve one particular part by its id or partnumber. When using a partnumber, replace

url :id with :partnumber and append the url with find_by=partnumber query.

Examples

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

# You can specify the part revision by adding revision_id to the URL request.
# If no part revision is specified the active part revision is used.
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/part/728?revision_id=171

# You can find a part by :partnumber.
# Replace :id with :partnumber and append ?find_by=partnumber to the URL.
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/part/000019?find_by=partnumber&revision_id=171

# response
<?xml version="1.0" encoding="UTF-8"?>
<part>
  <id>728</id>
  <partnumber>000019</partnumber>
  <manufacturer_pn>C0603C104K4RACTU</manufacturer_pn>
  <manufacturer_id>147</manufacturer_id>
  <parttype_id>47</parttype_id>
  <unit_id>42</unit_id>
  <value>1.0e-07</value>
  <value_text>0.1 u</value_text>
  <created_on>2006-01-24 20:11:47 -0800</created_on>
  <updated_on>2014-09-05 01:55:22 -0700</updated_on>
  <inventory_price>0.009</inventory_price>
  <reorder_quantity>12000.0</reorder_quantity>
  <inventory_maximum>13000.0</inventory_maximum>
  <preferred_vendor_id>3</preferred_vendor_id>
  <manufactured_here>true</manufactured_here>
  <x_outsourced>false</x_outsourced>
  <x_outsourcing_location/>
  <revision>
    <id>171</id>
    <revision_name>A</revision_name>
    <revision_description/>
    <comment/>
    <description/>
    <rohs>1</rohs>
    <x_tolerance>10.0</x_tolerance>
    <x_package>0603</x_package>
    <x_packaging>Tape and Reel</x_packaging>
    <x_temperature-characteristic>X7R</x_temperature-characteristic>
    <x_mass value_text="6 m">0.006</x_mass>
    <x_schematic_symbol>Capacitor</x_schematic_symbol>
    <x_pcb_footprint_1>CAPC1608N</x_pcb_footprint_1>
    <x_pcb_footprint_2/>
    <x_pcb_footprint_3/>
  </revision>
  <part_visibility_set>
    <id>1</id>
    <name>Watch Parts<name/>
    <description/>
    <short_name/>
    <position/>
  </part_visibility_set>
  <quotes>
    <quote>
      <id>162</id>
      <vendor_id>41</vendor_id>
      <price>0.0035</price>
      <quantity_min>4000</quantity_min>
      <quantity_mult>4000</quantity_mult>
      <leadtime>2</leadtime>
      <updated_on>2006-11-29 20:30:46 -0800</updated_on>
      <expires_on/>
      <unit_id>1</unit_id>
      <unit_conversion_id>1</unit_conversion_id>
      <inventory>10</inventory>
      <comment>New</comment>
      <currency>USD</currency>
    </quote>
  </quotes>
  <vendor_part_numbers>
    <vendor_part_number>
      <vendor_id>40</vendor_id>
      <part_number>399-1096-2-ND</part_number>
      <comment>4000-pc Tape &amp; Reel</comment>
    </vendor_part_number>
    <vendor_part_number>
      <vendor_id>40</vendor_id>
      <part_number>399-1096-1-ND</part_number>
      <comment>Cut tape</comment>
    </vendor_part_number>
  </vendor_part_numbers>
  <alternate_parts>
    <alternate_part>
      <part_id>748</part_id>
      <comment></comment>
      <quality>100</quality>
    </alternate_part>
    <alternate_part>
      <part_id>749</part_id>
      <comment></comment>
      <quality>100</quality>
    </alternate_part>
  </alternate_parts>
  <inventory_units>
    <inventory_unit>
      <id>52</id>
      <quantity>3600</quantity>
      <inventory_location_id>1</inventory_location_id>
      <inventory_location_name>Headquarters</inventory_location_name>
      <inventory_sublocation_id>2</inventory_sublocation_id>
      <inventory_sublocation_name>Bin 10</inventory_sublocation_name>
      <sublocation_bin>Safe</sublocation_bin>
      <purchase_order_id>2</purchase_order_id>
    </inventory_unit>
    <inventory_unit>
      <id>104</id>
      <quantity>1275</quantity>
      <inventory_location_id>2</inventory_location_id>
      <inventory_location_name>Funtronics</inventory_location_name>
      <inventory_sublocation_id>15</inventory_sublocation_id>
      <inventory_sublocation_name>General Storage</inventory_sublocation_name>
      <sublocation_bin>Safe</sublocation_bin>
      <purchase_order_id>15</purchase_order_id>
    </inventory_unit>
  </inventory_units>
  <partlist_parts>
    <partlist_part>
      <part_id>744</part_id>
      <part_revision_id>171</part_revision_id>
      <quantity>4</quantity>
      <comment></comment>
      <no_load>false</no_load>
    </partlist_part>
    <partlist_part>
      <part_id>747</part_id>
      <part_revision_id>171</part_revision_id>
      <quantity>6</quantity>
      <comment></comment>
      <no_load>false</no_load>
    </partlist_part>
  </partlist_parts>
  <subparts>
    <subpart>
      <id>103</id>
      <part_id>741</part_id>
      <part_revision_id>197</part_revision_id>
      <quantity>1</quantity>
      <comment>PCB assembly</comment>
      <designator/>
      <no_load>false</no_load>
      <position>1</position>
    </subpart>
    <subpart>
      <id>104</id>
      <part_id>745</part_id>
      <part_revision_id>197</part_revision_id>
      <quantity>1</quantity>
      <comment>Electrical testing</comment>
      <designator></designator>
      <no_load>false</no_load>
      <position>2</position>
    </subpart>
  </subparts>
</part>

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
id
required

Value: Must be a Integer
partnumber
optional

Must include find_by query


Value: Must be a String

POST /api/v2/:api_token/part
Create a new part.

Also see show action for detailed XML part response example.

Create a new part.

Examples

# request
curl -X POST -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d "
<part>
  <manufacturer_pn>C0603C104K4RACTU</manufacturer_pn>
  <manufacturer_id>147</manufacturer_id>
  <parttype_id>47</parttype_id>
  <unit_id>2</unit_id>
  <preferred_vendor_id>3</preferred_vendor_id>
  <inventory_price>0.009</inventory_price>
  <x_packaging>Box</x_packaging>
  <revision>
    <revision_name>A1</revision_name>
    <description>Ceramic capacitor</description>
    <comment>SM-0603, 10%, 16v, X7R</comment>
    <rohs>1</rohs>
    <x_schematic_symbol>A</x_schematic_symbol>
    <x_pcb_footprint_1>B</x_pcb_footprint_1>
  </revision>
</part>" \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/part

# response (for detailed part XML see show action)
<part>
  ...
</part>

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
part
required

Value: Must be a Hash
part[manufacturer_pn]
required

Manufacturer P/N


Value: Must be a String
part[manufacturer_id]
required

Manufacturer ID


Value: Must be a Integer
part[parttype_id]
required

Part Type ID


Value: Must be a Integer
part[unit_id]
required

Use-as Unit ID


Value: Must be a Integer
part[revision]
required

Value: Must be a Hash
part[revision][revision_name]
required

Revision Name


Value: Must be a String

PUT /api/v2/:api_token/part/:id
Update a part.

Also see show action for detailed XML part response and partnumber request example.

Updates a part record. Note that this API will allow users with 'can edit released part revisions' permission to make changes to a released revision. These changes are not logged. When using a partnumber, replace

url :id with :partnumber and append the URL with find_by=partnumber query.

Examples

# request
curl -X PUT -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d "
<part>
  <manufacturer_pn>C0603C104K4RACTU</manufacturer_pn>
  <manufacturer_id>147</manufacturer_id>
  <parttype_id>47</parttype_id>
  <x_packaging>Crate</x_packaging>
  <revision>
    <revision_name>A2</revision_name>
    <description>Ceramic capacitor</description>
    <x_pcb_footprint_1>CAP0603</x_pcb_footprint_1>
  </revision>
</part>" \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/part/728

# response (for detailed part XML see show action)
<part>
  ...
</part>
# Update specific part revision by adding revision_id to URL
# request
curl -X PUT -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d "
<part>
  <revision>
    <revision_name>A2</revision_name>
    <description>Ceramic capacitor</description>
  </revision>
</part>" \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/part/728?revision_id=231

# response (for detailed part XML see show action)
<part>
  ...
</part>

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
id
required

Value: Must be a number.
partnumber
optional

Must include find_by query


Value: Must be a String

DELETE /api/v2/:api_token/part/:id
Delete a part.

Also see show action for partnumber request example.

Delete a contact by its id or partnumber. When using a partnumber, replace

url :id with :partnumber and append the url with find_by=partnumber query.

Examples

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

# no response

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
id
required

Value: Must be a Integer
partnumber
optional

Must include find_by query


Value: Must be a String

GET /api/v2/:api_token/part/:id/inventory_units
List inventory units for a part.

Also see show action for partnumber request example.

Retrieve the list of all inventory units for a part. When using a partnumber, replace

url :id with :partnumber and append the url with find_by=partnumber query.

Examples

# request
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/part/728/inventory_units

# response
<inventory_units>
  <inventory_unit>
    <quantity>3600</quantity>
    <cost_per_unit>0.009</cost_per_unit>
    <inventory_sublocation_id>2</inventory_sublocation_id>
    <unit_id>2</unit_id>
  </inventory_unit>
  ...
</inventory_units>

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
id
required

Part ID.


Value: Must be a number.
partnumber
optional

Must include find_by query


Value: Must be a String