Scenarios
Below are scenarios outlining the steps to create suppliers using V7 of the Standard API, and the steps to create New Classification Values.
More scenarios coming soon...
Scenario 1: Supplier Upsert
Step 1: Request a JSON Web Token (JWT)
-
Prepare a POST message to
{BaseUrl}/sessions
with the following JSON body:
Step 2: Prepare and send a Supplier Upsert Request
-
Prepare a POST message to
{BaseUrl}/api/suppliers/
with the following headers: -
And with the following body:
-
Expected Result
Step 3: Check the Batch Status
-
Using the
BatchGuid
returned in step 2, make a GET request to the{BaseUrl}/api/batch/
endpoint
Step 4: Once complete you may retrieve the Suppliers inserted in the batch using the BatchGuid
.
-
Using the
BatchGuid
returned in step 2, make a GET request to the{BaseUrl}/api/suppliers
endpoint with the batchGuid as a query parameter.
Scenario 2: New Classification Value(s)
Step 0: Setup Classifications in ASM
-
The following steps are dependent upon the Classifications already existing within the ASM.
Note that the Classification values can be multi-value (MV) or single-value (SV) of type 'string', 'decimal', or 'date', and they may be associated with any combination of Users, Parts, Sub-Assemblies, Suppliers, and/or Products
Our example scenario will use a Part with an assortment of Classification values.
Step 1: Request a JSON Web Token (JWT)
-
Prepare a POST message to
{BaseUrl}/sessions
with the following JSON body:
Step 2: Prepare and send a Create Part Request with New Classification Values
-
Prepare a POST message to
{BaseUrl}/api/v7/parts/flat/
with the following headers: -
And with the following body:
{ "ModuleScopes": [], "Parts": [ { "PartNumber": "P000001", "PartName": "Mainboard", "SupplierNumber": "A000001", "SupplierName": "Intel Corporation", "SupplierPartNumber": "SupplierPartNumber_P000001", "UnitOfMeasure": "EACH", "UnitOfMeasureWeightInGrams": "100", "CustomFields": [], "Classifications": [ { "Name": "Batch_Dates", "Values": [ "2021-02-14", "2021-03-10" ] }, { "Name": "Decimal_Statuses", "Values": [ "-1", "0", "3", "67" ] }, { "Name": "Alternative_Parts_Internal_ERP", "Values": [ "P000001-112", "P000001-113" ] }, { "Name": "Initial_Release_Date", "Values": [ "2019-05-21" ] }, { "Name": "Custom_Single_Decimal", "Values": [ "147855" ] }, { "Name": "Extended_Description", "Values": [ "This mainboard product is used in various subassemblies and products including...." ] } ] } ] }
-
Expected Result
Step 3: Check the Batch Status
-
Using the
BatchGuid
returned in step 2, make a GET request to the{BaseUrl}/api/batch/
endpoint
Step 4: Once complete you may retrieve the Part inserted in the batch using the BatchGuid
.
-
Using the
BatchGuid
returned in step 2, make a GET request to the{BaseUrl}/api/v7/parts
endpoint with the batchGuid as a query parameter.With this Body returned:
{ "AssentContext": "3363b231-b487-49b0-9478-02db828dd268", "SchemaVersion": 7, "Endpoint": "Parts", "EndpointType": "Standard", "QueryString": "?batchGuid=e44aa75b-e87a-4b13-bf4b-66ca26a49534", "Total": 1, "Count": 1, "NextOffset": 1, "MoreAvailable": false, "Parts": [ { "PartName": "Mainboard", "PartNumber": "P000001", "PartRole": "Part", "SupplierPartId": 37229, "SupplierPartNumber": "SupplierPartNumber_P000001", "UnitOfMeasure": "EACH", "UnitOfMeasureWeightInGrams": 100.0000000000, "PartStatus": true, "SupplierId": 2235, "SupplierName": "Intel Corporation", "SupplierNumber": "A000001", "CreatedDate": "2021-10-04T11:21:30Z", "ModifiedDate": "2021-10-04T11:21:30Z", "Classifications": [ { "Name": "Alternative_Parts_Internal_ERP", "Values": [ "P000001-112", "P000001-113" ] }, { "Name": "Batch_Dates", "Values": [ "2021-02-14", "2021-03-10" ] }, { "Name": "Custom_Single_Decimal", "Values": [ "147855.00000" ] }, { "Name": "Decimal_Statuses", "Values": [ "0.00000", "-1.00000", "3.00000", "67.00000" ] }, { "Name": "Extended_Description", "Values": [ "This mainboard product is used in various subassemblies and products including...." ] }, { "Name": "Initial_Release_Date", "Values": [ "2019-05-21" ] } ], "CustomFields": [], "PartScope": [...trimmed for brevity...], "RegulationStatus": [...trimmed for brevity...] } ] }
- Create, Read, Update, and Delete (CRUD) operations