Developer Center

1. Overview

Application development is mainly through the native Rsetful API or SDK and other ways to achieve data docking, data analysis, remote monitoring, etc. with the cloud platform, combined with their own needs, to achieve the development of related product applications, to achieve application development, there are several three ways:
Method 1: "Cloud Platform Application Designer", the tool provides functions such as online drag control, one-click publishing, and provides curve charts, bar charts, spider web diagrams, locations, switches, watch faces, controls, etc., to quickly realize the development and browsing of WebAPP, and support compatible with PCs or mobile devices;
Method 2: The developer only needs to call the SDK provided by the cloud platform in the application being developed to quickly develop the APP.
Method 3: Use the RESTful API interface provided by the platform to code for APP development;
Regardless of the above methods, the first step in application development is to first have an APIKEY, each user has only one and has an expiration time limit, and its role is the unique credential when designing and browsing the application. On the Developer Center > Personal Center > ApiKey Management page, click the "Generate" button on the page, select a time limit, and then "Submit" to create an apikey
After that, we will continue to explain the process of developing an application in each of the three ways.

2. Method 1: Use the Cloud Platform Application Designer to implement application development

2.1. Add app

Go to the application management page and click "Add Application" to jump to the new application interface, as follows:

After filling in the form, click "OK" and the addition is successful.

2.2. Design Application

The application module selection is not "self-designed", directly click the publish icon, and you can browse it after publishing; Select "Design Yourself" and click on the "Design" link to the right of each app list to connect to the "App Designer" tool page. After the design is completed, you can click the "Save" button in the upper right corner to save the layout of the design area, and if you want to publish it immediately, you can check the "Publish the project at the same time" checkbox on the right.

2.3. Publish/Browse App

For apps that have not yet been published in the app designer, you can also click the "Publish" button on the app list page to generate an app file and store it on the server for online browsing

3. Method 2: Call the SDK for application development

The SDK encapsulates the communication process between the mobile phone and the cloud, including requests, entity encapsulation, and result returns. Using the SDK, you can directly call each method, and developers only need to pay attention to the UI and UE design of the APP, while relatively complex protocols and error handling can be ignored.

3.1. Download SDK file

The SDK for application development currently mainly includes SDK packages in Javascript, PHP, Android, C#, Java and other languages, according to the language you use, move to API SDK page to download the SDK file of the corresponding language, and we will continue to roll out SDKs in other languages.

3.2. Reference or copy SDK files into your program

It is recommended to copy the downloaded SDK package to a folder in your application, because the way to use the SDK in various languages is different, everyone uses the SDK according to the language characteristics.
Javascript can be used by introducing <script src="nlecloud-sdk.min.js"></script>
to the HTML page PHP can be used by referencing require 'nlecloudsdk.php'
in PHP code C# can be used by referencing the SDK dll file
in your project

3.3. Call SDK method

For the entity objects requested or returned by each method, please refer to request parameters or response parameters for each interface the RESTful API page. For details of the SDK methods, see the definitions in the SDK file.
The Javascript reference is as follows: The C# reference is as follows:

3.4. Debug/Release App

Call the SDK method to complete the business function according to the requirements, design the UI/UE and other work, and finally compile the debugging program to complete the application development. The completed application cannot be deployed on the cloud platform temporarily, and the user can deploy it by himself.

4. Method 3: Request a RESTful API for app development

Application development can also be achieved without using SDKs and directly using native RESTful APIs, which can better understand and learn the entire communication process of HTTP requests. The interface is based on JSON format (what is JSON), and you can use any standard HTTP client to debug or access API interfaces, such as:

4.1. Obtain AccessToken

"AccessToken" is a string of strings generated by multiple encryption of information such as APIKEY, which is the header parameter when requesting all APIs (except http://api.nlecloud.com/users/login). The AccessToken has an expiration date, which is the expiration time selected when applying for the APIKEY, and the application cannot be browsed or viewed after it expires.
The only way to obtain an AccessToken is to request the "http://api.nlecloud.com/users/login" interface, and the return response will have an AccessToken field:

{
    "ResultObj":
    {
        "UserID": 1,
        "UserName": "sample string 2",
        "Email": "sample string 3",
        "Telphone": "sample string 4",
        "Gender": true,
        "CollegeID": 6,
        "CollegeName": "sample string 7",
        "RoleName": "sample string 8",
        "RoleID": 9,
        "AccessToken": "sample string 10",
        "ReturnUrl": "sample string 11",
        "DataToken": "sample string 12"
      },
      "ErrorObj": {},
      "Status": 0,
      "StatusCode": 2,
      "Msg": "sample string 3"
 }
            

The reference value of this AccessToken looks like this:
CBE131838F574CC69C5C19033CAAB3CD7CAD57045DF07336C061742D700A52FAD1CA2A740777211EB357D33A4B9E0D3F96BE9D9EB8F96485FE5BE72A6E5E0717AD158B535428BBB6CC506679DDB7C20B6B7E659807C96E2DF26D2AE8D4B9CF76CF9E3FE49EF0C5AC151A46123B07968F18678222C97D2B6A79E4E46C5FBFAA3ED13428A0FFDC2E4FB2D88F9526FFCBC4C6A10299A5A199D97C5A9246C34A6220AB8B48F1CE1F5CAB57905B6A4054D1A588A196D303D4B80B89D4FE2FFB032DA7FAA934305DCD2B30C884031AC870E967768173C0233D3DEAAE058B7B4E287F27A4078CF22A5F4B94A2203514E9A6644A
The order in which cloud platform APIs are called is as follows:

  1. Check whether there is an AccessToken locally and whether the AccessToken has expired
  2. If the AccessToken does not exist or the AccessToken expires, call the user login operation to obtain and save the AccessToken
  3. Use AccessToken to call other APIs

4.2. Request API Interface

For the JSON objects requested or returned by each interface, please refer to the RESTful API page for the request or response example of each interface.
the interfaces of the cloud platform

4.3. Debug/Release App

Call the interface according to the requirements to complete the business function, design the UI/UE and other work, and finally compile the debugging program to complete the application development. The completed application cannot be deployed on the cloud platform temporarily, and the user can deploy it by himself.