# How to integrate Tektelic Network Server with TagoIO

**URL:** <https://community.tago.io/t/how-to-integrate-tektelic-network-server-with-tagoio/847>\
**Category:** Tutorials\
**Tags:** tutorials\
**Created:** [January 22, 2022, 4:59am UTC](https://community.tago.io/t/how-to-integrate-tektelic-network-server-with-tagoio/847 "2022-01-22T04:59:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex034/user_avatar/community.tago.io/system/32/24_2.png) [@system](https://community.tago.io/u/system)\
**Post date:** [January 22, 2022, 4:59am UTC](https://community.tago.io/t/how-to-integrate-tektelic-network-server-with-tagoio/847/1 "2022-01-22T04:59:27Z")

</div>

This tutorial provides a step-by-step guide to integrate Tektelic with the TagoIO Platform. By following these instructions, you will enable uplink and downlink operations, allowing data exchange between your LoRaWAN devices and the TagoIO application.

## Prerequisites

Before you begin, ensure you have the following:

- Tektelic Account
- LoRaWAN Device: Ensure your device is connect to Tektelic and transmitting data.

* * *

## Step 1: Create Authorization in TagoIO

1. Access Authorizations:

2. Create a New Authorization:

3. Copy the Authorization Token:

 ![](https://canada1.discourse-cdn.com/flex034/uploads/tagoio1/original/1X/0abbfffc3f389229c89c7b9abc0b710d6642d9fe.jpeg)

## 

* * *

## Step 2: Set Up Data Converter in Tektelic

Tektelic provides built-in data converters, but if you prefer using TagoIO’s converter or if Tektelic lacks a specific converter for your device, follow these steps:

1. **Log in to your Tektelic Administrator Console.**

2. **Navigate to Data Converters:**

3. **Fill Converter Details:**

| Field | Description |
| Name | Enter a unique identifier (e.g.,&nbsp;tagoio-decoder). |
| Type | Select&nbsp;CUSTOM&nbsp;from the dropdown menu. |
| Decoder | Copy the provided decoder script below |
| Encoder | 
Copy the provided encoder script below
 |

**Encoder:**

```auto
// Do not decode anything, just put it into AS as is
var arr = [];
for (var i = 0; i < bytes.length; ++i) {
    arr.push(bytes[i]);
}
return {"bytes": JSON.stringify(arr), "port": port, "payload length": bytes.length};​

```

**Decoder:**

```javascript
// Encode downlink messages sent in
// Base64 format as an array or buffer of bytes.
function atob(input) {
    var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
    var str = String(input).replace(/[=]+$/, ''); // #31: ExtendScript bad parse of /=
    if (str.length % 4 === 1) {
        throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded.");
    }
    for (
        var bc = 0, bs, buffer, idx = 0, output = '';
        buffer = str.charAt(idx++);
        ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0
    ) {
        buffer = chars.indexOf(buffer);
    }
    return output;
}

function base64ToArray(base64) {
    var binary_string = atob(base64);
    var len = binary_string.length;
    var result = [];
    for (var i = 0; i < len; i++) {
        result.push(binary_string.charCodeAt(i));
    }
    return new Int8Array(result);
}

if (data.params) {
    var bytes = base64ToArray(data.params.data);
    return {"port": data.params.port, "bytes": bytes};
}

return {"port": 0, "bytes": [0x00]};

```

 ![Data Converter](https://canada1.discourse-cdn.com/flex034/uploads/tagoio1/original/1X/ff568e4c94e529047c98a1b4e160fee5be48584d.png)

## 

* * *

## Step 3: Set Up Integration in Tektelic

1. Navigate to Integrations:

2. Fill Integration Details:

| Field | Description |
| Name | Enter a unique identifier (e.g.,&nbsp;tagoio-integration). |
| Type | Select&nbsp;TagoIO&nbsp;from the dropdown menu. |
| Data Converter | Select the TagoIO converter you created earlier or you preferred converter. |
| Authorization | 
Add a header for Authorization and set its value to the authorization token you copied in Step 1.
 |

> 📝 After saving the integration, copy the HTTP URL path provided. This URL will be used to link Tektelic with TagoIO.

* * *

## Step 4: Configure Authorization in TagoIO for Downlink Support (Optional)

1. Edit Authorization:

2. Paste HTTP URL Path:

3. Save Changes:

 ![Integration example](https://canada1.discourse-cdn.com/flex034/uploads/tagoio1/original/1X/7a52f3c6468198d2fea8a23b16803011406a18e3.png)

## 

**Save the Integration:**

- After filling in all the fields, click **Save** to create the webhook integration.

* * *

## Step 5: Add Device in TagoIO

To integrate your device with the TagoIO Platform, follow these guidelines:

1. **Ensure Device EUI Consistency:**

2. **Select the Appropriate Network and Device Type:**

3. **Add Device Support via Connectors (If Necessary):**

For detailed instructions on adding devices, visit the [Adding Devices](https://help.tago.io/portal/en/kb/articles/3-devices#Adding_devices) page.

* * *

## Finalizing Setup

1. **Power On Your Devices:**

2. **Verify Data Reception:**

With data successfully flowing into TagoIO, you can start creating Dashboards, Analyses, and Actions to visualize and manage your device data effectively.
