👤

User/patient

Find here all relevant information on how to create and update a user or a patient.

Register a new user

The following snippet shows how you can register a new user. You do not need authentication for registration.
Flutter
React Native
import 'package:flutter_fibricheck_sdk/flutter_fibricheck_sdk.dart';
import 'package:flutter_fibricheck_sdk/userdata.dart';
​
_sdk.register(UserRegisterData(
firstName: "John",
lastName: "Doe",
password: "Strong!987",
phoneNumber: "000000",
birthday: "1990-07-06",
gender: 0, // 0 = Not known; 1 = Male; 2 = Female; 9 = Not applicable
country: "JO", // or "AE"
language: "AR",
// It has to be a time zone that is compatible w/
// (https://docs.oracle.com/javase/8/docs/api/java/time/ZoneId.html#of-java.lang.String-)
// This library will fetch the correct time zones:
// https://pub.dev/packages/flutter_native_timezone
// The time zone will be used to render the correct times in the measurement reports
timeZone: "Europe/Brussels"
));
import client from '@fibricheck/javascript-sdk';
​
const sdk = client({
consumerKey: '',
consumerSecret: '',
});
​
const user = await sdk.register({
firstName: 'John',
lastName: 'Doe',
password: 'Strong!987',
phoneNumber: '000000',
birthDay: '1970/01/01',
gender: 0, // 0 = Not known; 1 = Male; 2 = Female; 9 = Not applicable
country: 'JO', // or 'AE'
language: 'AR',
// It has to be a time zone that is compatible w/
// (https://docs.oracle.com/javase/8/docs/api/java/time/ZoneId.html#of-java.lang.String-)
// This library will fetch the correct time zones:
// https://github.com/zoontek/react-native-localize#gettimezone
// The time zone will be used to render the correct times in the measurement reports
timeZone: "Europe/Brussels"
});
​