Using the REST API

Encompass 2.3.3 and AgileXPLORER V2 both support a ReST API. That provides access to to Part Details and BOMs

More API's will be added in the future to include Shopping Cart Access and other facets of the application. All API's with a GET operation can be called using a standard web browser.  API's following standard REST calling conventions, POST operations are permitted where noted. 

It is recommended that customers proxy or restrict access to the API endpoint, the API is its current version is meant for system level integrations, and does not implement data level security.

Enabling the API:

Edit webtop.properties, in the applications config directory.

webtop.apiEnabled=true 

Accessing the API

The API is access via HTTP to the application endpoint Future references to the endpoint will be referred to as {API_URL} in the document.

The default endpoints may change based on you specific installation the OOTB {API_URL} for each app are:

Encompass using Tomcat:

http://server:8080/encompass/dynamicservlets/api/v1

Encompass using Weblogic

http://server:7001/encompass/dynamicservlets/api/v1

AgileXPLORER using Tomcat

http://server:8048/AgileXPLORER/dynamicservlets/api/V1

APIs

The following APIs are described what the "request" is and what the expected response will be. With the exception of the HELP API, responses are JSON. The Responses printed below are direct from the browser, using a JSON pretty-printer to help with clarity.

Help API:

Hitting the {API_URL} from a browser will produce a summary of the available API's, and the calling convention. This will reflect the most current capabilities of the API, and may supersede this document.

REQUEST:

{API_URL}/

RESPONSE:

USAGE:
Get BOM from a specified assembly:
GET .../api/v1/bom/{cpn:[.+]}
GET .../api/v1/bom/{cpn:[.+]}/{revision:[.*]}
GET .../api/v1/bom/{cpn:[.+]}/{revision:[.*]}?levels={[0-9]*}
GET .../api/v1/bom/{cpn:[.+]}/{revision:[.*]}?direction={up|down}

Get Parts:
GET .../api/v1/parts/{cpn:[.+]}
GET .../api/v1/parts/{cpn:[.+]}/{revision:[.*]}
GET .../api/v1/parts/search?query={index query:[.*]}
POST .../api/v1/parts/list
BODY:{parts:[{cpn:[.*],revision:[.*]}, ... ]}
POST .../api/v1/parts/list?query={part index query to additionally filter data:[.*]}
BODY:{parts:[{cpn:[.*],revision:[.*]}, ... ]}

Get Shopping list for a specified user:
GET .../api/v1/shoppingList/{username:[.+]}
GET .../api/v1/shoppingList/{username:[.+]/{id} - shopping list must belong to user

Parts API: 

REQUEST:

{API_URL}/parts/12-1903-01

Optionally With Revision

{API_URL}/parts/12-1903-01/A0

Optional Seach Service: This will allow standard index Query to be submitted:

{API_URL}/parts/search?query="cpn:12-001230-01 AND spec:red*"

RESPONSE

The response will be an array of PARTS, that match the part number supplied. Within in each array element will be  name/value pairs for all attributes will data.

For example, if the same part number has multiple rev's each revision will be an array element. The following response had 3 elements, only the first was expanded.

{

  • parts: 
     
    [
    •  
      {
      • uid: "975363",
      • risk_cmmt: "INACTIVE OLDVALUES: 1/X/12/23/06 INACTIVE PART THAT NEEDS TO BE RE-RISK RATED. PLEASE CONTACT THE COMMODITY MANAGER BEFORE UTILIZING THIS PART",
      • bom_item_type: "Std Item",
      • product_family: "TBA",
      • leadtime: "0.0",
      • wip_supply: "Push",
      • type: "Resistors",
      • risk_code: "1",
      • control_code: "NC",
      • revision: "-A0",
      • package_type: "AX",
      • frozen_cost: "0.01",
      • tolerance: "5%",
      • power: "0.25",
      • resistance: "10000.0",
      • eol: "false",
      • has_doc: "false",
      • orcl_bi_bu: "TBA",
      • item_type: "TURNKEY",
      • buyer_id: "86143.0",
      • cpn: "12-1903-01",
      • text: "Electrical/Passives/Resistors",
      • catalog: "Electrical/Passives/Resistors",
      • qualification_status: "End of Production",
      • vendor_pn: "CCF-07-103J",
      • safety_critical: "No",
      • usage_status: "Approved",
      • network_critical: "No",
      • emc_critical: "_",
      • inventory_item_status_code: "ENABLE-OTH",
      • partfrom: "Cisco",
      • bom_child: "true",
      • spec: "RES, MF, 10k, 0.25W, 5%, AX, 0.28"L",
      • risk_reason: "X",
      • psl_flag: "Y",
      • pml_flag: "Y",
      • mcn_pending: "N",
      • release_status: "released",
      • footprint: "0.28"L",
      • cpn_id: "939672",
      • risk_comment_updated: "2012-11-15 15:03:44",
      • comm_code_1: "E/M",
      • comm_code_2: "PASSIVE",
      • uom: "EA",
      • comm_code_6: "0.0",
      • std_cost: "0.01",
      • comm_code_3: "RESISTOR",
      • comm_code_4: "METAL FILM",
      • doc-type: "part",
      • vendor_name: "VISHAY/DALE",
      • nebs_critical: "_",
      • cpn_pbfree_requirement: "SnPb MPNs",
      • class-code: "12",
      • product_type: "TBA",
      • product_subgroup: "TBA",
      • l1_reqd: "Y",
      • risk_comment: "INACTIVE OLDVALUES: 1/X/12/23/06 INACTIVE PART THAT NEEDS TO BE RE-RISK RATED. PLEASE CONTACT THE COMMODITY MANAGER BEFORE UTILIZING THIS PART",
      • bom_parent: "false",
      • make_buy_code: "Buy",
      • device: "RES",
      • manufacturer_id: "5340.0",
      • res_type: "MF",
      • latest: "true",
      • revisions: "-01,-A0",
      • comm_mgr: "SIRAMAN"
      },
    ]

}

BOMs API: 

REQUEST:

The BOM API has several flavors:

To retrieve Single Level BOM:

{API_URL}/bom/122-30203-445

Options:

Specify the "direction" argument as "up" to produce a 1 level where-used

{API_URL}/bom/122-30203-445?direction=up

Specify the "level" argument to produce walk n levels (up or down) in the hierarchy, for a n level BOM (down) or n level Where-used (up)

{API_URL}/bom/122-30203-445?direction=up?level=2

RESPONSE:

The Response will be a list of items, each with the name/value pairs for the attributes known for that item.

[

  •  
    {
    • uid: "",
    • risk_reason: "",
    • wip_supply_type: "6",
    • risk_code: "",
    • risk_comment_updated: "",
    • l2_use_condition: "2",
    • revision: "-03",
    • effectivity_date: "2014-11-20 03:26:20",
    • level: "0",
    • uom: "EA",
    • std_cost: "0",
    • description: "PCA,MBRD,PEOPLE,MORENO",
    • frozen_cost: "396.37918",
    • ref_desg: "-",
    • parent-uid: "477010",
    • reliability_grade: "A",
    • item_type: "PHANTOM",
    • nebs_critical: "No",
    • cpn: "73-15570-04",
    • cpn_pbfree_requirement: "Pb-Free MPNs",
    • is_assembly: "true",
    • class-code: "73",
    • qty: "1",
    • item_status: "ENABLE-OTH",
    • disable_date: "",
    • risk_comment: "",
    • has-bom: "true",
    • emc_critical: "No",
    • partfrom: "Cisco",
    • item_seq: "2"
    },

Batch Part API: 

Coming Soon.

Shopping Cart API: 

Coming Soon

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk