Simprints Documentation
  • Introduction
    • Goals
    • Audience
    • Disclaimer
  • Product Overview
    • Product Overview
      • Simprints ID (SID)
        • Enrolment
        • Verification
        • Indentification
      • Biometrics
        • Fingerprints Recognition
          • Vero Fingerprint Scanners
        • Face Recognition
      • SID Intents Launcher
      • Cloud Backend
      • Data Collection Platforms
        • DHIS2
        • CommCare
        • ODK + Survey CTO
  • Architecture
    • System architecture
      • Mobile
        • Simprints ID (SID)
          • Project structure
          • Biometric flow orchestration
  • Installation
    • Installation, Quick Start and Device Requirements
      • Installation
      • Quick Start Guide
      • Device Requirements
  • Security & Privacy
    • Security & Privacy Considerations
      • Security Policy
      • Responsible Use
      • Privacy Policy
      • Cookie Policy
  • Development
    • Getting setup
    • Simprints for Developers
      • Simprints for Developers
      • Integrating with Simprints
        • Getting Started
        • Enrollment
        • Identification
        • Verification
        • Exit Forms
        • Confidence Score Bands
        • Enrolment & Identification +
        • Handling Errors
        • Metadata
      • Other Intergrations
        • ODK Integrations + SurveyCTO
          • Enrol
          • Identify
          • Verify
          • FAQ
        • CommCare Integration
          • CommCare: Enrolment
          • Identification
          • FAQs
          • ↔️CoSync
        • DHIS2
  • Troubleshooting
    • FAQs
    • Common Issues
  • Community & Support
    • Support Channels
    • Community Guidelines
    • Open Source Contributions
  • Product Roadmap
    • Product Roadmap
      • Current Releases
      • Previous Releases
      • Submit an Idea or Request
  • Licence
  • Contribution Guidelines
    • Contribution Guidelines
      • Code Contributions
      • Bug Reports
      • Feature Requests
  • Supporting Partners
Powered by GitBook
LogoLogo
On this page
  • What is Metadata?
  • Using Metadata
  • Invalid JSON object
  • Subject Age metadata parameter

Was this helpful?

Edit on GitHub
  1. Development
  2. Simprints for Developers
  3. Integrating with Simprints

Metadata

PreviousHandling ErrorsNextOther Intergrations

Last updated 8 months ago

Was this helpful?

What is Metadata?

Metadata is any added information that you would like Simprints ID to capture alongside the biometrics. It is really helpful to capture metadata collecting important metrics for your project. The metadata is stored as a string of key-value pairs, and Simprints ID's Metadata class only supports values of Double, Long, Boolean, and String.

Using Metadata

To create the metadata you intend to use for your app, you can create an Instance of the Metadata class and pass your key-value pairs using the put method:


// Note: This is the recommended approach, in order to avoid Invalid_JSON errors.
// create an instance of Metadata and attach the key-value pairs using 'put'
val metadata = Metadata()
    .put("identificationReason", "postnatal care visit")
    .put("childPresent", true)
    .put("childAge", 3)

// pass the Metadata object to the request data
simprintsLauncher.launch(SimprintsRequest.Enrol(
  projectId = "Project ID", 
  userId = "User ID",
  moduleId = "Module ID",
  metadata = metadata,
))

Invalid JSON object

The Metadata class will throw an exception for two reasons:

  • The JSON String is not a valid JSON object

  • The JSON object contains parameters that are invalid for Simprints, such as a dictionary or array.

// Invalid JSON string: arrays are not allowed
{
    "identificationReason": "postnatal care visit",
    "childPresent": true,
    "required": [        // Dictionaries and arrays are not allowed 
        "firstName", 
        "lastName"
    ]
}

Subject Age metadata parameter

For projects that have age restrictions (e.g. only work with subjects between 9 and 60 months old) Simprints ID will expect the subject's age to be passed along in the Metadata for Enrollment and Verification callouts. The name of the parameter is subjectAge, it should be of type Long and contain the subject's age in months:

val metadata = Metadata().put("subjectAge", 30) // subject is 30 months old
JSON