mirror of
https://bitbucket.org/myhomie/mycorerepository.git
synced 2025-12-06 09:41:19 +00:00
152 lines
4.8 KiB
Markdown
152 lines
4.8 KiB
Markdown
# mycoreapi.api.IOTApi
|
|
|
|
## Load the API package
|
|
```dart
|
|
import 'package:mycoreapi/api.dart';
|
|
```
|
|
|
|
All URIs are relative to *http://192.168.31.140*
|
|
|
|
Method | HTTP request | Description
|
|
------------- | ------------- | -------------
|
|
[**iOTGetSmartPrinterMessages**](IOTApi.md#iotgetsmartprintermessages) | **GET** /api/iot/smartprinter/{idDevice} | Retrieve all SmartPrinterMessage
|
|
[**iOTPostToDBPrinter**](IOTApi.md#iotposttodbprinter) | **POST** /api/iot/smartprinter/{idDevice} | It's the method to post data from mqtt broker to Database (Thanks Rpi!)
|
|
[**iOTPostToDBSmartGarden**](IOTApi.md#iotposttodbsmartgarden) | **POST** /api/iot/smartgarden/{idDevice} | It's the method to post data from mqtt broker to Database (Thanks Rpi!)
|
|
|
|
|
|
# **iOTGetSmartPrinterMessages**
|
|
> List<SmartPrinterMessage> iOTGetSmartPrinterMessages(idDevice, id)
|
|
|
|
Retrieve all SmartPrinterMessage
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:mycoreapi/api.dart';
|
|
// TODO Configure OAuth2 access token for authorization: bearer
|
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
|
|
|
final api_instance = IOTApi();
|
|
final idDevice = idDevice_example; // String |
|
|
final id = 56; // int | Id of the smart printer message
|
|
|
|
try {
|
|
final result = api_instance.iOTGetSmartPrinterMessages(idDevice, id);
|
|
print(result);
|
|
} catch (e) {
|
|
print('Exception when calling IOTApi->iOTGetSmartPrinterMessages: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**idDevice** | **String**| |
|
|
**id** | **int**| Id of the smart printer message | [optional]
|
|
|
|
### Return type
|
|
|
|
[**List<SmartPrinterMessage>**](SmartPrinterMessage.md)
|
|
|
|
### Authorization
|
|
|
|
[bearer](../README.md#bearer)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: Not defined
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **iOTPostToDBPrinter**
|
|
> MultipartFile iOTPostToDBPrinter(idDevice, smartPrinterMessage)
|
|
|
|
It's the method to post data from mqtt broker to Database (Thanks Rpi!)
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:mycoreapi/api.dart';
|
|
// TODO Configure OAuth2 access token for authorization: bearer
|
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
|
|
|
final api_instance = IOTApi();
|
|
final idDevice = 56; // int | Id of the device to upload to DB
|
|
final smartPrinterMessage = [List<SmartPrinterMessage>()]; // List<SmartPrinterMessage> | Content that will be uploaded
|
|
|
|
try {
|
|
final result = api_instance.iOTPostToDBPrinter(idDevice, smartPrinterMessage);
|
|
print(result);
|
|
} catch (e) {
|
|
print('Exception when calling IOTApi->iOTPostToDBPrinter: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**idDevice** | **int**| Id of the device to upload to DB |
|
|
**smartPrinterMessage** | [**List<SmartPrinterMessage>**](SmartPrinterMessage.md)| Content that will be uploaded |
|
|
|
|
### Return type
|
|
|
|
[**MultipartFile**](MultipartFile.md)
|
|
|
|
### Authorization
|
|
|
|
[bearer](../README.md#bearer)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json
|
|
- **Accept**: application/octet-stream
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **iOTPostToDBSmartGarden**
|
|
> MultipartFile iOTPostToDBSmartGarden(idDevice, smartGardenMessage)
|
|
|
|
It's the method to post data from mqtt broker to Database (Thanks Rpi!)
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:mycoreapi/api.dart';
|
|
// TODO Configure OAuth2 access token for authorization: bearer
|
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
|
|
|
final api_instance = IOTApi();
|
|
final idDevice = 56; // int |
|
|
final smartGardenMessage = [List<SmartGardenMessage>()]; // List<SmartGardenMessage> |
|
|
|
|
try {
|
|
final result = api_instance.iOTPostToDBSmartGarden(idDevice, smartGardenMessage);
|
|
print(result);
|
|
} catch (e) {
|
|
print('Exception when calling IOTApi->iOTPostToDBSmartGarden: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**idDevice** | **int**| |
|
|
**smartGardenMessage** | [**List<SmartGardenMessage>**](SmartGardenMessage.md)| |
|
|
|
|
### Return type
|
|
|
|
[**MultipartFile**](MultipartFile.md)
|
|
|
|
### Authorization
|
|
|
|
[bearer](../README.md#bearer)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json
|
|
- **Accept**: application/octet-stream
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|