You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to control the anchor status via the REST API. Have searched the documentation and the web for guidance (at least some hours spent) but failed to figured it out so I hope you can provide some guidance.
I think my problems/questions are signalk generic and that I just happend to get stuck in relation to the "signalk-anchoralarm-plugin".
My plan was to use a device with a client id to provide access. I followed the documentation and created a device that I have granted read/write access.
How do I included the credentials in my POST?
I have tried to include "clientid" and "token" (shortened) like:
curl -k -X POST -H "Content-Type: application/json" -d '{{"clientId": "e5afb0c0-89e4-495f-9313-70d36ff9bdab", "token":"eyJhbGciOiJIUzI1NiIs.......XJqk50o"}' https://localhost:3443/plugins/anchoralarm/dropAnchor
but then I get <title>SyntaxError: Expected property name or '}' in JSON at position 1</title> (shortened) as respons
I also tried to use username/password login but got equally lost...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am trying to control the anchor status via the REST API. Have searched the documentation and the web for guidance (at least some hours spent) but failed to figured it out so I hope you can provide some guidance.
I think my problems/questions are signalk generic and that I just happend to get stuck in relation to the "signalk-anchoralarm-plugin".
I am running 2.14.0 on a RPI-5 on node v20.19.4
I installed signalk for secure https access:
{"endpoints":{"v1":{"version":"2.14.0","signalk-http":"https://localhost:3443/signalk/v1/api/","signalk-ws":"wss://localhost:3443/signalk/v1/stream","signalk-tcp":"tcp://localhost:8375"}},"server":{"id":"signalk-server-node","version":"2.14.0"}}
From the plugin document I read that I should use
curl -X POST -H "Content-Type: application/json" -d '{}' http://localhost:3000/plugins/anchoralarm/dropAnchor
to drop the anchor. If I simply translate to https and use the -k since I have not sorted out my certificates I get:
curl -k -X POST -H "Content-Type: application/json" -d '{}' https://localhost:3443/plugins/anchoralarm/dropAnchor
You do not have permission to view this resource, Please Login
My plan was to use a device with a client id to provide access. I followed the documentation and created a device that I have granted read/write access.
How do I included the credentials in my POST?
I have tried to include "clientid" and "token" (shortened) like:
curl -k -X POST -H "Content-Type: application/json" -d '{{"clientId": "e5afb0c0-89e4-495f-9313-70d36ff9bdab", "token":"eyJhbGciOiJIUzI1NiIs.......XJqk50o"}' https://localhost:3443/plugins/anchoralarm/dropAnchor
but then I get <title>SyntaxError: Expected property name or '}' in JSON at position 1</title> (shortened) as respons
I also tried to use username/password login but got equally lost...
Thanks!
/Björn
Beta Was this translation helpful? Give feedback.
All reactions