4.8 KiB

mycoreapi.api.IOTApi

Load the API package

import 'package:mycoreapi/api.dart';

All URIs are relative to http://192.168.31.140

Method HTTP request Description
iOTGetSmartPrinterMessages GET /api/iot/smartprinter/{idDevice} Retrieve all SmartPrinterMessage
iOTPostToDBPrinter POST /api/iot/smartprinter/{idDevice} It's the method to post data from mqtt broker to Database (Thanks Rpi!)
iOTPostToDBSmartGarden POST /api/iot/smartgarden/{idDevice} It's the method to post data from mqtt broker to Database (Thanks Rpi!)

iOTGetSmartPrinterMessages

List iOTGetSmartPrinterMessages(idDevice, id)

Retrieve all SmartPrinterMessage

Example

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

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

iOTPostToDBPrinter

MultipartFile iOTPostToDBPrinter(idDevice, smartPrinterMessage)

It's the method to post data from mqtt broker to Database (Thanks Rpi!)

Example

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 Content that will be uploaded

Return type

MultipartFile

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/octet-stream

[Back to top] [Back to API list] [Back to Model list] [Back to README]

iOTPostToDBSmartGarden

MultipartFile iOTPostToDBSmartGarden(idDevice, smartGardenMessage)

It's the method to post data from mqtt broker to Database (Thanks Rpi!)

Example

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

Return type

MultipartFile

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/octet-stream

[Back to top] [Back to API list] [Back to Model list] [Back to README]