# getId method

String getId()

Gets the ID of the most similar face template as defined in the reference face template list used to perform the search.

return ID of the most similar face template as defined in the reference face template list used to perform the search. throws FaceException An error has occurred during Face Library execution.

## Implementation

    String getId() {
      Pointer<Char> pId = nullptr;
      Pointer<Int> pIdSize = calloc.allocate(1);
      pIdSize[0] = -1;
      try {
        var err = faceSDK.id3FaceCandidate_GetId(_pHandle.value, pId, pIdSize);
        if (err == FaceError.insufficientBuffer.value) {
          pId = calloc.allocate(pIdSize.value);
          err = faceSDK.id3FaceCandidate_GetId(_pHandle.value, pId, pIdSize);
          if (err != FaceError.success.value) {
            throw FaceException(err);
          }
        }
        final vId = utf8.decode(Uint8List.fromList(pId.cast<Uint8>().asTypedList(pIdSize.value)));
        return vId;
      } finally {
        calloc.free(pId);
        calloc.free(pIdSize);
      }
    }