Skip to content

Overview


  1. Benefit of JIMI Open API, distributor or application vendor could provide tracking service to customers by calling the API and use your own GUI client, App or Website, this might improve the localization or user experience.
  2. Your App or web client should connect to your application server, rather than connect to JIMI API Server directly , use your application server connect to JIMI Server instead.

Usage

  1. Contact us to apply your appKey and appSecrect, you need to provide your account.
  2. According to this document to implement your application server to obtain access_token.
  3. Calling other interfaces with access_token to fulfil your business logic.

Conventions

Encoding, format & Timezone

UTF-8 and JSON is used by default.
Context-Type: default application/json charset=utf-8
The API use UTC (GMT +0)time in default: format yyyy-MM-dd HH:mm:ss

Common response fields

KeyTypeRequiredDescripion
codeintYesresul code
messagestringNoDescripion

Result code description

CodeValueDescription
-1-1The system is busy
00success
1XXX1001Parameter error (lack of required parameters or format error). See interface description for details
1002Illegal user/illegal device (not their own or subordinate account or device)
1003Repeat operation
1004Illegal access, token exception! (Token failure or nonexistent)
1005Illegal access, IP access exceeds limit!
1006Illegal access, too frequently request!
1007Illegal access, request method error!
1008Illegal access, abnormal incoming!
12001platform account creation failed
12002device transfer failed
12003Geo-fence creation failed
12004Geo-fence deletion failed
12005Fail to send command

Error code:

CodeValueDescription
Create account213Account already exist
214Account does not exist
215User type error. Possible reasons: 1.User type is empty; 2. User type does not exist; 3. Current login user do not have permission to create new type of user.
Device transfer217Target user does not exist
218User can only transfer/sale devices to sub-account
219IMEI list is illegal
220Number of IMEI exceeds limitation.
Geo-fence41001Exceed max number of Geo-fences supported
41002Fence name is already exists
41003The device is not online
41004Geo-fence operation failed
Command225time out
226Parameter error
227The command is not executed correctly
228The device is not online
229Network error, connection error, etc.
238Device interrupted
240Data format error
243Not supported by device
252The device is busy
30010INCORRECT INSTRUCTION_PASSWORD

API Work Flow


API Features

Interface typeMethodDescription
Access Controljimi.oauth.token.getGet access token
jimi.oauth.token.refreshRefresh access token
Device Managementjimi.user.device.listList all devices of sub-account
jimi.track.device.detailGet device detail information
jimi.user.device.expiration.updateUpdate user expiration date
jimi.open.device.updateUpdate vehicle information by IMEI
jimi.open.device.moveMove devices
jimi.open.device.bindBind app user
jimi.open.device.unbindUnbind app user
jimi.device.group.createCreate device group
jimi.device.group.updateEdit device group
jimi.device.group.deleteDelete device group
jimi.device.group.listGet device group list of an account
Tracking Functionjimi.user.device.location.listGet location of devices by account
jimi.device.location.getGet the location of device(s)
jimi.device.location.URL.shareGet sharing location URL
jimi.device.track.mileageGet the mileage data of devices
jimi.device.track.listGet the track data of device
jimi.lbs.address.getWi-Fi, Base Station locating analysis
jimi.open.platform.report.parkingGet parking/idling data of devices
jimi.device.location.getTagMsgGet the location of TAG device
Media Functionjimi.device.live.page.urlGet Device Live Steaming Page URL
jimi.device.meida.cmd.sendSend media instruction
jimi.device.history.cmd.sendSend history video instruction
jimi.device.jimi.media.URLGet Device JIMI Photo or Video URL
jimi.open.video.rtmp.urlGet video rtmp url
Command Managementjimi.open.instruction.listGet command list supported by device
jimi.open.instruction.sendSend command to device
jimi.open.instruction.resultGet results of command execution
jimi.open.instruction.raw.sendSend raw command data to device
Geofencing Functionjimi.open.device.fence.createCreate Geo-fence for IMEI
jimi.open.device.fence.deleteDelete Geo-fence for device
jimi.open.platform.fence.createCreate platform Geo-fence
jimi.open.platform.fence.createEdit platform Geo-fence
jimi.open.platform.fence.deleteDelete platform Geo-fence
jimi.open.platform.fence.bindGeo-fence related device
jimi.open.platform.fence.listList platform geofences of an account
jimi.open.platform.fence.detailQuery single fence information
Push Functionjimi.push.device.alarmReceive Notification
jimi.open.instruction.raw.receivePush Received Raw Data
OBDjimi.device.obd.listGet the OBD data of devices
jimi.device.obd.faultGet the OBD fault data of devices
Reportsjimi.open.platform.fence.durationGet entry and exit fence data of devices
jimi.open.platform.report.tripsGet the trips report data of devices
jimi.device.alarm.listGet device alarm list
jimi.open.device.rfid.listGet RFID reporting information
Account Managementjimi.user.child.listList all sub-account
jimi.user.child.createCreate sub-account
jimi.user.child.delRemove sub-account
jimi.user.child.moveMove account
jimi.user.child.updateEdit user information

Request URL

The unique request URL is:
Please use the URL of the corresponding node according to the node to which your OPEN API account belongs

