Posting a New Company

This wiki includes steps with example for posting a new company to the database using WAPIC.

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.

  1. Launch the test fiddler application
  2. Select “POST” from the dropdown and enter the following URL: https://localhost:5321/wapic/Companies.
  3. Enter the WAPIC authorized Control Username and Password
  4. Paste in the JSON data to be posted (New Company with one contact) in the Request Body field of the fiddler.
    1. Example JSON formatted data located below.
  5. Click Submit.
  6. 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:

https://localhost:5321/wapic/Companies?$orderby=CustomerNumber desc&$top=1

This code below is a Company with one contact in JSON format. This can be used as an example:

{
        "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
}

Contributor: SHendrix, Cyrious Software, Inc.

Updated: 2/12/2014

Version: Control 5.xx

You could leave a comment if you were logged in.