import 'package:openapi/api.dart';
All URIs are relative to https://demo.2fauth.app
Method | HTTP request | Description |
---|---|---|
getTwofaccountsIdQrcode | GET /api/v1/twofaccounts/{id}/qrcode | Encode a 2FA account in a QR code |
postQrcodeDecode | POST /api/v1/qrcode/decode | Decode a QR code |
GetTwofaccountsIdQrcode200Response getTwofaccountsIdQrcode(id)
Encode a 2FA account in a QR code
Returns a QR code that represents a 2FA account owned by the authenticated user
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: Bearer-Auth
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('Bearer-Auth').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('Bearer-Auth').setAccessToken(yourTokenGeneratorFunction);
final api_instance = QrcodeApi();
final id = 1; // int | The ID of the resource
try {
final result = api_instance.getTwofaccountsIdQrcode(id);
print(result);
} catch (e) {
print('Exception when calling QrcodeApi->getTwofaccountsIdQrcode: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
id | int | The ID of the resource |
GetTwofaccountsIdQrcode200Response
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PostQrcodeDecode200Response postQrcodeDecode(qrcode)
Decode a QR code
Use this endpoint to decode a QR code (an image file: jpeg, png, bmp, gif, svg, or webp). The QR code is expected to be a 2FA resource but any QR code will be decoded.
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: Bearer-Auth
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('Bearer-Auth').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('Bearer-Auth').setAccessToken(yourTokenGeneratorFunction);
final api_instance = QrcodeApi();
final qrcode = BINARY_DATA_HERE; // MultipartFile | A QR code image file
try {
final result = api_instance.postQrcodeDecode(qrcode);
print(result);
} catch (e) {
print('Exception when calling QrcodeApi->postQrcodeDecode: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
qrcode | MultipartFile | A QR code image file |
- Content-Type: multipart/form-data
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]