POST api/site
This method adds a new site
Error Messages
- 404/NotFound: Company with id = X not found - Specified ID is not assigned to a company
- 401/Unauthorized: CompanySitePermission - user does not have access to add sites to this copmany
- 400/BadRequest: Site short name already exists - This site short name already exists within this company. Specify a different one
Request Information
URI Parameters
None.
Body Parameters
SitePostRequestName | Description | Type | Additional information |
---|---|---|---|
CompanyId | ID - The unique identifier of the parent company. | integer |
Required |
ShortName | A reference name for the site. | string |
Required String length: inclusive between 0 and 255 |
AccountRef | string |
None. |
Request Formats
application/json, text/json
Sample:
{ "CompanyId": 1, "ShortName": "sample string 2", "SetToEarliestCompanyBillingAddress": true, "AccountRef": "sample string 4" }
application/xml, text/xml
Sample:
<SitePostRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/aBILLity.WebAPI.Models.Company"> <AccountRef>sample string 4</AccountRef> <CompanyId>1</CompanyId> <SetToEarliestCompanyBillingAddress>true</SetToEarliestCompanyBillingAddress> <ShortName>sample string 2</ShortName> </SitePostRequest>
application/x-www-form-urlencoded
Sample:
Sample not available.
Response Information
Resource Description
SitePostResponseName | Description | Type | Additional information |
---|---|---|---|
Id | Site ID of the newly created Site | integer |
None. |
Response Formats
application/json, text/json
Sample:
{ "Id": 1 }
application/xml, text/xml
Sample:
<SitePostResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/aBILLity.WebAPI.Models.Company"> <Id>1</Id> </SitePostResponse>