POST api/Assets
Creates a new asset.
Request Information
URI Parameters
None.
Body Parameters
The asset to create.
AssetNew| Name | Description | Type | Additional information |
|---|---|---|---|
| Name |
The name of the asset. |
string |
Required String length: inclusive between 0 and 100 |
| Identifier |
A name for the asset that must be unique for all assets within a project. |
string |
Required String length: inclusive between 0 and 100 |
| Latitude |
The latitude of the location of the asset. |
decimal number |
Required |
| Longitude |
The longitude of the location of the asset. |
decimal number |
Required |
| ForecastPoint |
A reference to the forecast point assigned to the asset. |
Reference |
Required |
Request Formats
application/json, text/json
Sample:
{
"Name": "Asset name",
"Identifier": "Asset 99",
"Latitude": 0.0,
"Longitude": 0.0,
"ForecastPoint": {
"Id": 1
}
}
application/xml, text/xml
Sample:
<AssetNew xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ForeCoastMarine.Core.OAndM">
<ForecastPoint xmlns:d2p1="http://schemas.datacontract.org/2004/07/ForeCoastMarine.Core.Models" i:nil="true" />
<ForecastPointReference xmlns:d2p1="http://schemas.datacontract.org/2004/07/ForeCoastMarine.Core">
<d2p1:Id>1</d2p1:Id>
</ForecastPointReference>
<Id>0</Id>
<Identifier>Asset 99</Identifier>
<Latitude>0</Latitude>
<Longitude>0</Longitude>
<Name>Asset name</Name>
<ProjectId>0</ProjectId>
</AssetNew>
application/x-www-form-urlencoded
Sample:
Sample not available.
Response Information
Resource Description
The ID of the new asset.
integerResponse Formats
application/json, text/json
Sample:
1
application/xml, text/xml
Sample:
<int xmlns="http://schemas.microsoft.com/2003/10/Serialization/">1</int>