Skip to content

Commit 675d740

Browse files
Fixed missing brackets in readme
1 parent 331a169 commit 675d740

2 files changed

Lines changed: 12 additions & 14 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ authentication.
4848
To authenticate your API call, follow the instructions for your configured authentication mode:
4949

5050
<details>
51-
<summary>Local Database (default)</summary
51+
<summary>Local Database (default)</summary>
5252
Uses the same credentials as the pfSense webConfigurator. To authenticate API calls, simply add a `client-id` value containing your username and a `client-token` value containing your password to your payload. For example `{"client-id": "admin", "client-token": "pfsense"}`
5353
</details>
5454

5555
<details>
56-
<summary>JWT</summary
56+
<summary>JWT</summary>
5757
Requires a bearer token to be included in the `Authorization` header of your request. To receive a bearer token, you may make a POST request to /api/v1/access_token/ and include a `client-id` value containing your pfSense username and a `client-token` value containing your pfSense password to your payload. For example `{"client-id": "admin", "client-token": "pfsense"}`. Once you have your bearer token, you can authenticate your APIcall by adding it to the request's authorization header. (e.g. `Authorization: Bearer xxxxxxxx.xxxxxxxxx.xxxxxxxx`)
5858
</details>
5959

6060
<details>
61-
<summary>API Token</summary
61+
<summary>API Token</summary>
6262
Uses standalone tokens generated via the UI. These are better suited to distribute to systems as they are revocable and will only allow API authentication and not UI or SSH authentication (like the local database credentials). To generate or revoke credentials, navigate to System > API within the UI and ensure the Authentication Mode is set to API token. Then you should have the options to configure API Token generation, generate new tokens, and revoke existing tokens. Once you have your API token, you may authenticate your API call by adding a `client-id` value containing yourAPI token client ID and a `client-token` value containing your API token client token to your payload. (e.g. `{"client-id": "cccdj-311s", "client-token": "42jkjl-k234jlk1b38123kj3kjl-ffwzzuilaei"}`
6363
</details>
6464

@@ -4170,4 +4170,4 @@ URL: https://{{$hostname}}/api/v1/user/privilege
41704170

41714171
---
41724172
[Back to top](#pfsense-rest-api-documentation)
4173-
> Made with &#9829; by [thedevsaddam](https://github.com/thedevsaddam) | Generated at: 2020-09-27 10:50:11 by [docgen](https://github.com/thedevsaddam/docgen)
4173+
> Made with &#9829; by [thedevsaddam](https://github.com/thedevsaddam) | Generated at: 2020-09-27 10:51:43 by [docgen](https://github.com/thedevsaddam/docgen)

pfSense-pkg-API/files/usr/local/www/api/documentation/index.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@
4040
authentication.
4141
To authenticate your API call, follow the instructions for your configured authentication mode:
4242
<details>
43-
<summary>Local Database (default)</summary
43+
<summary>Local Database (default)</summary>
4444
Uses the same credentials as the pfSense webConfigurator. To authenticate API calls, simply add a `client-id` value containing your username and a `client-token` value containing your password to your payload. For example `{"client-id": "admin", "client-token": "pfsense"}`
4545
</details>
4646
<details>
47-
<summary>JWT</summary
47+
<summary>JWT</summary>
4848
Requires a bearer token to be included in the `Authorization` header of your request. To receive a bearer token, you may make a POST request to /api/v1/access_token/ and include a `client-id` value containing your pfSense username and a `client-token` value containing your pfSense password to your payload. For example `{"client-id": "admin", "client-token": "pfsense"}`. Once you have your bearer token, you can authenticate your APIcall by adding it to the request's authorization header. (e.g. `Authorization: Bearer xxxxxxxx.xxxxxxxxx.xxxxxxxx`)
4949
</details>
5050
<details>
51-
<summary>API Token</summary
51+
<summary>API Token</summary>
5252
Uses standalone tokens generated via the UI. These are better suited to distribute to systems as they are revocable and will only allow API authentication and not UI or SSH authentication (like the local database credentials). To generate or revoke credentials, navigate to System > API within the UI and ensure the Authentication Mode is set to API token. Then you should have the options to configure API Token generation, generate new tokens, and revoke existing tokens. Once you have your API token, you may authenticate your API call by adding a `client-id` value containing yourAPI token client ID and a `client-token` value containing your API token client token to your payload. (e.g. `{"client-id": "cccdj-311s", "client-token": "42jkjl-k234jlk1b38123kj3kjl-ffwzzuilaei"}`
5353
</details>
5454
# Authorization
@@ -118,12 +118,10 @@
118118
&lsquo;Diagnostics &gt; Command Prompt&rsquo; and enter the commands there</ul><h1>UI Settings &amp; Documentation</h1><p>After installation, you will be able to access the API user interface pages within the pfSense webConfigurator. These will be found under System &gt; API. The settings tab will allow you change various API settings such as enabled API interfaces, authentication modes, and more. Additionally, the documentation tab will give you access to an embedded documentation tool that makes it easy to view the full API documentation with context to your pfSense instance.<h3>Notes:</h3><ul><li>Users must hold the <code>page-all</code> or <code>page-system-api</code> privileges to access the API page within the webConfigurator</ul><h1>Authentication</h1><p>By default, pfSense API uses the same credentials as the webConfigurator. This behavior allows you to configure pfSense
119119
from the API out of the box, and user passwords may be changed from the API to immediately add additional security if
120120
needed. After installation, you can navigate to System &gt; API in the pfSense webConfigurator to configure API
121-
authentication.<p>To authenticate your API call, follow the instructions for your configured authentication mode:<p><details><summary>Local Database (default)</summary
122-
uses the same credentials as the pfsense webconfigurator. to authenticate api calls, simply add a `client-id` value containing your username and a `client-token` value containing your password to your payload. for example `{"client-id": "admin", "client-token": "pfsense"}`
123-
</details><p><details><summary>JWT</summary
124-
requires a bearer token to be included in the `authorization` header of your request. to receive a bearer token, you may make a post request to /api/v1/access_token/ and include a `client-id` value containing your pfsense username and a `client-token` value containing your pfsense password to your payload. for example `{"client-id": "admin", "client-token": "pfsense"}`. once you have your bearer token, you can authenticate your apicall by adding it to the request's authorization header. (e.g. `authorization: bearer xxxxxxxx.xxxxxxxxx.xxxxxxxx`)
125-
</details><p><details><summary>API Token</summary
126-
uses standalone tokens generated via the ui. these are better suited to distribute to systems as they are revocable and will only allow api authentication and not ui or ssh authentication (like the local database credentials). to generate or revoke credentials, navigate to system> API within the UI and ensure the Authentication Mode is set to API token. Then you should have the options to configure API Token generation, generate new tokens, and revoke existing tokens. Once you have your API token, you may authenticate your API call by adding a <code>client-id</code> value containing yourAPI token client ID and a <code>client-token</code> value containing your API token client token to your payload. (e.g. <code>{&quot;client-id&quot;: &quot;cccdj-311s&quot;, &quot;client-token&quot;: &quot;42jkjl-k234jlk1b38123kj3kjl-ffwzzuilaei&quot;}</code></details><h1>Authorization</h1><p>pfSense API uses the same privielges as the pfSense webConfigurator. The required privileges for each endpoint are stated within the API documentation.<h1>Response Codes</h1><p><code>200 (OK)</code> : API call succeeded<br><code>400 (Bad Request)</code> : An error was found within your requested parameters<br><code>401 (Unauthorized)</code> : API client has not completed authentication or authorization successfully<br><code>403 (Forbidden)</code> : The API endpoint has refused your call. Commonly due to your access settings found in <code>System &gt; API</code><br><code>404 (Not found)</code> : Either the API endpoint or requested data was not found<br><code>500 (Server error)</code> : The API endpoint encountered an unexpected error processing your API request<br><h1>Error Codes</h1><p>A full list of error codes can be found by navigating to /api/v1/system/api/errors/ after installation. This will return
121+
authentication.<p>To authenticate your API call, follow the instructions for your configured authentication mode:<p><details><summary>Local Database (default)</summary>
122+
Uses the same credentials as the pfSense webConfigurator. To authenticate API calls, simply add a <code>client-id</code> value containing your username and a <code>client-token</code> value containing your password to your payload. For example <code>{&quot;client-id&quot;: &quot;admin&quot;, &quot;client-token&quot;: &quot;pfsense&quot;}</code></details><p><details><summary>JWT</summary>
123+
Requires a bearer token to be included in the <code>Authorization</code> header of your request. To receive a bearer token, you may make a POST request to /api/v1/access_token/ and include a <code>client-id</code> value containing your pfSense username and a <code>client-token</code> value containing your pfSense password to your payload. For example <code>{&quot;client-id&quot;: &quot;admin&quot;, &quot;client-token&quot;: &quot;pfsense&quot;}</code>. Once you have your bearer token, you can authenticate your APIcall by adding it to the request&rsquo;s authorization header. (e.g. <code>Authorization: Bearer xxxxxxxx.xxxxxxxxx.xxxxxxxx</code>)</details><p><details><summary>API Token</summary>
124+
Uses standalone tokens generated via the UI. These are better suited to distribute to systems as they are revocable and will only allow API authentication and not UI or SSH authentication (like the local database credentials). To generate or revoke credentials, navigate to System &gt; API within the UI and ensure the Authentication Mode is set to API token. Then you should have the options to configure API Token generation, generate new tokens, and revoke existing tokens. Once you have your API token, you may authenticate your API call by adding a <code>client-id</code> value containing yourAPI token client ID and a <code>client-token</code> value containing your API token client token to your payload. (e.g. <code>{&quot;client-id&quot;: &quot;cccdj-311s&quot;, &quot;client-token&quot;: &quot;42jkjl-k234jlk1b38123kj3kjl-ffwzzuilaei&quot;}</code></details><h1>Authorization</h1><p>pfSense API uses the same privielges as the pfSense webConfigurator. The required privileges for each endpoint are stated within the API documentation.<h1>Response Codes</h1><p><code>200 (OK)</code> : API call succeeded<br><code>400 (Bad Request)</code> : An error was found within your requested parameters<br><code>401 (Unauthorized)</code> : API client has not completed authentication or authorization successfully<br><code>403 (Forbidden)</code> : The API endpoint has refused your call. Commonly due to your access settings found in <code>System &gt; API</code><br><code>404 (Not found)</code> : Either the API endpoint or requested data was not found<br><code>500 (Server error)</code> : The API endpoint encountered an unexpected error processing your API request<br><h1>Error Codes</h1><p>A full list of error codes can be found by navigating to /api/v1/system/api/errors/ after installation. This will return
127125
JSON data containing each error code and their corresponding error message. No authentication is required to view the
128126
error code library. This also makes API integration with third-party software easy as the API error codes and messages
129127
are always just an HTTP call away!<h1>Queries</h1><p>For endpoints supporting <code>GET</code> requests, you may query the return data to only return data you are looking for. To query data, you may add the data you are looking for to your payload. You may specify as many query parameters as you like to, in order to match the query, each parameter must match exactly. If no matches were found, the endpoint will return an empty array in the data field.
@@ -913,7 +911,7 @@
913911
function IsJsonString(str){try{JSON.parse(str);}catch(e){return false;}
914912
return true;}
915913
String.prototype.replaceAll=function(replaceThis,withThis){var re=new RegExp(RegExp.quote(replaceThis),"g");return this.replace(re,withThis);};RegExp.quote=function(str){return str.replace(/([.?*+^$[\]\\(){}-])/g,"\\$1");};function syntaxHighlight(json){json=json.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,function(match){var cls='number';if(/^"/.test(match)){if(/:$/.test(match)){cls='key';}else{cls='string';}}else if(/true|false/.test(match)){cls='boolean';}else if(/null/.test(match)){cls='null';}
916-
return '<span class="'+cls+'">'+match+'</span>';});}</script><br><br><footer class="navbar-default navbar-fixed-bottom"><div class=container-fluid><div class="span12 text-center"><span data-toggle=tooltip title="If the application help you, please feel free to give a star to the project in github. Your star inspire me to work more on open-source projects like this!">Made with <em class=love-color>&#9829;</em> by <a href=https://github.com/thedevsaddam target=_blank class=text-muted>thedevsaddam</a> | Generated at: 2020-09-27 10:50:11 by <a href=https://github.com/thedevsaddam/docgen target=_blank class=text-muted>docgen</a></span></div></div></footer>
914+
return '<span class="'+cls+'">'+match+'</span>';});}</script><br><br><footer class="navbar-default navbar-fixed-bottom"><div class=container-fluid><div class="span12 text-center"><span data-toggle=tooltip title="If the application help you, please feel free to give a star to the project in github. Your star inspire me to work more on open-source projects like this!">Made with <em class=love-color>&#9829;</em> by <a href=https://github.com/thedevsaddam target=_blank class=text-muted>thedevsaddam</a> | Generated at: 2020-09-27 10:51:43 by <a href=https://github.com/thedevsaddam/docgen target=_blank class=text-muted>docgen</a></span></div></div></footer>
917915
<style>
918916
div.col-md-12.collection-intro, footer{
919917
display:none;

0 commit comments

Comments
 (0)