POST api/v1/Occupancies
Adds a single Occupancy to the system. Returns Success/Error code plus primary key of Occupancy added.
Request Information
URI Parameters
None.
Body Parameters
AddUpdateOccupancyViewModel| Name | Description | Type | Additional information |
|---|---|---|---|
| OccupancyId |
Represents the PK of the Occupancy |
globally unique identifier |
None. |
| Name |
Required: Represents the name of the Occupancy. Max Length = 200 |
string |
None. |
| FacilityId |
Required: Represents the PK of the Facility the Occupancy is located in. Retrieve possible values by calling /Facility/GetAllFacilities |
globally unique identifier |
None. |
| CompanyId |
Conditional: Represents the PK of the global company that the Occupancy is an instance of, if not passed in POST method, then the company is created on the Fly. |
globally unique identifier |
None. |
| StreetAddress1 |
Represents the primary street address of the Occupancy |
string |
None. |
| StreetAddress2 |
Represents the secondary street address of the Occupancy |
string |
None. |
| City |
Represents the city of the Occupancy |
string |
None. |
| RegionId |
Represents the PK of the region (State, Province, County, etc) of the Occupancy. Retrieve possible values by calling /Region/GetAllRegionsByCountryId |
globally unique identifier |
None. |
| CountryId |
Represents the PK of the country of the Occupancy. Retrieve possible values by calling /Country/GetAllCountries |
globally unique identifier |
None. |
| PostalCode |
Represents the Postal Code/Zip Code of the Occupancy |
string |
None. |
| Website |
Represents the URL of the website associated with the Occupancy |
string |
None. |
| Phone |
Represents the primary phone number of the Occupancy |
string |
None. |
| DefaultBadgeTemplateId |
Represents the PK of the default Badge Template for the Occupancy |
globally unique identifier |
None. |
| Deleted |
Represents the deleted status of the Occupancy. Should be false for an Add action, |
boolean |
None. |
| EmailAddressDomainFormula |
Represents the email address of the Occupancy. |
string |
None. |
| sAvailableEmailAddressFormulaTemplateId |
Represents the email address formula template id of the Occupancy. |
AvailableEmailAddressFormulaTemplateEnum |
None. |
Request Formats
application/json, text/json
{
"OccupancyId": "c1df3be2-d287-4534-be18-488066f8f01c",
"Name": "sample string 2",
"FacilityId": "dd555694-b264-4df7-8f03-33495a5ed458",
"CompanyId": "d926af9b-0541-429e-9512-ebb63eec0d88",
"StreetAddress1": "sample string 4",
"StreetAddress2": "sample string 5",
"City": "sample string 6",
"RegionId": "3ccac7da-aff8-4717-9b3d-165a61a110b1",
"CountryId": "6df936a7-e3df-4516-a6d3-f3ccc2163110",
"PostalCode": "sample string 9",
"Website": "sample string 10",
"Phone": "sample string 11",
"DefaultBadgeTemplateId": "5a30c173-dcd1-4ab6-b1b7-079567bb8ad7",
"Deleted": true,
"EmailAddressDomainFormula": "sample string 13",
"sAvailableEmailAddressFormulaTemplateId": 0
}
application/xml, text/xml
<AddUpdateOccupancyViewModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/APIWebRole.Controllers"> <City>sample string 6</City> <CompanyId>d926af9b-0541-429e-9512-ebb63eec0d88</CompanyId> <CountryId>6df936a7-e3df-4516-a6d3-f3ccc2163110</CountryId> <DefaultBadgeTemplateId>5a30c173-dcd1-4ab6-b1b7-079567bb8ad7</DefaultBadgeTemplateId> <Deleted>true</Deleted> <EmailAddressDomainFormula>sample string 13</EmailAddressDomainFormula> <FacilityId>dd555694-b264-4df7-8f03-33495a5ed458</FacilityId> <Name>sample string 2</Name> <OccupancyId>c1df3be2-d287-4534-be18-488066f8f01c</OccupancyId> <Phone>sample string 11</Phone> <PostalCode>sample string 9</PostalCode> <RegionId>3ccac7da-aff8-4717-9b3d-165a61a110b1</RegionId> <StreetAddress1>sample string 4</StreetAddress1> <StreetAddress2>sample string 5</StreetAddress2> <Website>sample string 10</Website> <sAvailableEmailAddressFormulaTemplateId>Custom</sAvailableEmailAddressFormulaTemplateId> </AddUpdateOccupancyViewModel>
application/x-www-form-urlencoded
Sample not available.
Response Information
Resource Description
ResultWithGuid| Name | Description | Type | Additional information |
|---|---|---|---|
| Value |
Represents the PK value that was created as a result of an add |
globally unique identifier |
None. |
| ResultCode |
Represents the result code |
integer |
None. |
| Description |
Represents a description of the result code |
string |
None. |
Response Formats
application/json, text/json
{
"Value": "0ecf0344-a756-4ea4-b61d-8822efa28bdf",
"ResultCode": 2,
"Description": "sample string 3"
}
application/xml, text/xml
<ResultWithGuid xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/APIWebRole.Controllers"> <Description>sample string 3</Description> <HttpStatusCode>Continue</HttpStatusCode> <ResultCode>2</ResultCode> <Value>0ecf0344-a756-4ea4-b61d-8822efa28bdf</Value> </ResultWithGuid>