Api.getcertificateurl; Api.logout; Web Api Integration - Siemens SIMATIC S7-1500 Function Manual

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

Advertisement

Web pages
3.20 API (Application Programming Interface)
3.20.2.6

Api.GetCertificateUrl

The Api.GetCertificateUrl method returns a relative URL (https://<IP> with which you can
retrieve the SSL certificate of the web server.
Example
The following example shows the result of the Api.GetCertificateUrl method call.
"/MiniWebCA_Cer.crt"
The method outputs a string with a relative URL to the CPU.
If no certificate is available, the method outputs an empty string.
3.20.2.7

Api.Logout

The Api.Logout method removes the token from the list of active Web API sessions and
ends the session.
3.20.3

Web API integration

In the following section you will find examples of how to integrate the Web-API into your
application.
Structure of an HTTP Request and HTTP Response
The following section shows the example of the required structure of an HTTP Request and
HTTP Response for successfully making a Web API request.
POST /api/jsonrpc HTTP/1.1
Host: 192.168.3.14
Content type: application/json
Content length: 92
[{"jsonrpc":"2.0","method":"Api.Login","params":{"user":"User1","pas
sword":"SecurePassword"},"id":999}]
HTTP/1.1 200 OK
Content type: application/json
Cache-Control: no-cache
Pragma: no-cache
Expires: 0
Access-Control-Allow Origin: *
Access-Control-Allow Headers: Content-Type,X-Auth Token
Access-Control-Allow Methods: POST,OPTIONS
transfer-encoding: chunked
date: Tue, 23 Apr 2019 17:50:31 GMT
[{"jsonrpc":"2.0","id":999,"result":{"token":"Sy8pe3VNv86rTMldzFBsYz
mw12Lg"}}]
166
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