# About the Web API

Web API is a framework used to build HTTP service that reach a broad range of clients, including browser and mobile devices.

### Base URL

Following is the Base URL:

<Protocol>://<Domain Name>:<Port Number>/api/v1

- Protocol: HTTP (Version 1.1)
- Domain Name: Uses IP address of the display unit.

  Note: If you are using display unit with SP5000 Series Open Box (Windows 10 IoT Enterprise Model) or IPC Series or PC/AT then you can use machine name also.

- Port Number: You can set the port number in the screen editing software. Configuring Web Server Settings

## Login

Enter the user name and password to get the token. When using Security, the token is used for authorization.

Note: Token-based authentication is a security technique that authenticates the users who attempt to log in to a server, a network, or some other secure system, using a security token provided by the server.

Overview

### Request

Item | Value
Method | POST
URL | <Base URL>/login
Parameters | N/A
Header | Content-Type, Content-Length
Header | Value
Content-Type | application/json
Body | JSON
Field | Data Type | Remarks
username | string | User name
password | string | Password
Example | POST http://192.168.1.100:8000/api/v1/login HTTP/1.1 Host: localhost:8082 Content-Type: application/json content-length: 44 { "username":"User1", "password":"Pass1" } Note: The example code is written in Java.

### Response

Item | Value
Status Code | Success to authenticate, display unit will send 200 (OK).
Code | Notes
200 OK | Success to authenticate
401 Unauthorized | Failed to authenticate
Header | Content-Type, Transfer-Encoding
Header | Value
Content-Type | application/json
Transfer-Encoding | Chunked
Body | JSON
Field | Data Type | Notes
token | string | Authenticated token
Example | HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked 8e { "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IlVzZXIxIiwibGV2ZWwiOjF9.eqVwAuo0KMqdggICllJVPs3IE67oHdUpo04w68md7kI" } 0 Note: The example code is written in Java.