Security

  1. Client should get access_token first before calling the interface, which is generated by JIMI Server by calling jimi.oauth.token.get interface(method=jimi.oauth.token.get) with provided appKey and appSecrect.
  2. appKey and access_token are required to sign request parameters when calling API. JIMI server will validate the the request parameters by checking the sign value.

Common parameters

The parameters of each request should include common parameters and interface private parameters.
For example:
if you call the "jimi.oauth.token.get" interface, you need to provide : 7(common parameters) + 3(private parameters) = 10 (parameters, key/value)

Following are the common parameters:

NameTypeRequiredDescriptionRemarkDefault
methodstringYesAPI interface name
timestampstringYesTimestamp, format:yyyy - MM - dd HH:mm:ss. Plus or minus 10 minutes is allowed. e.g:2012-03-25 20:00:00GMT(UTC) time
app_keystringYesappKeyfrom JIMI
signstringYesA signature base on parameters, appKey, appSecrect.
sign_methodstringYesOptional, signature method. Available value: md5md5md5
vstringYesOptional, specify the API version. System default 1.0, support version: 0.9, 1.00.9: no signature checking
1.0: check signature
formatstringYesOptional, specify response format.json

Note:

The parameter V uses a difference of 0.9 and 1.0:

Using 0.9 will not perform Sign signature verification
Using 1.0 will verify the Sign signature

Function description of Sign signature verification:

The data receiving end gets the transmission text, but needs to confirm whether the text is the content sent by the sender, and whether it has been tampered with in the middle. Therefore, the receiver uses its own public key to decrypt the signature and obtains the digest of the text, then uses the same method as the sender to calculate the digest value of the text, and compares it with the decrypted digest, and finds that the two are exactly the same. It means that the text has not been tampered with.

Signature

To protect API calling from hacked, any API calling needs to be with a signature. JIMI server will check signature based on request parameters. Illegal signature request will be rejected. Signature algorithms supported is: md5 (sign_method is a common parameter mentioned above).

Following is the algorithm of signature:

  1. Sort all request parameters with parameter key in alphabetical order (including common parameters and method specific parameters, but NOT include sign and byte type parameter. For example:

foo=1, bar=2, foo_bar=3, foobar=4
Result: bar=2, foo=1, foo_bar=3, foobar=4

  1. Remove all equal sign and comma:

bar2foo1foo_bar3foobar4

  1. Then concatenate appSecrect to the before and end of the result string and get the md5 value. E.g:

md5(appSecrect+bar2foo1foo_bar3foobar4+appSecrect), the real string should like: md5(h9lri085eachcz4sn7gwnkh6j0jt0yz4bar2foo1foo_bar3foobar4h9lri085eachcz4sn7gwnkh6j0jt0yz4)

⚠️ Note that the string should be in UTF-8 encoding.
⚠️ Note that the sign should be upper case string.

  1. If the parameter value is a byte stream, it should be converted to hexadecimal. For example:

hex("helloworld".getBytes("utf-8")) = "68656C6C6F776F726C64"

MD5 is the 128-bit summary algorithm and is in hexadecimal. a hexadecimal character can represent four bits, so the signature string length is 32 hexadecimal characters.

bash
    public static String signTopRequest(Map<String, String> params, String seccode, String signMethod) throws IOException { 
    // 1:sort parameter key 
    String[] keys = params.keySet().toArray(new String[0]); 
    Arrays.sort(keys); 
    // 2:: Put all parameter names and parameter values together 
    StringBuilder query = new StringBuilder(); 
    if (Constants.SIGN_METHOD_MD5.equals(signMethod)) { 
    query.append(seccode); 
    } 
    for (String key : keys) { 
    String value = params.get(key); 
    if (StringUtils.areNotEmpty(key, value)) { 
    query.append(key).append(value); 
    } 
    } 
    
        // 3: use MD5/HMAC to encrypt 
        byte[] bytes; 
        if (Constants.SIGN_METHOD_HMAC.equals(signMethod)) { 
            bytes = encryptHMAC(query.toString(), seccode); 
        } else { 
            query.append(seccode); 
            bytes = encryptMD5(query.toString()); 
        } 
    
        // 4: convert binary to uppercase hexadecimal 
        return byte2hex(bytes); 
    } 
    
    public static byte[] encryptHMAC(String data, String seccode) throws IOException { 
        byte[] bytes = null; 
        try { 
            seccodeKey seccodeKey = new seccodeKeySpec(seccode.getBytes(Constants.CHARSET_UTF8), "HmacMD5"); 
            Mac mac = Mac.getInstance(seccodeKey.getAlgorithm()); 
            mac.init(seccodeKey); 
            bytes = mac.doFinal(data.getBytes(Constants.CHARSET_UTF8)); 
        } catch (GeneralSecurityException gse) { 
            throw new IOException(gse.toString()); 
        } 
        return bytes; 
    } 
    
    public static byte[] encryptMD5(String data) throws IOException { 
        return encryptMD5(data.getBytes(Constants.CHARSET_UTF8)); 
    } 
    
    public static String byte2hex(byte[] bytes) { 
        StringBuilder sign = new StringBuilder(); 
        for (int i = 0; i < bytes.length; i++) { 
            String hex = Integer.toHexString(bytes[i] & 0xFF); 
            if (hex.length() == 1) { 
                sign.append("0"); 
            } 
            sign.append(hex.toUpperCase()); 
        } 
        return sign.toString(); 
    }
Download

Last updated: