mirror of
https://bitbucket.org/myhomie/mycorerepository.git
synced 2025-12-06 09:41:19 +00:00
58 lines
1.4 KiB
Markdown
58 lines
1.4 KiB
Markdown
# mycoreapi.api.MQTTApi
|
|
|
|
## Load the API package
|
|
```dart
|
|
import 'package:mycoreapi/api.dart';
|
|
```
|
|
|
|
All URIs are relative to *http://localhost:25049*
|
|
|
|
Method | HTTP request | Description
|
|
------------- | ------------- | -------------
|
|
[**mQTTPublishMessage**](MQTTApi.md#mqttpublishmessage) | **POST** /api/mqtt | Publish mqtt test
|
|
|
|
|
|
# **mQTTPublishMessage**
|
|
> bool mQTTPublishMessage(mqttMessageDTO)
|
|
|
|
Publish mqtt test
|
|
|
|
### 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 = MQTTApi();
|
|
final mqttMessageDTO = MqttMessageDTO(); // MqttMessageDTO | Message to send
|
|
|
|
try {
|
|
final result = api_instance.mQTTPublishMessage(mqttMessageDTO);
|
|
print(result);
|
|
} catch (e) {
|
|
print('Exception when calling MQTTApi->mQTTPublishMessage: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**mqttMessageDTO** | [**MqttMessageDTO**](MqttMessageDTO.md)| Message to send |
|
|
|
|
### Return type
|
|
|
|
**bool**
|
|
|
|
### Authorization
|
|
|
|
[bearer](../README.md#bearer)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json
|
|
- **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)
|
|
|