-
-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #198 from dOpensource/dev
Merge Documentation Changes
- Loading branch information
Showing
65 changed files
with
1,652 additions
and
1,554 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,128 @@ | ||
API | ||
=== | ||
|
||
+----------+----------------+---------------------------------------------------+ | ||
| METHODS | FUNCTIONS | ENDPOINTS THEY SUPPORT | | ||
+==========+================+===================================================+ | ||
| PUT | Update existing| - /api/v1/endpoint/lease/<int:leaseid>/revoke | | ||
| | information at | - /api/v1/inboundmapping | | ||
| | endpoint | | | ||
+----------+----------------+---------------------------------------------------+ | ||
| GET | Get Information| - /api/v1/kamailio/stats/ | | ||
| | from Endpoint | - /api/v1/endpoint/lease/ | | ||
| | | - /api/v1/kamailio/reload/ | | ||
| | | - /api/v1/inboundmapping | | ||
+----------+----------------+---------------------------------------------------+ | ||
| POST | Create new | - /api/v1/endpoint/<int:id>/api/v1/inboundmapping | | ||
| | information at | | | ||
| | endpoint | | | ||
+----------+----------------+---------------------------------------------------+ | ||
| DELETE | Delete | - /api/v1/inboundmapping | | ||
| | information at | | | ||
| | endpoint | | | ||
+----------+----------------+---------------------------------------------------+ | ||
|
||
The steps to obtain the API Token key and using the different curl commands are listen below. | ||
|
||
Note: Make sure to to ssh into your serve to run these commands. | ||
Note: Make sure to to login to your instance via ssh. | ||
|
||
Getting Your Token | ||
^^^^^^^^^^^^^^^^^^ | ||
|
||
:: | ||
.. code-block:: bash | ||
DSIP_TOKEN=$(cat /opt/dsiprouter/gui/settings.py | grep API_TOKEN | cut -d "'" -f 2) | ||
cat /opt/dsiprouter/gui/settings.py | grep API_TOKEN | ||
| | ||
Executing Kamailio stats API | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
:: | ||
|
||
.. code-block:: bash | ||
curl -H "Authorization: Bearer $DSIP_TOKEN" | ||
-X GET http://<addressOfYourInstance>:5000/api/v1/kamailio/stats | ||
| | ||
curl -H "Authorization: Bearer $DSIP_TOKEN" | ||
-X GET http://demo.dsiprouter.org:5000/api/v1/kamailio/stats | ||
One Line Version: | ||
:: | ||
|
||
.. code-block:: bash | ||
curl -H "Authorization: Bearer $DSIP_TOKEN" -X GET http://<addressOfYourInstance>:5000/api/v1/kamailio/stats | ||
| | ||
Executing Lease Point API | ||
^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Getting the endlease | ||
:: | ||
|
||
|
||
.. code-block:: bash | ||
curl -H "Authorization: Bearer $DSIP_TOKEN" -H "Content-Type: application/json" | ||
-X GET "http://demo.dsiprouter.org:5000/api/v1/endpoint/lease?ttl=15&email=mack@dsiprouter.org" | ||
| | ||
One Line Version: | ||
:: | ||
|
||
.. code-block:: bash | ||
curl -H "Authorization: Bearer $DSIP_TOKEN" -H "Content-Type: application/json" -X GET "http://demo.dsiprouter.org:5000/api/v1/endpoint/lease?ttl=15&email=mack@dsiprouter.org" | ||
| | ||
Revoking and replacing with your own lease ID | ||
|
||
:: | ||
.. code-block:: bash | ||
curl -H "Authorization: Bearer $DSIP_TOKEN" -H "Content-Type: application/json" | ||
-X PUT "http://demo.dsiprouter.org:5000/api/v1/endpoint/lease/<leaseid>/revoke" | ||
| | ||
-X PUT "http://demo.dsiprouter.org:5000/api/v1/endpoint/lease/1/revoke" | ||
One Line Version: | ||
:: | ||
|
||
curl -H "Authorization: Bearer $DSIP_TOKEN" -H "Content-Type: application/json" -X PUT "http://demo.dsiprouter.org:5000/api/v1/endpoint/lease/<leaseid>/revoke" | ||
| | ||
.. code-block:: bash | ||
curl -H "Authorization: Bearer $DSIP_TOKEN" -H "Content-Type: application/json" -X PUT "http://demo.dsiprouter.org:5000/api/v1/endpoint/lease/1/revoke" | ||
Inbound Mapping Valid commands | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
-------------------------- | ||
GET /api/v1/inboundmapping | ||
-------------------------- | ||
|
||
.. code-block:: bash | ||
curl -X GET -H "Authorization: Bearer ${token}" "http://demo.dsiprouter.org:5000/api/v1/inboundmapping" | ||
curl -X GET -H "Authorization: Bearer ${token}" "http://demo.dsiprouter.org:5000/api/v1/inboundmapping?ruleid=3" | ||
curl -X GET -H "Authorization: Bearer ${token}" "http://demo.dsiprouter.org:5000/api/v1/inboundmapping?did=1313" | ||
--------------------------- | ||
POST /api/v1/inboundmapping | ||
--------------------------- | ||
|
||
.. code-block:: bash | ||
curl -X POST -H "Authorization: Bearer ${token}" --connect-timeout 3 -H "Content-Type: application/json" "http://demo.dsiprouter.org:5000/api/v1/inboundmapping" -d '{"did": "1313", "servers": ["66","67"], "notes": "1313 DID Mapping"}' | ||
curl -X POST -H "Authorization: Bearer ${token}" --connect-timeout 3 -H "Content-Type: application/json" "http://demo.dsiprouter.org:5000/api/v1/inboundmapping" -d '{"did": "1313","servers": ["66","67"]}' | ||
curl -X POST -H "Authorization: Bearer ${token}" --connect-timeout 3 -H "Content-Type: application/json" "http://demo.dsiprouter.org:5000/api/v1/inboundmapping" -d '{"did": "", "servers": ["66"], "notes": "Default DID Mapping"}' | ||
--------------------------- | ||
PUT /api/v1/inboundmapping | ||
--------------------------- | ||
|
||
.. code-block:: bash | ||
curl -X PUT -H "Authorization: Bearer ${token}" --connect-timeout 3 -H "Content-Type: application/json" "http://demo.dsiprouter.org:5000/api/v1/inboundmapping?ruleid=3" -d '{"did": "01234", "notes": "01234 DID Mapping"}' | ||
curl -X PUT -H "Authorization: Bearer ${token}" --connect-timeout 3 -H "Content-Type: application/json" "http://demo.dsiprouter.org:5000/api/v1/inboundmapping?did=1313" -d '{"servers": ["67"]}' | ||
curl -X PUT -H "Authorization: Bearer ${token}" --connect-timeout 3 -H "Content-Type: application/json" "http://demo.dsiprouter.org:5000/api/v1/inboundmapping?did=1313" -d '{"did": "01234", "notes": "01234 DID Mapping"}' | ||
------------------------------- | ||
DELETE /api/v1/inboundmapping | ||
------------------------------- | ||
|
||
.. code-block:: bash | ||
curl -X DELETE -H "Authorization: Bearer ${token}" "http://demo.dsiprouter.org:5000/api/v1/inboundmapping?ruleid=3" | ||
curl -X DELETE -H "Authorization: Bearer ${token}" "http://demo.dsiprouter.org:5000/api/v1/inboundmapping?did=1313" | ||
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.