Siemens SIMATIC S7-1500 Function Manual page 169

Web server
Hide thumbs Also See for SIMATIC S7-1500:
Table of Contents

Advertisement

Web pages
3.20 API (Application Programming Interface)
Example 2
Example 2 shows a client that wants to log on to the CPU with JavaScript and calls several
methods using a bulk request.
$.post({
url:"https://192.168.2.132/api/jsonrpc",
data:JSON.stringify([
success: function(data){ console.log(data); },
dataType: "text",
contentType: "application/json"});
The following section shows an example of a bulk request response. The selected user has
the necessary authorizations. The methods after the login request were successfully carried
out with the authorizations of the authenticated user.
[
{jsonrpc:"2.0",id:1, result:{
{jsonrpc:"2.0",id:2,result:[
{jsonrpc:"2.0",id:3,result:[
]
168
{jsonrpc:"2.0", id:1, method:"Api.Login",
params:{user:"Admin",password:"12345"} },
{jsonrpc:"2.0", id:2, method:"Api.GetPermissions" },
{jsonrpc:"2.0", id:3, method:"Api.GetMethods" }]),
token:"d29kamV3cGxtdm5keHNhcXd1aXJ0empkZXN3cQ=="}},
"read_value",
"write_value",
"diagnostics"]},
"Api.Login",
"Api.GetPermissions",
"Api.GetMethods",
"PlcProgram.Read",
"PlcProgram.Write",
"PlcProgram.Browse",
"Api.Logout",
"Api.Ping"]},
Function Manual, 11/2019, A5E03484625-AG
Web server

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic et 200proSimatic et 200sp

Table of Contents