10/13/2022 7:15 PM | |
Joined: 7/22/2022 Last visit: 2/23/2023 Posts: 23 Rating: (1) |
Hello, I am trying to test the WebAPI I am using Tiaportal V17 upd 4, with an S7-1500 (6ES7 511-1AK02-0AB0 V2.9), and trying a POST request with Postman (https://www.postman.com/) I am sending to "https://10.10.10.235/api/jsonrpc" this body: { "jsonrpc":"2.0", "id":0, method:"Api.Login", params: {user:"admin", password:"admin" } } But I get error 400 (BAD REQUEST) The S7-1500 webserver is working and I can login there as "admin" I don't know what is wrong |
Last edited by: AutoGen_5176452 at: 10/13/2022 19:18:03 |
|
10/13/2022 7:32 PM | |
Joined: 7/7/2010 Last visit: 9/6/2024 Posts: 15157 Rating: (2415) |
If you manually send the json using CURL, does it work, or only when using a different tool? Does the json webapi spec state POST or GET? I am assuming the PLC hardware configuration is allowing web requests and the PLC's security certificate is fully functional. In the interim, I would (for testing purposes only) configure the plc to allow http requests, and then get the json to work with curl. Once curl works, you can transition over to postman and https
|
science guy |
|
10/14/2022 3:51 PM | |
Joined: 7/7/2010 Last visit: 9/6/2024 Posts: 15157 Rating: (2415) |
Does this link help: https://support.industry.siemens.com/cs/document/68011496 or maybe this one which has example json for establishing & maintaining a connection and making api requests with json data: https://support.industry.siemens.com/cs/document/59193560
|
science guy |
|
10/14/2022 6:13 PM | |
Joined: 7/22/2022 Last visit: 2/23/2023 Posts: 23 Rating: (1) |
I had already read them, I learned the POST-api.login-command from one of those documents |
10/14/2022 7:22 PM | |
Joined: 7/19/2022 Last visit: 9/6/2024 Posts: 382 Rating: (62) |
Hi AutoGen_5176452, Take a look at this (unofficial Siemens) video that might help you: Siemens S7-1500 PLC JSON RPC Web API - Integrating Control Systems to Higher Level Systems with HTTP |
Last edited by: Jen_Moderator at: 10/17/2022 06:36:21Video embedded. If this Information really helps, you could use the Rate function |
|
This contribution was helpful to1 thankful Users |
10/17/2022 12:07 PM | |
Joined: 7/22/2022 Last visit: 2/23/2023 Posts: 23 Rating: (1) |
I had already seen it, if you see in the video comments there are people with the same problem (error 400) |
Follow us on