====== {$page} ====== Posting a New Company ===== Concept ===== This wiki includes steps with example for posting a new company to the database using WAPIC. ===== Cautions ===== Warning - These steps will add a new company to the database. Use caution when testing this on a Live Database. Data can be lost if not done properly. ===== Steps ===== - Launch the test fiddler application - Select "POST" from the dropdown and enter the following URL: https://localhost:5321/wapic/Companies. - Enter the WAPIC authorized Control Username and Password - Paste in the JSON data to be posted (New Company with one contact) in the Request Body field of the fiddler. - Example JSON formatted data located below. - Click Submit. - The Response Header should return "200 OK" and the Response Body should contact the Company you just posted in JSON format. **Important Notes:**1) The CustomerNumber must be unique.2) There must be one contact on when posting a new company. This query can be used to determine the most recent CustomerNumber that was used in the database. Then increment that by 1: [[code]] https://localhost:5321/wapic/Companies?$orderby=CustomerNumber desc&$top=1 [[code]] This code below is a Company with one contact in JSON format. This can be used as an example: [[code]] { "Name": "Test Company", "Division": "Test Division", "Industry": "Entertainment", "IsActive": true, "IsCustomer": false, "IsPrivate": false, "IsVendor": false, "Origin": "Referral", "Region": null, "URL": null, "CustomerCreditBalance": 0, "CustomerCreditLimit": 1, "CustomerDiscountLevel": 0, "CustomerHasCreditAccount": true, "CustomerIsPORequired": false, "CustomerIsTaxExempt": false, "CustomerNumber": 12361, "CustomerPricingLevel": 1, "VendorCreditBalance": 0, "VendorIs1099": false, "Contacts": [ { "DateModified": "2012-03-13T14:26:21", "Birthday": "1899-12-30T00:00:00", "Division": "Test Division", "FirstName": "Steve", "MiddleName": null, "LastName": "Smith", "Gender": null, "IsActive": true, "IsBilling": true, "IsPrimary": true, "Position": "Owner", "Email": "steve.smith@noemail.com", "CalendarActivities": null, "Addresses": [], "Phones": [], "UDF": { "UDFValues": [ { "Name": "IsActive", "Value": false }, { "Name": "How_Many_Referred_", "Value": 0 } ], "Id": "1001c3001", "ETag": 0 }, "DisplayName": "Steve Smith", "ETag": 0 } ], "UDF": { "UDFValues": [ { "Name": "IsActive", "Value": false }, { "Name": "___Size_of_Fleet", "Value": 0 }, { "Name": "Number_of_Employees", "Value": 0 }, { "Name": "Expected_Amount", "Value": 0 }, { "Name": "VIP_Customers", "Value": "0" }, { "Name": "Current_Provider_Size_of_Fleet", "Value": 0 }, { "Name": "Invoice_Method", "Value": "Email and Mail" } ], "ETag": 0 }, "ETag": 0 } [[code]] ===== Source ===== Contributor: __SHendrix__, __Cyrious Software, Inc.__ Updated: 2/12/2014 Version: Control 5.xx ===== See Also ===== * Backlinks [[include_pagepage_componentbacklinks]]