> For the complete documentation index, see [llms.txt](https://rtkdocs.geodnet.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rtkdocs.geodnet.com/rtk-service/enterprise-rtk-api-list/overview.md).

# Overview

This document defines APIs of the GEODNET RTK service, including *User Management* and *Base Station Coverage*.

{% hint style="success" %}
Note

All APIs use a request `sign` generated from request parameters and your secret `appKey`. Responses use a business envelope with `{ code, msg, data }`.
{% endhint %}

## **Encryption parameter**

| Parameter | Type   | Description     |
| --------- | ------ | --------------- |
| appId     | String | Application ID  |
| appKey    | String | Application Key |

{% hint style="success" %}
Note

`appId` and `appKey` uniquely identify your tenant and are provided by GEODNET. Please request them from GEODNET.
{% endhint %}

## **Encryption method**

1. Sort the keys of **all request parameters** in ascending character order, **excluding** `appKey` and `sign`.
2. Concatenate the corresponding *values* by that key order to a single string.
3. Concatenate the string with `appKey` (append).
4. Compute MD5 hash of the final string to produce the `sign` value (hex lowercase).

```javascript
# pseudo
ordered_keys = sort(keys(params - {sign}))
concat_values = ''.join(str(params[k]) for k in ordered_keys)
payload = concat_values + appKey
sign = md5_hex(payload)
```

{% hint style="danger" %}
Important

Do not include `appKey` or `sign` in the sorted parameter set. Ensure time values are milliseconds (Unix epoch ms) and MD5 output is lowercase hex.
{% endhint %}

## **Encryption example**

**Example parameter**

```
appId: geodnet
appKey: 2916350764adb542
```

**Request parameters**

| Parameter | Example                          | Type   | Required | Description                              |
| --------- | -------------------------------- | ------ | -------- | ---------------------------------------- |
| appId     | geodnet                          | String | Y        | Application ID                           |
| username  | geoduser                         | String | Y        | username                                 |
| password  | geodpass                         | String | Y        | password                                 |
| trialDays | 7                                | Number | Y        | Free trial days                          |
| time      | 1718150400000                    | Number | Y        | Current server timestamp in milliseconds |
| sign      | 8dd687e158219da6ccc689aef6c0a6a1 | String | Y        | Encrypted signature                      |

**Steps**

1. Parameter ordering (excluding `sign`)

```
appId,password,time,trialDays,username
```

2. Field value concatenation

```
geodnetgeodpass17181504000007geoduser
```

3. Concat with `appKey`

```
geodnetgeodpass17181504000007geoduser2916350764adb542
```

4. Generate `sign`

```
md5("geodnetgeodpass17181504000007geoduser2916350764adb542")
= 8dd687e158219da6ccc689aef6c0a6a1
```

## **Implementation hints**

{% tabs %}
{% tab title="Javascript" %}

```javascript
// JavaScript (Node.js) example
import crypto from "crypto";

function buildSign(params, appKey) {
  const keys = Object.keys(params).filter(k => k !== "sign").sort();
  const concat = keys.map(k => String(params[k])).join("") + appKey;
  return crypto.createHash("md5").update(concat).digest("hex");
}

const params = { appId: "geodnet", username: "geoduser", password: "geodpass", trialDays: 7, time: 1718150400000 };
const sign = buildSign(params, "2916350764adb542");
```

{% endtab %}

{% tab title="Python" %}

```python
# Python example
import hashlib

def build_sign(params: dict, app_key: str) -> str:
    keys = sorted(k for k in params.keys() if k != "sign")
    concat = "".join(str(params[k]) for k in keys) + app_key
    return hashlib.md5(concat.encode("utf-8")).hexdigest()

params = {"appId": "geodnet", "username": "geoduser", "password": "geodpass", "trialDays": 7, "time": 1718150400000}
sign = build_sign(params, "2916350764adb542")
```

{% endtab %}
{% endtabs %}
