You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to set an entry in a module in my suitecrm instance the method am using is this
static Future<bool> createTurnoVigilante({
required String nombre,
required String inicioFinalTurno,
required int turnoExtra,
required String rostroVigilanteBase64, // Imagen en Base64
required String latitud,
required String longitud,
required String uuid,
}) async {
final String? decryptedSessionId = await AuthenticationService.getDecryptedSessionId();
final String? suitecrmUrl = await _storage.read(key: 'suitecrm_url');if (decryptedSessionId == null || suitecrmUrl == null) {
print("No se pudo obtener la sesión o la URL de SuiteCRM.");returnfalse;
}
final Uri endpointUri = Uri.parse('$suitecrmUrl/service/v4_1/rest.php');
final response = await http.post(
endpointUri,
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: {
'method': 'set_entry',
'input_type': 'JSON',
'response_type': 'JSON',
'rest_data': jsonEncode({
'session': decryptedSessionId,
'module_name': 'tuvi_turnos_vigilantes',
'name_value_list': [
{'name': 'name', 'value': nombre},
{'name': 'mao_inicio_final', 'value': inicioFinalTurno},
{'name': 'mao_turno_extra', 'value': turnoExtra.toString()},
{'name': 'mao_rostro_vigilante', 'value': rostroVigilanteBase64}, // Image in Base64
{'name': 'latitude_c', 'value': latitud},
{'name': 'longitude_c', 'value': longitud},
{'name': 'mao_uuid_c', 'value': uuid},
],
}),
},
);if (response.statusCode == 200) {
final data = json.decode(response.body);if (data['id'] != null) {
returntrue;
}
}
returnfalse;
}
also I try to make the request in postman and in both the entry is created but the image in the module don't display any image and in the data base the value in the field of the base64 image is the base64 code of the image, maybe am missing something?
Possible Fix
No response
Steps to Reproduce the Issue
1.
2.
3.
...
Context
No response
Version
7.1.0
What browser are you currently using?
Chrome
Browser Version
No response
Environment Information
PHP
Operating System and Version
Windows 10
The text was updated successfully, but these errors were encountered:
alexoberco
changed the title
Unable to upload images in API_REST V4.1 through fluuter mobile aplication
Unable to upload images in API_REST V4.1 through flutter mobile app
Jun 14, 2024
Issue
I am trying to set an entry in a module in my suitecrm instance the method am using is this
also I try to make the request in postman and in both the entry is created but the image in the module don't display any image and in the data base the value in the field of the base64 image is the base64 code of the image, maybe am missing something?
Possible Fix
No response
Steps to Reproduce the Issue
Context
No response
Version
7.1.0
What browser are you currently using?
Chrome
Browser Version
No response
Environment Information
PHP
Operating System and Version
Windows 10
The text was updated successfully, but these errors were encountered: