Introduction

InBody WebAPI offers an API on LookinBody Web.
This article describes the REST API that can take advantage of the various features of LookinBody Web to HTTP request, it contains a detailed description of each function provided by the API.

We recommend you refer to the explanations and descriptions of the utilities provided here before applying.


The content below will provide you with a quick reference for REST API.


Developer Configuration

REST API can be used without any restrictions if under condition of requesting HTTP. Some examples are:

  • Utilize Javascript under Mobile/PC Web environment.
  • Various different environment such as C#, ASP.NET, JAVA, etc. can be applied and utilized.
  • iOS, Android, and etc can utilize under mobile environment.


InBody Web API Utility

Use your Lookin'Body Web account to log into the site and click [Submit] to receive the API-KEY.
Send the received API-KEY to HTTP Request Header

Account: [-LBWeb Account-]
API-KEY: [-Submit Key-]

Procedure for connection test is as follows.

URL:https://{webapiaddress}/user/test

Request
POST / HTTP/1.1
Host: [-- url --]
Account: [-- LBWeb Account --]
API-KEY: [-- Submit Key --]
Content-Type: application/json
ContentLength: [-- Length --]
Input URL in the Host and input LB Web account information into the Account. Also, input the API-KEY received from the menu, API-KEY Please include the API-KEY in the Header as well.
(If Key is not included in the Header, it will return 401 code.)

Response
Http/1.1     200 OK
Content-Type: application/json;charset=UTF-8
{
          "success"
}

Search Parameters and Scope (UserID vs UserToken)

The Web API allows access to the data from your InBody devices. To access the InBody data, the Web API uses two main search parameters: UserID(iD) and UserToken(phone).

UserID(iD): Local Parameter used to search through a specific location's data.
UserToken(Phone): Global Parameter used to search through ALL connected location's data.

This means that when searching data using UserID, you can only access data from the location that your account is linked to. If you wish to access data from another connected location, you must search using UserToken.


Example Code

Below is a snippet of code utilizing the InBody WebAPI

Example Code: Javascript w/ jQuery
				
				$.ajax({
     type: 'POST',
     url: 'https://apiusa.lookinbody.com/Function',
     contentType: 'application/json',
     data: JSON.stringify({ '[RequestDataKey]':'[RequestDatavalue]' }),
     headers: {
          'Account':'[AccountName]',
          'API-KEY':'[API-KEY]'
     },
     success: function (response) {
          $('#Element1').text(response[0].[ResponseDataKey1]);
          $('#Element2').text(response[0].[ResponseDataKey2]);
          $('#Element3').text(response[0].[ResponseDataKey3]);
          [...];      },
     error: function (error) {
          //Do something in case of error
     }
});