> For the complete documentation index, see [llms.txt](https://supportx.gitbook.io/buku-mantra-and-sihir/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://supportx.gitbook.io/buku-mantra-and-sihir/ake/mpgs/mpgs-system-api-v3.6.md).

# MPGS System API v3.6

## 1. Overview

### 1.1. Instructions

#### 1.1.1. Intended readers

This system developer, third-party docking system developer

## 2. Interface Description

### 2.1. Protocol Description

Http protocol

### 2.2. Request Method

POST

Request a public address, as follows, each specific interface has a subdivided name, please see the description of the service address of each interface.

Request address prefix:

`http://ip:port/mpgs/api/v3/`

Example: such as the interface for obtaining parking space status:

`http://ip:port/mpgs/api/v3/parkingSpace/getParkingSpaceInfo`

#### 2.2.1. Safety Instructions

1\. Both requests and responses need to be verified by signatures, specifically in the chapter on signature verification

2\. AES encryption for transmission content (disabled by default, enabled when high security is required)

#### 2.2.2. Public Request Parameters Description

Parameters that must be brought with each request:

| No. | Variable Name | Required or Not | Sample Value | Type   | Description                                                                                                             |
| --- | ------------- | --------------- | ------------ | ------ | ----------------------------------------------------------------------------------------------------------------------- |
| 1   | key           | Yes             |              | String | The key provided by the MPGS system to the third-party access system to uniquely identify the third-party access system |
| 2   | timestamp     | Yes             |              | String | yyyyMMddHHmmss                                                                                                          |
| 3   | version       | Yes             |              | String | Interface version, currently: V3.6.0                                                                                    |
| 4   | sign          | Yes             |              | String | Signature, used for authentication, see the next section for the specific signature method                              |

#### 2.2.3. Signature Method

The content in the data needs to be authenticated to ensure that the information carried is true, effective, and reasonable. Therefore, the method of generating the sign string will be defined here.

1\.  After the public request parameters are sorted according to the ASCII code of the field name from small to large (dictionary order), the URL key-value pair format (ie key1=value1\&key2=value2...) is used to concatenate the string into string1,

2\.  At the end of string1, splicing secret=\[signature key secret] to get stringSignTemp character string, and perform md5 operation on stringSignTemp to get the sign value;

The following defines a demo to generate the sign string:

**Fixed Parameter:**

key=A10001

timestamp=20170101235959

version=V3.0.0

**Signing Key:**

secret=uqvmk807oehIZ7wS

**Obtained:**

sign=CAA20989D7AD77A3CB8F3AAD5076CD4C

#### 2.2.4. Response Data Format

JSON format, the specific parameters are as follow:

&#x20;

| Field Name         | Variable Name | Required or Not | Sample Value                             | Type   | Description                                                                                                                                                                                                           |
| ------------------ | ------------- | --------------- | ---------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| status code        | ret           | Yes             | 0                                        | int    | <p>Return code 0 means success, non-zero means failure.</p><p>0 Business success</p><p>1 System abnormal</p><p>2 Signature error</p><p>3 Key error</p><p>4 Unauthorized</p><p>5 Request parameters are incomplete</p> |
| result description | msg           | Yes             | (Get the verification code successfully) | String | Describe this result                                                                                                                                                                                                  |
| return data        | data          | No              |                                          | {}     | Result data, json format object, when the value is empty, return {}.                                                                                                                                                  |

Eg:

```json
{
    "ret": 0,
    "msg": "Get the vacant parking spaces successfully",
    "data": "{}"
}
```

#### 2.2.5. Coding Description

UTF-8

#### 2.2.6. Response Processing Order

Judge the protocol return error code when processing returns

## 3. API Description

### 3.1. Business Interface

#### 3.1.1. Get Parking Spaces Status

1\. Business Description

The third-party access system requests the guidance system to obtain the real-time status of all parking spaces.

2\. Service Address

`parkingSpace/getParkingSpaceInfo`

3\. Frequency of Calling

Real Time

4\. Calling Method

Guidance system provides interface, third-party access system actively requests

5\. Request Parameter Description

| Parameter Name     | Required or Not | Type    | Description                                                                                               |
| ------------------ | --------------- | ------- | --------------------------------------------------------------------------------------------------------- |
| pageSize           | No              | int     | Number of pages                                                                                           |
| recordStart        | No              | int     | Number of requested pages                                                                                 |
| carLicenseNumber   | No              | String  | License plate number                                                                                      |
| parkingSpaceNumber | No              | String  | Parking space number                                                                                      |
| imageCovertFlag    | No              | Boolean | Do you need image base64 information. The default is true, if you don’t need it, pass the parameter=false |

&#x20;

6\. Response Parameter Description

&#x20;

| Parameter Name | Required or Not | Type | Description             |
| -------------- | --------------- | ---- | ----------------------- |
| count          | Yes             | int  | Total                   |
| list           | Yes             | Json | Parking space data list |

&#x20;

&#x20;   List: list single data

| Parameter Name      | Required or Not | Type   | Description                                                                                                                    |
| ------------------- | --------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------ |
| parkingSpaceType    | Yes             | int    | <p>Parking space type</p><p>0-temporary car</p>                                                                                |
| parkingSpaceNumber  | Yes             | String | Parking space number (actually equal to mapName\_parkingSpaceNumber2, unique in the entire system)                             |
| parkingSpaceNumber2 | Yes             | String | Parking space number (the same name can be used between different floors)                                                      |
| parkingSpaceStatus  | Yes             | int    | <p>Parking tatus</p><p>0-Vacant</p><p>1- Occupied</p>                                                                          |
| carLicenseNumber    | Yes             | String | License plate number                                                                                                           |
| mapName             | Yes             | String | Floor                                                                                                                          |
| enterTime           | No              | String | <p>Admission time</p><p>yyyyMMddHHmmss</p>                                                                                     |
| plateColor          | No              | String | <p>License plate color</p><p> (not   available currently)</p>                                                                  |
| enterPlateImage     | No              | String | <p>Entry license plate picture (not available currently)</p><p>Base64 string</p>                                               |
| enterCarImage       | No              | String | <p>Entry car body picture</p><p>Base64 string</p>                                                                              |
| enterCarImagePath   | No              | String | Relative path of car body picture when approaching                                                                             |
| enterPlateImagePath | No              | String | Relative path of entry license plate image                                                                                     |
| carLogo             | No              | String | <p>Vehicle brand</p><p> (not available currently)</p>                                                                          |
| carSizeType         | No              | int    | <p>Vehicle size type (0 unknown, 1 small car, 2 large car, 3 oversized car, 4 medium car)</p><p> (not available currently)</p> |
| belongArea          |                 | String | Statistics area                                                                                                                |
| parkLotName         |                 | String | Car park name                                                                                                                  |

&#x20;

7\. Return example

<div align="left"><figure><img src="https://1731165174-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtQJu2Q0LuwmDBRrVlRsJ%2Fuploads%2Fkb6kdmBVdevoFrZgJvHt%2Fimage.png?alt=media&amp;token=98869e25-0247-4dd4-9f37-32bdfae3164a" alt="" width="69"><figcaption></figcaption></figure></div>

8\. Business Failure Status Code Description

| Status Code | Description |
| ----------- | ----------- |
|             |             |
|             |             |
|             |             |

#### &#x20;3.1.2. Get Basic Car Park Data

9\. Business Description

The third-party access system requests the guidance system to obtain the basic data of the car park.

10\. Service Address

`parkingLot/getParkingLotInfo`

11\. Frequency of Calling

Real Time

12\. Calling Method

Guidance system provides interface, third-party access system actively requests

&#x20;

13\. Request Rarameter Description

| Parameter Name | Required or Not | Type | Description |
| -------------- | --------------- | ---- | ----------- |
|                |                 |      |             |

&#x20;

14\. Response Parameter Description

| Parameter Name        | Required or Not | Type     | Description                      |
| --------------------- | --------------- | -------- | -------------------------------- |
| parkingLotCode        | Yes             | String   | Parking lot number               |
| parkingLotCustomCode  | Yes             | String   | Parking lot custom number        |
| parkingLotName        | Yes             | String   | Parking lot name                 |
| parkingLotLongitude   | No              | number   | longitude                        |
| parkingLotLatitude    | No              | number   | latitude                         |
| parkingLotImage       | No              | String   | Parking lot pictures             |
| totalParkingSpace     | Yes             | int      | Total parking spaces             |
| temporaryParkingSpace | Yes             | int      | Temporary parking space          |
| fixedParkingSpace     | Yes             | int      | Fixed parking space              |
| rentedParkingSpace    | Yes             | int      | Rented parking space             |
| freeParkingSpace      | Yes             | int      | Free parking space               |
| reservedParkingSpace  | Yes             | int      | Reserved parking space           |
| parkingLotAddress     | No              | String   | Parking lot address              |
| usingCount            | Yes             | int      | Occupied parking spaces quantity |
| freeCount             | Yes             | int      | Vacant parking spaces quantity   |
| mapList               | No              | jsonlist | Floor information                |

&#x20;

&#x20;

&#x20;

&#x20;   mapList parameters

&#x20;

| Parameter Name | Required or Not | Type   | Description                      |
| -------------- | --------------- | ------ | -------------------------------- |
| mapName        | Yes             | String | Floor name                       |
| usingCount     | Yes             | int    | Occupied parking spaces quantity |
| freeCount      | Yes             | int    | Vacant parking spaces quantity   |

&#x20;

&#x20;

15\. Return Example

<div align="left"><figure><img src="https://1731165174-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtQJu2Q0LuwmDBRrVlRsJ%2Fuploads%2FYEnI8lIMbrguEzXB9tv9%2Fimage.png?alt=media&amp;token=74bc3a24-9c54-4b9b-96be-fe01d9079dca" alt="" width="95"><figcaption></figcaption></figure></div>

#### 3.1.3. Get Guidance Display Data

16\. Business Description

The third-party access system requests the guidance system to obtain the basic data of the car park.

17\. Service Address

device/getDisplayInfo

18\. Frequency of Calling

Real Time

19\. Calling Method

Guidance system provides interface, third-party access system actively requests

20\. Request Parameter Description

| Parameter Name | Required or Not | Type | Description |
| -------------- | --------------- | ---- | ----------- |
|                |                 |      |             |

&#x20;

21\. Response Parameter Description

| Parameter Name | Required or Not | Type            | Description                                                                                                        |
| -------------- | --------------- | --------------- | ------------------------------------------------------------------------------------------------------------------ |
| deviceId       | Yes             | String          | Device id                                                                                                          |
| formatText     | Yes             | Display content | <p>/R\[←004]/G\[←0→]/B\[0↑]</p><p>/R red</p><p>/G green</p><p>/B blue</p><p>“\[]”shows specific content inside</p> |
| dataList       | Yes             | Display content | <p>V2.0 version needs attention</p><p>No need to pay attention to the V3.0 version</p>                             |

22\. Return Example

<div align="left"><figure><img src="https://1731165174-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtQJu2Q0LuwmDBRrVlRsJ%2Fuploads%2FeZqPjCRfx0xx6XpVkiQG%2Fimage.png?alt=media&amp;token=4cfcee1c-a10b-4476-8445-1064f92da779" alt="" width="92"><figcaption></figcaption></figure></div>

23\. Business Failure Status Code Description

| Status Code | Description |
| ----------- | ----------- |
|             |             |
|             |             |
|             |             |

#### 3.1.4. Get Mobile Phone Car Search Route Map

24\. Business Description

The third-party system requests to guidance system roadmap, here is the H5 page, if it is deployed separately, it needs the support of the external network

25\. Service Address

[http://ip:port/mpgs/vrlsmanH5/index.html](https://supportx.gitbook.io/buku-mantra-and-sihir/ake/mpgs/http:/ip:port/mpgs/vrlsmanH5/index.html)

26\. Frequency of Calling

Real Time

27\. Calling Method

Guidance system provides interface, third-party access system actively requests

### 3.2. Data Report

3.2.1 Parking Space Data Report

MPGS version requires 3.6.3 or higher

URL Reporting address setting: Parking lot management -> parking lot configuration -> external interface configuration -> parking lot request URL

Exit Report Data

cmd: reportCarInOutSpace

&#x20;

| Parameter Name        | Type   | Description            |
| --------------------- | ------ | ---------------------- |
| leaveTime             | String | exit time              |
| stoppingTime          | int    | Parking time (minutes) |
| parkingSpaceNumber    | String | Parking space number   |
| enterCarLicenseNumber | String | Entrance license plate |
| leaveCarImage         | String | Exit picture           |
| confidence            | int    | Confidence             |
| enterCarImage         | String | Entry picture          |
| leaveCarLicenseNumber | String | Exit license plate     |
| enterTime             | String | Entry time             |
| type                  | int    | 1 means exit           |

&#x20;

Entrance Report Data

cmd: reportCarInOutSpace

&#x20;

| Parameter Name        | Type   | Description                  |
| --------------------- | ------ | ---------------------------- |
| parkingSpaceNumber    | String | Parking space number         |
| enterCarLicenseNumber | String | Entry license plate          |
| confidence            | int    | Confidence                   |
| enterCarImage         | String | Entry picture                |
| enterTime             | String | Entry time                   |
| enterPlateImage       | String | Entry liicense plate picture |
| type                  | int    | 0 means enter                |

&#x20;

## 4. Calling Example

&#x20;

JAVA

![](file:///C:\Users\n5n0c\AppData\Local\Temp\ksohtml15740\wps4.png)

&#x20;
