Adding Applications

Adding Applications

This section contains instructions for creating an Application.

Adding Applications using the Console

Go to Applications in the top menu, and click + Add Application to reach the application registration page. Fill the application ID. The other fields are optional.

Click Create Application to create the application.

Application creation

Your application will be created and you will be redirected to the application overview page of your newly created application.

Application overview

You can now use the built-in MQTT Server or HTTP Webhooks to receive uplink and send downlink traffic. End devices are created within applications (see Adding Devices section).

If you did not uncheck the Link automatically checkbox during creation, your application will be automatically linked to the Application Server. You can skip this section in this case.

In order to send uplinks and receive downlinks from your device, you must link the Application Server to the Network Server. To do this, create an API key for the Application Server by going to API keys in the left menu of your application, and then clicking + Add API Key.

In the API Key creation screen, enter a name for your linking API key and select the Link as Application to a Network Server right, then press Create API Key.

Application API Key creation

You will see a screen that shows your newly created API Key. Copy it in your clipboard by pressing the copy button. After saving the key in a safe place, press I have copied the key.

Note: You will not be able to see this key again in the future, but if you lose it, you can create a new one to replace it.

Application API Key created

Now go to Link in the left menu of the application and enter the API key you’ve just created. You can leave the Network Server address empty. Press Save Changes to save the link settings.

Application link creation

You can now see the status of the linking process appear in the right part of your screen. This also shows the statistics of the link between the Application Server and the Network Server.

Your application is now linked, so you can proceed with using the MQTT server and webhooks for receiving uplink traffic and sending downlink traffic.

Adding Applications using the CLI

Create the first application:

$ ttn-lw-cli applications create app1 --user-id admin

This creates an application app1 with the admin user as collaborator.

End devices are created within applications (see Adding Devices section).

In order to send uplinks and receive downlinks from your device, you must link the Application Server to the Network Server. In order to do this, create an API key for the Application Server:

$ ttn-lw-cli applications api-keys create \
  --name link \
  --application-id app1 \
  --right-application-link

The CLI will return an API key, such as NNSXS.VEEBURF3KR77ZR.... This API key has only link rights and can therefore only be used for linking this application. Make sure to copy the key and save it in a safe place.

Note: You will not be able to see this key again in the future, and if you lose it, you can create a new one to replace it in the gateway configuration.

You can now link the Application Server to the Network Server:

$ ttn-lw-cli applications link set app1 --api-key NNSXS.VEEBURF3KR77ZR..

Your application is now linked, so you can proceed with using the MQTT server and webhooks for receiving uplink traffic and sending downlink traffic.