Location:

Geofence Alarm

Query Fence Status

Service Introduction

Through this request, you can query whether the monitoring terminal is inside or outside the fence.

Interface address

https://lbs.navinfo.com/open-api/geofence/v1/fence/query_status

Request method

GET/POST
The post request parameters should be transmitted in x-www-form-urlencoded mode

Request parameters

Please refer to the following table for the description of query monitoring terminal inside or outside the fence:

Parameter Type Meaning Required Default Remarks

ak

string

Developer Key

Yes

Your ak

Click to apply

service_id

int

The service ID returned when creating the service

Yes

monitored_terminal

string

Monitoring terminal

Yes

fence_ids

string

ID list of fence entities. Multiple fence IDs are separated by ",".

No

If it is filled in, it will return to the fence status according to the specified ID, and page_ Index and page_ It is not effective; If it is not filled in, query the status of all fences on the monitoring object; fence_ You can fill in up to 1000 IDS in IDS.

page_index

int

Returns the number of page numbers.

No

1

value range :[1,5000]。

page_size

int

Number of records per page.

No

1000

value range:[1,1000]。

Response data

Return Value Type Meaning Remarks

code

int

Return status

message

string

return status Description

data

object

return results

total

int

Total number of query monitoring terminals

size

int

Number of terminal returned on this page

monitored_statuses

array

Fence status list

fence_id

int

fence id

monitored_status

string

status

unknown:unknown status
in:in fence
out:out fence

Service example

Parameter Value Type Meaning Required Remarks

ak

Your ak

string

Developer Key

Yes

Click to apply

service_id

int

The service ID returned when creating the service

Yes

monitored_terminal

string

Monitoring terminal

Yes

fence_ids

string

ID list of fence entities. Multiple fence IDs are separated by ",".

No

If it is filled in, it will return to the fence status according to the specified ID, and page_ Index and page_ It is not effective; If it is not filled in, query the status of all fences on the monitoring object; fence_ You can fill in up to 1000 IDS in IDS.

page_index

int

Returns the number of page numbers.

No

value range :[1,5000]。

page_size

int

Number of records per page.

No

value range:[1,1000]。

Run


                        

Query Location Status

Service Introduction

Through this request, you can query whether the coordinates are inside or outside the fence.

Interface address

https://lbs.navinfo.com/open-api/geofence/v1/fence/query_location_status

Request method

GET/POST
The post request parameters should be transmitted in x-www-form-urlencoded mode

Request parameters

Please refer to the following table for the description of query coordinates inside or outside the fence:

Parameter Type Meaning Required Default Remarks

ak

string

Developer Key

Yes

Your ak

Click to apply

service_id

int

The service ID returned when creating the service

Yes

monitored_terminal

string

Monitoring terminal

Yes

fence_ids

string

ID list of fence entities. Multiple fence IDs are separated by ",".

No

If it is filled in, it will return to the fence status according to the specified ID, and page_ Index and page_ It is not effective; If it is not filled in, query the status of all fences on the monitoring object; fence_ You can fill in up to 1000 IDS in IDS.

longitude

double

longitude

Yes

latitude

double

latitude

Yes

coord_type

string

Coordinate system

No

gcj02

page_index

int

Returns the number of page numbers.

No

1

value range :[1,5000]。

page_size

int

Number of records per page.

No

1000

value range:[1,1000]。

Response data

Return Value Type Meaning Remarks

code

int

Return status

message

string

return status Description

data

object

return results

total

int

Total number of query monitoring terminals

size

int

Number of terminal returned on this page

monitored_statuses

array

Fence status list

fence_id

int

fence id

monitored_status

string

status

unknown:unknown status
in:in fence
out:out fence

Service example

Parameter Value Type Meaning Required Remarks

ak

Your ak

string

Developer Key

Yes

Click to apply

service_id

int

The service ID returned when creating the service

Yes

monitored_terminal

string

Monitoring terminal

Yes

fence_ids

string

ID list of fence entities. Multiple fence IDs are separated by ",".

No

If it is filled in, it will return to the fence status according to the specified ID, and page_ Index and page_ It is not effective; If it is not filled in, query the status of all fences on the monitoring object; fence_ You can fill in up to 1000 IDS in IDS.

