1. Interface interaction mode
appoint
- At present, the platform uses short connection (HTTP)+ long connection (websocket) to provide external services, in which some data structure returns using protobuf(can reduce bandwidth consumption and serialization performance to a certain extent), but in order to simplify the external, the default return in the form of json, do not provide protubuf for the moment
- If the field is the default value, the field does not appear in the response field. You need to handle this by yourself. Currently, the default values of the following field types do not need to be serialized :(integer:0; string:"",bool:false)
- The unique identification related to vehicle equipment in the system, most interfaces basically have equipment number, Plat No., vehicle ID, these several information, it is recommended to use the Plat No. as the unique identification
A unified data structure returned by http(Status code definition)
{
"hdr":{
"code":200, //Check the status code definition for details
"message":"success"
},"data":{
//he data content corresponds to the response Data content in the interface based on different interfaces
}
}
{
"hdr":{
"code":200, //Check the status code definition for details
"message":"success"
},"data":{
//he data content corresponds to the response Data content in the interface based on different interfaces
}
}
2. User login process
During user login, you are advised to invoke interfaces based on the following sequence to get basic data and then connect to the message push service to ensure data consistency
Get token
Using the account password, the token is returned after a correct response for subsequent interface calls---(Details)
Get the user group information
Get the basic packet information for building the packet tree. If you do not need the packet information, do not call this interface --- (Details)
Get the basic vehicle information
Gets user bound basic vehicle information --- (Details)
Get the websocket service address
Get the address of the push service, connect to and log in to the push server, and messages such as online and offline, positioning data, alarm data, and basic data change will be pushed to the client in real time--- (Details)
Complete login
Other business interfaces can be invoked as needed