API Help

ShineMonitor PV monitoring Open platform API uses the HTTP protocol. Use standardized HTTP response code to represent request results. All API requests will be returned in a standardized and friendly JSON object format.

Unless otherwise specified, by default, APIs are called using the HTTP-GET method.

Call frequency:

API call method in GET format

1. Authentication interface call

Before calling any business API, authentication through the authentication interface is required. When calling the authentication interface, it is necessary to provide the usr(account), pwd(password), company-key(Manufacturer identification) assigned by the platform, and source(1-Energy storage,0-PV), app_id(IOS or Android provide BundleID and applicationId respectively, while web provides domain name), app_version(Application version number), app_client(ios ,android or web). A typical call is as follows:

test account (can be used for testing interfaces):

            usr: vplant

            pwd: vplant

    company-key: 0123456789ABCDEF(The company-key assigned by the platform needs to be used)

request: http://api.shinemonitor.com/public/?sign=675bd5418fce7be5e30b920a16a46ce075c90a35&salt=1491967716993&action=auth&usr=vplant&company-key=0123456789ABCDEF&source=0&_app_client_=android&_app_id_=com.demo.test&_app_version_=3.6.2.1

  • URI Prefix:

      Fixed as: http://api.shinemonitor.com/public/
    
  • URI Parameter:

  • sign

      The signature calculation method is: sign = SHA-1(salt + SHA-1(pwd) + "&action=auth&usr=" + usr + "&company-key=" + company-key);
      The results obtained through the SHA-1 digest algorithm are always presented as lowercase hexadecimal strings,as shown above: 675bd5418fce7be5e30b920a16a46ce075c90a35
    
  • salt

      Salt, participate in signature calculation, a readable string with a length of no less than 8 bytes.For example, using '12345678'.Can use current system time.For example,new Date().getTime() in JavaScript language, or System.currentTimeMillis() in the Java language, and so on.
    
  • action

      The API interface to be called.
    
  • usr

      Account assigned by the platform.
    
  • company-key

      Manufacturer identification assigned by the platform.
    
  • source

      Used to differentiate platforms. 1-Energy storage,0-PV
    
  • _app_id_

      Domain ID.
    
  • _app_version_

      Application version number.
    
  • _app_client_

      Platform identification.ios,android or web.
    

response:

{
    "err":0,
    "desc":"ERR_NONE",
    "dat":{
        "secret":"ffa1655ee3726840822063a02ac5017795809b18",
        "expire":604800,
        "token":"88d22d819e31897eea2d9d5b9f7792cf4065ac5372aad3672f5e4e147cd25b5f",
        "role":0
    }
}
This is a JSON object composed of the following parts:
  • err

      Error code, integer form.
    

    refer to Universal error code.

  • desc

      A brief description of the error code. 
    
      For example: "desc":"ERR_NONE",
      or: "desc":"ERR_FORMAT(can not found devcode)", The content in '()' is a more detailed description of the error, which is optional and can be used to prompt,for example, alert("can not found devcode.");
    

    refer to Universal error code.

  • dat.secret

      This is a secret with a validity period assigned by the system and used in subsequent business API interface calls.
    
  • dat.expire

      The expiration time of this certification, in seconds, from now on,After 'expire' seconds, The obtained secret and token (see below) are no longer valid.
    
  • dat.token

      This is a token with a validity period assigned by the system, which represents the identity of the authenticator and is used in subsequent business API interface calls
    
  • dat.role

      Current account type.
    

    refer to Account type.

2. API calls in other GET forms

Except for the authentication interface, the URI of any other GET form interface call is always similar to the following format:

request: http://api.shinemonitor.com/public/?sign=f0c57c88bdd73a1867355068e9e3c49d735ae668&salt=1491967717697&token=88d22d819e31897eea2d9d5b9f7792cf4065ac5372aad3672f5e4e147cd25b5f&action=queryCollectorInfo&pn=G0916522248153&source=0&_app_client_=android&_app_id_=com.demo.test&_app_version_=3.6.2.1

A URI is always composed of the following parts:

  • URI Predix:

      Fixed as: http://api.shinemonitor.com/public/
    
  • URI Paramter:

  • sign

      The signature calculation method is: sign = SHA-1(salt + secret + token + "&action=...");
      The salt(see below), along with the secret and token obtained through the authentication interface, plus the "&action" and all subsequent parameter parts, is calculated using the SHA-1 summary algorithm
    
  • salt

      Same as in the authentication interface salt.
    
  • token

      Token obtained through authentication interface.
    
  • action

          The API interface to be called.
    
  • parameter section

      The parameter section is optional, depending on whether the action (API) to be called needs to pass parameters.
    

It should be noted that the '&action' and its parameter parts are always located after the sign, slot, and token parameters


response: The response is similar to the authentication interface and returns a JSON object, consisting of the following parts:

  • err

      Error code, in integer form
    

    refer to Universal error code.

  • desc

      A brief description of the error code.
    

    refer to Universal error code.

  • dat

      The body part of the response is optional, depending on the API type being called. The following is a response without dat:
    
          {"err":0,"desc":"ERR_NONE"}
    

3. example

Java Language Example

Copyright © eybond 2022 all right reserved,powered by Gitbook文档更新时间: 2023-07-13 18:48:06

results matching ""

    No results matching ""