REST API PUT- 405 Not Allowed

Hello,
I am trying to write value to variables through HMI REST API, but i am reciving this error:
image.pngI am able to read this variable as below:
image.pngWhat should I change in configuration to write values. Thanks in advance

Hello Kacper,
did you include the login handle in the request header?
And does the user thats logged in have variable write permissions?
Maybe you are logged in as „Viewer“ or something?
You might also want to keep sending session IDs with the request to keep the login session alive.
Authentication (plcnext.help)
best regards,
Oliver

Hello,
I tried writing variables with auth enabled like this:
image.pngand without it:
image.pngin both cases I can read variables but cannot write them.

I logged in as the default admin account, how can I check if this user has permissions to write variables?

Hello
Its possible to set permissions for different roles per page.
„Admin“ role should have all read and write permissions.
Security - User Authentication (plcnext.help)https://www.plcnext.help/te/About/#user_roles_and_

Are the variables linked to a EHMI Page (e.g. add the variable to a TextBox) or is the REST mode activated?

Rest interface is enabled:
image.pngI have also added variables to HMI using a checkbox like this:
image.pngShould I do something else?

Hello Kacper,
are you able to read Variables Via POST with that client?
What does the Header look like?

Hello,
Yes but only using HTTP not HTTPS
image.png

Here’s what worked for me:
- PLCnext Engineer 2024.0.3
- Create a new project for AXC F 2152 FW 2024.0
- Enable the REST interface:
image.png
- Add two variables to the Main program. The variables must be IN Ports in order to be writeable, and they must have the HMI attribute checked in order to make them available through the REST interface:
image.png
- Send the project to the PLCnext Control device.
- Get an authentication token:
image.png
- Get an access token using the default admin user:
image.png
- Read the values of the variables using a GET request. As Oliver mentioned before, the access token must be passed in the request header:
image.png
- Write the values of the variables using a PUT request. Not shown in this screen shot: The header also contains the access token, the same as in the GET request shown above.
image.png
- The value has been written to the PLCnext Engineer project:
image.png