JVC VN-E4U API Guide - Page 16
Using API that Requires Basic Authentication, 4.1. Procedure
![]() |
UPC - 046838021015
View all JVC VN-E4U manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 16 highlights
4. Using API that Requires Basic Authentication 4. Using API that Requires Basic Authentication _ 4.1. Procedure Basic authentication is required for APIs which are explained in Section 5. This section provides basic explanation of the uses of APIs that require basic authentication. 4.1. Procedure 1) The client establishes a TCP connection to port number 80. 2) The client sends out API via TCP. Character strings of the following structure will be sent out. GET Space Accept Space Host: Space Authorization: Basic API Character String Space HTTP/1.1 0x0D 0x0A text/plain or text/html 0x0D 0x0A IP Address of VN-E4 0x0D 0x0A Space User Name and Password 0x0D 0x0A 0x0D 0x0A Example The following is an example of API for acquiring the subnet mask of VN-E4. GET /api/param?network.interface.subnetmask HTTP/1.1 Accept: text/palin Host: 10.0.0.1 Authorization: Basic YWRtaW46dm4tZTQ= Specify the response format by Accept line. A plain text response is returned when this is specified as text/ plain. An HTML response will be returned when text/html is specified. An HTML response will be returned when Accept is not specified. Restrictions are imposed on clients via basic authentication in the case of API for acquiring/setting parameters of VN-E4. During basic authentication, user name and password shall be provided in the Authorization line. There are 3 types of user names, namely admin, operator and user. The type of user for which use is allowed is predetermined for each API. Join the user name and the password using a colon, Base64 encode this character string and enter this in the Authorization line. For example, when User name: admin Password: vn-e4 then the character string upon joining the user name and the password with a colon will be admin:vn-e4. Base64 encoding this string yields YWRtaW46dm4tZTQ=. Enter this in the Authorization line. Default passwords in the factory settings are as follows: User Name Default Password admin vn-e4 operator vn-e4 user vn-e4 3) VN-E4 returns a response to the client. In the following example, current subnet mask is 255.0.0.0. In addition, 255.0.0.0 is followed by & and 200 OK, indicating that acquisition is successful. Example HTTP/1.1 200 OK Connection: Keep-Alive Content-Length: 80 content-type: text/plain date: Fri, 13 MAY 2005 07:33:12 GMT server: VN-E4 API Server/1.0.0 keep-alive: timeout=5, max=5 network.interface.subnetmask=255.0.0.0&200 OK Note also that each of the content-type, date, server and keep-alive lines begin with a lower-case character. 4) The client can disconnect TCP80 to end the use of API. 16
![](/manual_guide/products/jvc-vne4u-api-guide-62db8e7/16.png)