|
1 | 1 | {
|
2 | 2 | "info": {
|
3 |
| - "_postman_id": "20e302e5-33e0-4f1c-b7b1-13d83e1700df", |
| 3 | + "_postman_id": "545cc13f-aa62-40ac-8ebe-adb14122f027", |
4 | 4 | "name": "REST API Examples (Integration Development Guide)",
|
5 | 5 | "description": "This collection contains examples from the [REST API Examples](https://help.acumatica.com/Help?ScreenId=ShowWiki&pageid=bbb8b84b-07d7-4a69-adf8-33dc5d430b60) chapter of the Integration Development Guide of Acumatica ERP.\n\n**Testing the Requests**\n\nTo test the examples, you configure this collection and the Acumatica ERP instance to be used as follows:\n\n- Deploy a new Acumatica ERP instance with three tenants that are based on the U100, SalesDemo, and T100 datasets. For details on deploying an instance, see [To Deploy an Acumatica ERP Instance](https://help.acumatica.com/Help?ScreenId=ShowWiki&pageid=b18ad378-0a8c-44f1-a14c-6b4f9c6271e4) in the Installation Guide.\n \n- Specify the base URL of the site in the _BaseURL_ variable of the collection.\n \n- Specify the instance URL in the _InstanceURL_ variable of the collection.\n \n- Make sure the URL of the Default/24.200.001 endpoint is in the _EndpointURL_ variable.\n \n- Make sure the URL of the MANUFACTURING/24.200.001 endpoint is in the _ManufacturingEndpointURL_ variable.\n \n- Specify the tenant name, branch, username, and password to access the tenant with the U100 data in the _TenantU100_, _BranchU100_, _UsernameU100_, and _PasswordU100_ variables.\n \n- Specify the tenant name, branch, username, and password to access the tenant with the T100 data in the _TenantT100_, _BranchT100_, _UsernameT100_, and _PasswordT100_ variables.\n \n- Specify the tenant name, branch, username, and password to access the tenant with the T100 data in the _TenantSalesDemo_, _BranchSalesDemo_, _UsernameSalesDemo_, and _PasswordSalesDemo_ variables.\n \n\nOther variables are used by particular requests and are specified during execution of other requests. You do not need to feel their values manually.",
|
6 | 6 | "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
|
|
672 | 672 | "listen": "prerequest",
|
673 | 673 | "script": {
|
674 | 674 | "exec": [
|
675 |
| - "//Sign in to the tenant with U100 data\r", |
| 675 | + "//Sign in to the tenant with T100 data\r", |
676 | 676 | "var url = pm.collectionVariables.get('InstanceURL');\r",
|
677 |
| - "var username = pm.collectionVariables.get('UsernameU100');\r", |
678 |
| - "var password = pm.collectionVariables.get('PasswordU100');\r", |
679 |
| - "var tenant = pm.collectionVariables.get('TenantU100');\r", |
680 |
| - "var branch = pm.collectionVariables.get('BranchU100');\r", |
| 677 | + "var username = pm.collectionVariables.get('UsernameT100');\r", |
| 678 | + "var password = pm.collectionVariables.get('PasswordT100');\r", |
| 679 | + "var tenant = pm.collectionVariables.get('TenantT100');\r", |
| 680 | + "var branch = pm.collectionVariables.get('BranchT100');\r", |
681 | 681 | "pm.acuFunc.singInFunction(pm, url, tenant, branch, username, password)\r",
|
682 | 682 | ""
|
683 | 683 | ],
|
684 |
| - "type": "text/javascript" |
| 684 | + "type": "text/javascript", |
| 685 | + "packages": {} |
685 | 686 | }
|
686 | 687 | },
|
687 | 688 | {
|
|
692 | 693 | "pm.test(\"Status code is 200\", function () {\r",
|
693 | 694 | " pm.response.to.have.status(200);\r",
|
694 | 695 | "});\r",
|
695 |
| - "pm.test(\"InventoryID is APJAM08\", function (){\r", |
| 696 | + "pm.test(\"InventoryID is SIMCARD\", function (){\r", |
696 | 697 | " const jsonResponse = pm.response.json();\r",
|
697 |
| - " pm.expect(jsonResponse.InventoryID.value).to.eql('APJAM08');\r", |
| 698 | + " pm.expect(jsonResponse.InventoryID.value).to.eql('SIMCARD');\r", |
698 | 699 | "});\r",
|
699 | 700 | "pm.test(\"Response includes one detail line\", function (){\r",
|
700 | 701 | " const jsonResponse = pm.response.json();\r",
|
701 |
| - " pm.expect(jsonResponse.Results).to.have.lengthOf(2);\r", |
| 702 | + " pm.expect(jsonResponse.Results).to.have.lengthOf(1);\r", |
702 | 703 | "});\r",
|
703 | 704 | "//Sign out and set the next request\r",
|
704 | 705 | "var url = pm.collectionVariables.get('InstanceURL');\r",
|
705 | 706 | "pm.acuFunc.singOutFunction(pm, url);\r",
|
706 | 707 | "pm.execution.setNextRequest(\"Retrieve the List of Records in Batches\");"
|
707 | 708 | ],
|
708 |
| - "type": "text/javascript" |
| 709 | + "type": "text/javascript", |
| 710 | + "packages": {} |
709 | 711 | }
|
710 | 712 | }
|
711 | 713 | ],
|
|
725 | 727 | ],
|
726 | 728 | "body": {
|
727 | 729 | "mode": "raw",
|
728 |
| - "raw": "{\r\n \"InventoryID\" : {\"value\" : \"APJAM08\" } ,\r\n \"WarehouseID\" : {\"value\" : \"RETAIL\" }\r\n}" |
| 730 | + "raw": "{\r\n \"InventoryID\" : {\"value\" : \"SIMCARD\" } ,\r\n \"WarehouseID\" : {\"value\" : \"YOGI\" }\r\n}" |
729 | 731 | },
|
730 | 732 | "url": {
|
731 | 733 | "raw": "{{EndpointURL}}InventorySummaryInquiry?$expand=Results",
|
|
5133 | 5135 | "pm.acuFunc.singOutFunction(pm, url);\r",
|
5134 | 5136 | "pm.execution.setNextRequest(\"Update a Customer\");"
|
5135 | 5137 | ],
|
5136 |
| - "type": "text/javascript" |
| 5138 | + "type": "text/javascript", |
| 5139 | + "packages": {} |
5137 | 5140 | }
|
5138 | 5141 | },
|
5139 | 5142 | {
|
5140 | 5143 | "listen": "prerequest",
|
5141 | 5144 | "script": {
|
5142 | 5145 | "exec": [
|
5143 |
| - "//Sign in to the tenant with U100 data\r", |
| 5146 | + "//Sign in to the tenant with T100 data\r", |
5144 | 5147 | "var url = pm.collectionVariables.get('InstanceURL');\r",
|
5145 |
| - "var username = pm.collectionVariables.get('UsernameU100');\r", |
5146 |
| - "var password = pm.collectionVariables.get('PasswordU100');\r", |
5147 |
| - "var tenant = pm.collectionVariables.get('TenantU100');\r", |
5148 |
| - "var branch = pm.collectionVariables.get('BranchU100'); \r", |
| 5148 | + "var username = pm.collectionVariables.get('UsernameT100');\r", |
| 5149 | + "var password = pm.collectionVariables.get('PasswordT100');\r", |
| 5150 | + "var tenant = pm.collectionVariables.get('TenantT100');\r", |
| 5151 | + "var branch = pm.collectionVariables.get('BranchT100'); \r", |
5149 | 5152 | "pm.acuFunc.singInFunction(pm, url, tenant, branch, username, password)\r",
|
5150 | 5153 | ""
|
5151 | 5154 | ],
|
5152 |
| - "type": "text/javascript" |
| 5155 | + "type": "text/javascript", |
| 5156 | + "packages": {} |
5153 | 5157 | }
|
5154 | 5158 | }
|
5155 | 5159 | ],
|
|
5168 | 5172 | }
|
5169 | 5173 | ],
|
5170 | 5174 | "url": {
|
5171 |
| - "raw": "{{EndpointURL}}Customer?$expand=MainContact,MainContact/Address", |
| 5175 | + "raw": "{{EndpointURL}}Customer?$expand=MainContact,MainContact/Address&$select=CustomerID,CustomerName,CustomerClass,MainContact/Email,MainContact/Phone1,MainContact/Address/AddressLine1,MainContact/Address/AddressLine2,MainContact/Address/City,MainContact/Address/State,MainContact/Address/PostalCode", |
5172 | 5176 | "host": [
|
5173 | 5177 | "{{EndpointURL}}Customer"
|
5174 | 5178 | ],
|
5175 | 5179 | "query": [
|
5176 | 5180 | {
|
5177 | 5181 | "key": "$expand",
|
5178 | 5182 | "value": "MainContact,MainContact/Address"
|
| 5183 | + }, |
| 5184 | + { |
| 5185 | + "key": "$select", |
| 5186 | + "value": "CustomerID,CustomerName,CustomerClass,MainContact/Email,MainContact/Phone1,MainContact/Address/AddressLine1,MainContact/Address/AddressLine2,MainContact/Address/City,MainContact/Address/State,MainContact/Address/PostalCode" |
5179 | 5187 | }
|
5180 | 5188 | ]
|
5181 | 5189 | },
|
|
6444 | 6452 | "pm.test(\"Status code is 200\", function () {\r",
|
6445 | 6453 | " pm.response.to.have.status(200);\r",
|
6446 | 6454 | "});\r",
|
6447 |
| - "pm.test(\"More than one detail is returned\", function (){\r", |
| 6455 | + "pm.test(\"One detail is returned\", function (){\r", |
6448 | 6456 | " const jsonResponse = pm.response.json();\r",
|
6449 |
| - " pm.expect(jsonResponse.Results).length.to.be.greaterThan(1);\r", |
| 6457 | + " pm.expect(jsonResponse.Results).to.have.lengthOf(1);\r", |
6450 | 6458 | "});\r",
|
6451 | 6459 | "//Sign out and set the next request\r",
|
6452 | 6460 | "var url = pm.collectionVariables.get('InstanceURL');\r",
|
6453 | 6461 | "pm.acuFunc.singOutFunction(pm, url);\r",
|
6454 | 6462 | "pm.execution.setNextRequest(\"Create an Invoice with Tax Parameters Overridden\");"
|
6455 | 6463 | ],
|
6456 |
| - "type": "text/javascript" |
| 6464 | + "type": "text/javascript", |
| 6465 | + "packages": {} |
6457 | 6466 | }
|
6458 | 6467 | },
|
6459 | 6468 | {
|
6460 | 6469 | "listen": "prerequest",
|
6461 | 6470 | "script": {
|
6462 | 6471 | "exec": [
|
6463 |
| - "//Sign in to the tenant with U100 data\r", |
| 6472 | + "//Sign in to the tenant with T100 data\r", |
6464 | 6473 | "var url = pm.collectionVariables.get('InstanceURL');\r",
|
6465 |
| - "var username = pm.collectionVariables.get('UsernameU100');\r", |
6466 |
| - "var password = pm.collectionVariables.get('PasswordU100');\r", |
6467 |
| - "var tenant = pm.collectionVariables.get('TenantU100');\r", |
6468 |
| - "var branch = pm.collectionVariables.get('BranchU100'); \r", |
| 6474 | + "var username = pm.collectionVariables.get('UsernameT100');\r", |
| 6475 | + "var password = pm.collectionVariables.get('PasswordT100');\r", |
| 6476 | + "var tenant = pm.collectionVariables.get('TenantT100');\r", |
| 6477 | + "var branch = pm.collectionVariables.get('BranchT100'); \r", |
6469 | 6478 | "pm.acuFunc.singInFunction(pm, url, tenant, branch, username, password)\r",
|
6470 | 6479 | ""
|
6471 | 6480 | ],
|
6472 |
| - "type": "text/javascript" |
| 6481 | + "type": "text/javascript", |
| 6482 | + "packages": {} |
6473 | 6483 | }
|
6474 | 6484 | }
|
6475 | 6485 | ],
|
|
6489 | 6499 | ],
|
6490 | 6500 | "body": {
|
6491 | 6501 | "mode": "raw",
|
6492 |
| - "raw": "{\r\n \"InventoryID\": { \"value\": \"APJAM08\" }\r\n}" |
| 6502 | + "raw": "{\r\n \"InventoryID\": { \"value\": \"SIMCARD\" }\r\n}" |
6493 | 6503 | },
|
6494 | 6504 | "url": {
|
6495 | 6505 | "raw": "{{EndpointURL}}InventorySummaryInquiry?$expand=Results",
|
|
0 commit comments