Skip to main content
Version: 1.8.5

CREATING A MICROSHARE CONNECTION

Available since ThingPark X IoT Flow 1.7.18.

The Microshare connector sends the uplinks of your devices to your Microshare account, where they are stored with the record type io.microshare.actility.packed.

The data follows this path: LoRaWAN® device → ThingPark Enterprise → ThingPark X IoT Flow connection → Microshare.

You need a Microshare account, on the production or the development environment, before you create the connection.

Collecting Expected Information​

Parameters required

UI FieldDescription
NameName of the connection.
ApiKeyAPI key of the app created in your Microshare account. See API Key.
UsernameUsername of your Microshare account.
PasswordPassword of your Microshare account.
Use development environmentOn when your account is on the Microshare development environment. Off by default, for the production environment.
DescriptionOptional description of the connection.

API Key​

The ApiKey authenticates ThingPark X IoT Flow with the Microshare services. To create one:

  1. Log in to your Production or Dev Microshare account.

  2. Go to Manage -> Keys. Microshare manage keys

  3. Click CREATE NEW APP. Microshare create app

  4. Once the app is created, copy its API key. Microshare app list

Creating a Connection With UI​

  1. In ThingPark Enterprise, click Connections -> + Add Connection -> ThingPark X IoT Flow. Add a ThingPark X IoT Flow connection in ThingPark Enterprise

  2. In ThingPark X IoT Flow, click Microshare in the list of connectors. Select the Microshare connector

  3. Fill in the form:

    • Name: a clear name for the connection, for example My Microshare Connection.
    • ApiKey: the API key of the app created in Manage -> Keys in Microshare.
    • Username: the username of your Microshare account.
    • Password: the password of your Microshare account.
    • Use development environment: turn it on if your account is on the development environment (dapp.microshare.io). Keep it off for the production environment (app.microshare.io).
    • Description: optional. Set your Microshare connection
  4. Click Create. A notification confirms that the connection has been created, and the connection details open.

  5. In the connection details, check that the connection is OPENED (see Connection States).

Note

Parameters marked with * are mandatory.

Creating a Connection With API​

When you click Create in the UI, ThingPark X IoT Flow gets a token from Microshare with your ApiKey, username and password, and creates an HTTP connection that posts the uplinks to the Microshare ingest service with this token. With the API, you get the token yourself, then create the connection.

  1. Get a token from the Microshare authentication service. For the development environment, use https://dauth.microshare.io instead of https://auth.microshare.io.

    curl -X POST "https://auth.microshare.io/oauth2/token?username={YOUR-USERNAME}&password={YOUR-PASSWORD}&client_id={YOUR-API-KEY}&grant_type=pipe&scope=ALL:ALL"

    The token is the access_token field of the response.

  2. Create the connection with this token.

To do this, you need to use the Connections group resource:

  • POST /connections to create a new Connection instance
  • PUT /connections to update a Connection instance
  • DELETE /connections to delete a Connection instance
Note

We follow the REST-full API pattern, when updating configuration properties for a connection resource. Thus, you must also provide the whole configuration again.

Example for creation of a new connection instance:

POST /connections
{
"name": "Actility To Microshare",
"connectorId": "actility-http-iot",
"configuration": {
"description": "My first Microshare connection.",
"destinationURL": "https://ingest.microshare.io/share/io%2Emicroshare%2Eactility%2Epacked/token/{YOUR-MICROSHARE-TOKEN}"
},
"brand": "MICROSHARE"
}

The following table lists the properties applicable to a connection instance.

FieldDescription
connectorIdMust be set to actility-http-iot.
configuration/descriptionDescription of the connection.
configuration/destinationURLMust be set to https://ingest.microshare.io/share/io%2Emicroshare%2Eactility%2Epacked/token/{YOUR-MICROSHARE-TOKEN}, with the token returned by Microshare. For the development environment: https://dingest.microshare.io/share/io%2Emicroshare%2Eactility%2Epacked/token/{YOUR-MICROSHARE-TOKEN}.
brandMust be set to MICROSHARE.
Important note

All properties are not present in this example. You can check the rest of these properties in the common parameters section.

Associating Devices With the Connection​

In ThingPark Enterprise, open Devices, select a device, and add the connection to the Connections of the device. You can also select the connection when you create a device, or for many devices at once with a CSV file in Devices -> Bulk Operations.

Displaying Information to Know if It Worked​

To check the data received by Microshare, create a view as described in the Microshare Views Guide, with this pipeline query:

[
{
"$match": {
"recType": "io.microshare.actility.packed"
}
},
{
"$limit": 100
}
]

Limitations​

There is no known limitation of the Microshare connector.

Troubleshooting​

  • The connection is not created: ThingPark X IoT Flow checks the ApiKey, the username and the password with Microshare when you click Create. Check them, and check that Use development environment matches the environment of your Microshare account.