Learn how to format API requests, to query adhoc data, or to format an interface retrieval to be used by another application using CoreTRM API Builder.
Let's create a simple API that queries all contract numbers within a date period from 2019-09-01 to 2019-09-15 that has quantity of greater than 100,000 units.
Example: api/{tenantid}/dataobjectdata/core_contract_item?itemrefs=contractseqnum&sortitemrefs=contractseqnum&filter=startdatetime.ge.2019-09-01.and.enddatetime.lt.2019-09-15&perpage=12
Under "API Request" > "New" > Add "Request Name" as "Query Contract Number".
From "Object" > Select "Contract Item".
Under "Item Refs" Select magnifier > "contract item" > "contractseqnum" > Apply.
Under "Sort Item Refs" repeat the same by Selecting magnifier > "Contract Item" > "contractseqnum" > Apply
Add New under "Filter" Assign: 101 to "Order Number".
Under "Left Item Ref" Select magnifier > "contract item" > "startdatetime"
Under "Condition" Select "greater than or equal to".
Under "Right Value"Enter the start date to query in YYYY-MM-DD "2019-09-01".
Create a new "Order" number" at 102 > Similarly selecting "Contract Item", select "enddatetime" and input "2019-09-15"
Create another new "Order" number" at 103 > Selecting "Contract Item", select "contractitemquantity" and input "100000"
Make sure the "Active" box are ticked for all three order number.
Select the "API Request" Query Contract Number that you just created at top of page.
CoreTrm API Builder will automatically build the formatted API address.Execute "GET" and you will see the JSON output per below.
Under "API Request" > "New" > Add "Request Name" as "Query Contract Number".
From "Object" > Select "Contract Item".
Under "Item Refs" Select magnifier > "contract item" > "contractseqnum" > Apply.
Under "Sort Item Refs" repeat the same by Selecting magnifier > "Contract Item" > "contractseqnum" > Apply
Add New under "Filter" Assign: 101 to "Order Number".
Under "Left Item Ref" Select magnifier > "contract item" > "startdatetime"
Under "Condition" Select "greater than or equal to".
Under "Right Value"Enter the start date to query in YYYY-MM-DD "2019-09-01".
Create a new "Order" number" at 102 > Similarly selecting "Contract Item", select "enddatetime" and input "2019-09-15"
Create another new "Order" number" at 103 > Selecting "Contract Item", select "contractitemquantity" and input "100000"
Make sure the "Active" box are ticked for all three order number.
Select the "API Request" Query Contract Number that you just created at top of page.
CoreTrm API Builder will automatically build the formatted API address.Execute "GET" and you will see the JSON output per below.