longitude

double

longitude

Yes

latitude

double

latitude

Yes

coord_type

string

Coordinate system

Yes

page_index

int

Returns the number of page numbers.

No

value range :[1,5000]。

page_size

int

Number of records per page.

No

value range:[1,1000]。

Run


                        

Terminal History Alarm

Service Introduction

You can query the historical alarm of a monitoring terminal through this request.

Interface address

https://lbs.navinfo.com/open-api/geofence/v1/fence/terminal_history_alarm

Request method

GET/POST
The post request parameters should be transmitted in x-www-form-urlencoded mode

Request parameters

Please refer to the following table for the description of querying the historical alarm of a monitoring terminal:

Parameter Type Meaning Required Default Remarks

ak

string

Developer Key

Yes

Your ak

Click to apply

service_id

int

The service ID returned when creating the service

Yes

monitored_terminal

string

Monitoring terminal

Yes

fence_ids

string

ID list of fence entities. Multiple fence IDs are separated by ",".

No

If it is filled in, it will return to the fence status according to the specified ID, and page_ Index and page_ It is not effective; If it is not filled in, query the status of all fences on the monitoring object; fence_ You can fill in up to 1000 IDS in IDS.

start_time

UNIX timestamp

start time

No

Note:
1) The start time and end time should be input in coordination;
2) The end time shall be greater than the start time, and the difference shall be less than or equal to 7 days;
3) If the start time and end time are both empty, all alarm information within 7 days will be returned.eg:162062641

end_time

UNIX timestamp

end timestamp

No

eg:162062641

coord_type

string

Coordinate system

No

gcj02

page_index

int

Returns the number of page numbers.

No

1

value range :[1,5000]。

page_size

int

Number of records per page.

No

1000

value range:[1,1000]。

Response data

Return Value Type Meaning Remarks

code

int

Return status

message

string

return status Description

data

object

return results

total

int

Total number of query monitoring terminals

size

int

Number of terminal returned on this page

alarms

array

Alarm result

fence_id

int

Fence ID that triggered the alarm

fence_name

string

Fence name

monitord_terminal

string

Monitoring object

action

string

Trigger action

Possible return values:
enter: Enter the fence
exit: Leave the fence

alarm_point

object

Trigger fence alarm track point

longitude

double

longitude

latitude

double

latitude

radius

string

positioning accuracy

Unit: meter

coord_type

string

Coordinate type returned

loc_time

UNIX timestamp

Actual trigger time of fence, i.e. track point positioning time

create_time

UNIX timestamp

Time when the server receives the alarm information

Because the LBS API fence is the server fence, that is, the fence trigger judgment can be made only when the track point is uploaded to the LBS server. Therefore, the time when the server receives the alarm may be later than the actual trigger time LOC of the fence due to the timeliness of track point upload_ time。 For example, the actual time when the track point triggers the fence is 13:00, but if for various reasons, the time when the track point is uploaded to the server for fence calculation is 14:00, the alarm is created_ Time is 14:00.

pre_point

object

The last track point that triggers the fence alarm track point

longitude

double

longitude

latitude

double

Track point latitude

radius

int

positioning accuracy

Unit: meter

coord_type

string

Coordinate type returned

loc_time

UNIX timestamp

Actual trigger time of fence, i.e. track point positioning time

create_time

UNIX timestamp

Time when the server receives the alarm information

Service example

Parameter Value Type Meaning Required Remarks

ak

Your ak

string

Developer Key

Yes

Click to apply

service_id

int

The service ID returned when creating the service

Yes

monitored_terminal

string

Monitoring terminal

Yes

fence_ids

string

ID list of fence entities. Multiple fence IDs are separated by ",".

Yes

If it is filled in, it will return to the fence status according to the specified ID, and page_ Index and page_ It is not effective; If it is not filled in, query the status of all fences on the monitoring object; fence_ You can fill in up to 1000 IDS in IDS.

start_time

UNIX timestamp

start time

No

Note:
1) The start time and end time should be input in coordination;
2) The end time shall be greater than the start time, and the difference shall be less than or equal to 7 days;
3) If the start time and end time are both empty, all alarm information within 7 days will be returned.eg:162062641

