Skip to content

API List

Lee Seunghwa edited this page Jun 26, 2020 · 3 revisions

Table of Contents

  1. Authentication
    1. Login
    2. Logout
  2. Get Base Information
    1. Get Server Information
    2. Get User Information
  3. Analysis
    1. Analysis

Login

This is a login API that uses ID and password rather than UUID-based login.

Name: Login.php

Parameters:

Parameter Type Description
id string Account ID to access(login)
password string password

Example:

POST /#.php?id=banksemi&password=p123

Returns:

JSON 'success' code Scenario
0 ID or password is different
1 log-in succeed

Logout

Log out the currently connected session.

Name: Logout.php

Example:

GET /Logout.php

Returns:

JSON 'success' code Scenario
1 log-out succeed

Get Server Information

This API returns the server's domain, name, and short description.

Name: GetServerInfo.php

Example:

GET /GetServerInfo.php

Returns:

Property Type Description
server_info/site_name string Site name
server_info/footer_message string Description to enter at the bottom of the site
server_info/api_uri string Base address(url) for API requests

Get User Information

This API returns the ID and nickname for the logged in session.

Name: GetUserInfo.php

Example:

GET /GetUserInfo.php

Returns:

Property Type Description
id string Connected ID or UUID of the smartphone
name string Nickname or UUID of the smartphone

Analysis

This API receives data from the user. And it checks whether it is drinking and returns the result.

This process will follow the steps below.

  1. The client delivers the collected records through the HTTP stream in csv format.
  2. After receiving the information, the server is stored in /upload/Y-m-d H-i-s.csv.
  3. This API server uses the server information hard coded in the php code to connect to the Python server as a socket.
  4. The API server delivers a unique address to access the csv file uploaded to the Python server.
  5. Python server downloads csv file and analyzes data through HTTP based on the address
  6. The Python server returns the result to the PHP server via socket communication.
  7. The PHP server returns the information to the client and stores it in the database.

Name: Test.php

Example:

POST /Test.php

Parameters:

Parameter Type Description
application_name string Profile ID to save after analyzing the data
type string Data type (only health can be used)

Returns:

Property Type Description
result string Return current status (general, drinking, exercise)