Backend as a Service (BaaS)

HAT creation gets automatically initialised with the supplied email address and autogenerated password

Once the HAT PDA is up and running (2-3 seconds), the user gets automatically logged in and presented with the HMI Screen. HMI is the HAT Microserver Instructions hat the HAT PDA owner issues and represents the legal contract between the HAT PDA owner and the application in order to enable the application to interact with the HAT PDA.

Once HMI is confirmed, the user gets redirected through the OAuth process of each data plug provider (eg facebook) in order to setup data plug access into the HAT PDA, if the data plug have not yet been set up. If it has been set up, only the application’s permissions would be required

Upon finishing data access setup for all required providers, the user will be redirected back to the redirect_uri

Instructions for Single Screen Frictionless HAT PDA Vending

In order to use frictionless HAT PDA vending with BaaS, the only requirement from your application or webpage, is to collect user's email address and HAT PDA username.

  1. Your application (web or mobile) collects the email address and HAT PDA username of the user (with precautionary measures against spam bots)
  2. In order to register users via baas, the application or webpage needs to redirect users to the following URL:

    https://hatters.dataswift.io/services/baas/signup

    With the following query parameters:

    "hat_name"
    "email"
    "application_id"
    "redirect_uri"

    Please use the value of A​pplication ID​ in the kit summary to test

  3. The user is presented with the HMI Screen. HMI is the HAT Microserver Instructions that the HAT owner issues and is the legal contract between the HAT PDA owner and the application to enable the application to interact with his/her HAT.
  4. The user will be redirected back to the callback URL from step 2 after accepting the HMI screen
  5. In case signup is successful the user will be redirected back to your application with query parameter token, the application token for that user.

    In case signup fails at any stage of the process, the user will be redirected back to your application with query parameters error and error_reason. It is left up to each individual application to decide how the failures should be communicated to the user. Currently error field will always have the value hat_provisioning. The error_reason field can have multiple values depending on the failure type:

    • out_of_capacity
    • duplicate_email
    • invalid_submission_data
    • user_cancelled
    • uncaught_error
  6. The token is generated using JWT standard and it carries additional information about the issuer, application and expiration date. The issuer parameter can be used to extract the domain name of the HAT.

Access data debit values

The data itself can be retrieved from the data debit endpoint on that HAT, the request details are documented here:

https://documenter.getpostman.com/view/110376/S1EH4ha8?version=latest#d04abe75-2a9f-429c-98b5-381a39498cbc

Note that HAT domain name will be different for each user and needs to be adjusted based on information encoded in the token. The token itself is used for authenticating the request and should be passed as a “X-Auth-Token” header.

https://{{userHatDomain}}/api/v2.6/data-debit/app-{{applicationId}}/values