DataPlugs are the microservices that bring data from other digital resources into HATs. However, to ensure users' privacy in the distributed ecosystem, DEX requires DataPlugs to be registered before they can be plugged into a HAT.

DEX records some basic data about every plug:

Parameter Description Required/Generated
uuid UUID of the DataPlug Generated
providerId date when the field was created Generated
created date when the DataPlug was registered Generated
name Alpha-numerical name of the Plug Required
description Textual description of what the Plug Does Required
url Address of the plug for users to visit to connect Required
illustrationUrl Logo of the plug, typically shown in the UI for connecting plugs Required
passwordHash Hash of the DataPlug's password, set up with a HAT when connecting Required
approved Whether or not the plug has been approved within the DEX Required

To register a new DataPlug, you will need to (contact)[mailto:contact@hatdex.org] us, providing the required details. Your plug will then be reviewed to check if it matches the HATDeX platform's governance rules, e.g. only sending the personal data to users' HATs and nowhere else. The review will also include a check on how the plug works, etc.

Listing DataPlugs

All DataPlugs are public, listed by the DEX:

"request": {
	"method": "GET",
	"header": [
		{
			"key": "Content-Type",
			"value": "application/json",
			"description": ""
		},
		{
			"key": "X-Auth-Token",
			"value": "ACCESS_TOKEN",
			"description": ""
		}
	],
	"body": {},
	"url": "https://dex.hubofallthings.com/api/dataplugs",
	"description": ""
}

Providing a list of all DataPlugs and their details.

Connecting a DataPlug

Since HATs are distributed and are likely to be created before you register your own DataPlug, HATs do not necessarily recognise the plug and your authentication would fail initially. When your DataPlug is registered, you as the owner of the plug receive a set of credentials to use with the DEX and your account is associated with the plug as the "owner" account. Before you can connect to a HAT, you need to ask DEX to connect:

"request": {
	"method": "GET",
	"header": [
	{
		"key": "X-Auth-Token",
		"value": "ACCESS_TOKEN",
		"description": ""
	}
	],
	"body": {},
	"url": "https://dex.hubofallthings.com/api/dataplugs/DATAPLUG_ID/connect",
	"description": ""
}

Once DEX responds with 200 OK status and a message saying that the DataPlug has been connected, you can connect directly to the HAT with username matching the name of your plug and the password corresponding to the passwordHash.

© 2017 - 2019 HAT Data Exchange Ltd.