Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - nerdovic

#1
Hello Everyone,
this is my first post to this forum, and I hope I've picked the right area to do so.

I am a bit confused about the API docs of the SMART plugin (https://docs.opnsense.org/development/api/plugins/smart.html). The docs tell me that a POST request is required to query this part of the API, but there are no Parameters etc. specified that have to be POSTed.

I feel like the Docs are lacking some information how to properly query the SMART plugin API.
Thank you for your insights!

What I've tried:


I tried with GET at first, but this just brings up an error message:

{
  "message": "Unable to run info action"
}


When I do a POST, I don't even get json as return, just a HTTP 411 error:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>411 Length Required</title>
</head>
<body>
  <h1>411 Length Required</h1>
</body>
</html>


I am testing with curl like the example from the how-tos (https://docs.opnsense.org/development/how-tos/api.html#using-curl):
GET: curl -k -u "<api_user>":"<api_pass>" https://<opnsense>/api/smart/service/list
POST: curl -XPOST -k -u "<api_user>":"<api_pass>" https://<opnsense>/api/smart/service/list