end_time

UNIX timestamp

end timestamp

No

eg:162062641

coord_type_output

string

Coordinate system

No

page_index

int

Returns the number of page numbers.

No

value range :[1,5000]。

page_size

int

Number of records per page.

No

value range:[1,1000]。

Run


                        

Service History Alarm

Service Introduction

Through this request, you can query all alarm information within a time period under a service.

Interface address

https://lbs.navinfo.com/open-api/geofence/v1/fence/service_history_alarm

Request method

GET/POST
The post request parameters should be transmitted in x-www-form-urlencoded mode

Request parameters

Please refer to the following table for the description of querying all alarm information within a service time period:

Parameter Type Meaning Required Default Remarks

ak

string

Developer Key

Yes

Your ak

Click to apply

service_id

int

The service ID returned when creating the service

Yes

start_time

UNIX timestamp

start time

Yes

The query time is the time when the server receives the alarm, that is, the create time of the alarm information_ time。 For example, the actual time when the track point triggers the fence is 13:00, but if for various reasons, the time when the track point is uploaded to the server for fence calculation is 14:00, the alarm is created_ Time is 14:00.eg:162062641

end_time

UNIX timestamp

end timestamp

Yes

The end time must be greater than the start time, but not more than 1 hour. That is, each request can only synchronize alarm information of 1 hour at most.eg:162062641

coord_type_output

string

Returns the coordinate type

No

gcj02

page_index

int

Returns the number of page numbers.

No

1

value range :[1,5000]。

page_size

int

Number of records per page.

No

1000

value range:[1,1000]。

Response data

Return Value Type Meaning Remarks

code

int

Return status

message

string

return status Description

data

object

return results

total

int

Total number of query monitoring terminals

size

int

Number of terminal returned on this page

alarms

array

Alarm result

fence_id

int

Fence ID that triggered the alarm

fence_name

string

Fence name

monitord_terminal

string

Monitoring object

action

string

Trigger action

Possible return values:
enter: Enter the fence
exit: Leave the fence

alarm_point

object

Trigger fence alarm track point

longitude

double

longitude

latitude

double

Track point latitude

radius

string

positioning accuracy

Unit: meter

coord_type

string

Coordinate type

loc_time

UNIX timestamp

Actual trigger time of fence, i.e. track point positioning time

create_time

UNIX timestamp

Time when the server receives the alarm information

Because the LBS API fence is the server fence, that is, the fence trigger judgment can be made only when the track point is uploaded to the LBS server. Therefore, the time when the server receives the alarm may be later than the actual trigger time LOC of the fence due to the timeliness of track point upload_ time。 For example, the actual time when the track point triggers the fence is 13:00, but if for various reasons, the time when the track point is uploaded to the server for fence calculation is 14:00, the alarm is created_ Time is 14:00

pre_point

object

The last track point that triggers the fence alarm track point

longitude

double

longitude

latitude

double

Track point latitude

radius

int

positioning accuracy

Unit: meter

coord_type

string

Coordinate type returned

loc_time

UNIX timestamp

Actual trigger time of fence, i.e. track point positioning time

create_time

UNIX timestamp

Time when the server receives the alarm information

Service example

Parameter Value Type Meaning Required Remarks

ak

Your ak

string

Developer Key

Yes

Click to apply

service_id

int

The service ID returned when creating the service

Yes

start_time

UNIX timestamp

start time

Yes

The query time is the time when the server receives the alarm, that is, the create time of the alarm information_ time。 For example, the actual time when the track point triggers the fence is 13:00, but if for various reasons, the time when the track point is uploaded to the server for fence calculation is 14:00, the alarm is created_ Time is 14:00.eg:162062641

end_time

UNIX timestamp

end time

Yes

The end time must be greater than the start time, but not more than 1 hour. That is, each request can only synchronize alarm information of 1 hour at most.eg:162062641

coord_type_output

string

Returns the coordinate type

No

page_index

int

Returns the number of page numbers.

No

value range :[1,5000]。

page_size

int

Number of records per page.

No

value range:[1,1000]。

Run


                        
TOP