AddDevicesForProject
Description
This method is used to create devices for a given project. The device details that were created are returned as the output.
Notes:
- Multiple devices can be added at the same time.
- Any company that is connected to a given project can add devices to that project.
- The functionality for the DeviceCode has not been implemented yet.
Request
Parameter | Type | Mandatory/Optional | Maximum character length/limit | Description |
---|---|---|---|---|
input | AddDevicesForProjectInput | Mandatory | Not relevant | AddDevicesForProjectInput model |
applicationName | String | Mandatory | Should be less than or equal to 10 characters | The name of the integration partner |
AddDevicesForProjectInput
Parameter | Type | Mandatory/Optional | Description |
---|---|---|---|
ProjectId | long | Mandatory/Optional* | The Id of the project |
ProjectCode | string | Mandatory/Optional* | Project code of the project E.g. ABC0001-A1 |
DeviceCode | string | Optional | The DeviceCode that is given as input to retrieve data from NRF/NOBB/EFO repositories to create the device |
Devices | List<ProjectDeviceInput> | Mandatory | List of project devices to be added. DeviceName and DeviceTypeId are mandatory for this method |
Note
*It is mandatory to provide either the projectCode or the projectId. Preference is given to the projectId, if both the projectCode and the projectId are provided.
Request - sample input
<AddDevicesForProject>
<MethodParameters>
<UserAuthentication>
<UserName>username</UserName>
<Password>password/Password>
<AnyAttr attr0="XmlAttributeArray" isNull="false">
<XmlAttributeArray0>System.Xml.XmlAttribute</XmlAttributeArray0>
</AnyAttr>
</UserAuthentication>
<input>
<ProjectId>1211</ProjectId>
<ProjectCode isNull="false" />
<DeviceCode isNull="false" />
<Devices attr0="ProjectDeviceInputArray" isNull="false">
<ProjectDeviceInputArray0>
<DeviceName>Whirlpool washing machine</DeviceName>
<DeviceDescription isNull="false" />
<DeviceTypeId>1</DeviceTypeId>
<ManufactureName isNull="false" />
<ProductCodeType>0</ProductCodeType>
<ProductCode isNull="false" />
<GtinNumber isNull="false" />
<LifeExpectancy>0</LifeExpectancy>
<WarrantyDuration>0</WarrantyDuration>
<BuildingElementId>0</BuildingElementId>
<InstallationYear>0</InstallationYear>
<RoomId>0</RoomId>
<UserManual>
<Url>https://www.manualslib.com/manual/776758/Whirlpool-Washing-Machine.html</Url>
<Data isNull="false" />
</UserManual>
</ProjectDeviceInputArray0>
</Devices>
</input>
<applicationName>test</applicationName>
</MethodParameters>
</AddDevicesForProject>
Response
Type | Description |
---|---|
AddDevicesForProjectOutput | AddDevicesForProjectOutput model |
AddDevicesForProjectOutput
Parameter | Type | Description |
---|---|---|
Statuses | List<AddDeviceForProjectStatus> | Project device creation statuses list |
Response - sample output
<AddDevicesForProject>
<MethodParameters>
<AddDevicesForProjectOutput>
<Statuses attr0="AddDeviceForProjectStatusArray" isNull="false">
<AddDeviceForProjectStatusArray0>
<Status>0</Status>
<Device>
<Id>0</Id>
<ProjectId>1211</ProjectId>
<DeviceName>Whirlpool washing machine</DeviceName>
<DeviceDescription isNull="false" />
<ManufactureName isNull="false" />
<ProductCodeType>0</ProductCodeType>
<ProductCode isNull="false" />
<GtinNumber isNull="false" />
<LifeExpectancy>0</LifeExpectancy>
<WarrantyDuration>0</WarrantyDuration>
<BuildingElementId>0</BuildingElementId>
<DeviceTypeId>1</DeviceTypeId>
<InstallationYear>0</InstallationYear>
<RoomId>0</RoomId>
<UserManual>https://www.manualslib.com/manual/776758/Whirlpool-Washing-Machine.html</UserManual>
</Device>
<ErrorCode>320</ErrorCode>
</AddDeviceForProjectStatusArray0>
</Statuses>
</AddDevicesForProjectOutput>
</MethodParameters>
</AddDevicesForProject>
Exceptions
Error Code | Description |
---|---|
110 | Input parameters contain null or invalid data |
123 | An exception occured while processing your request |
136 | Provided Url is invalid |
138 | applicationName length has exceeded the maximum character limit allowed (10) |
144 | One or more of the input document models does not contain adequate information (EfoIds, Url or Base64 encoded data) |
146 | The applicationName is not set |
167 | You are not authorized to use this method |
191 | No devices have been provided |
196 | Url or data must be provided to create a device manual |
206 | Invalid building element |
210 | The DeviceTypeId provided is not valid |
227 | The project does not exist or the company is not connected to the given project or your license does not authorize you to access this project |
252 | No input is provided for projectId or projectCode. Provide the input for at least one of these fields |
253 | Ambiguous inputs. Make sure the projectCode and projectId refer to the same project |
273 | Project does not exist |
299 | The given project is closed |
302 | Given RoomId is not attached to the project |
303 | DeviceName is not provided |
304 | DeviceDescription length has exceeded the maximum character limit allowed (250) |
305 | DeviceName length has exceeded the maximum character limit allowed (25) |
306 | ManufactureName length has exceeded the maximum character limit allowed (25) |
307 | ProductCode length has exceeded the maximum character limit allowed (25) |
308 | GtinNumber length has exceeded the maximum character limit allowed (25) |
312 | Invalid WarrentyDuration range or the number of digits exceed 3 |
313 | Invalid LifeExpectancy range or the number of digits exceed 3 |
314 | Invalid InstallationYear |
315 | WarrentyDuration cannot be greater than LifeExpectancy |
319 | Invalid ProductCodeType Id |
320 | ProjectDevice already exists |