Get all tags

Contents

    Get all tags and the pages keys related to each tag.

    All request to the API need the API Token, you can find the token in the settings of the plugin.

    Request

    • Endpoint: /api/tags
    • Method: GET

    Bellow the list of parameters allowed for this endpoint.

    key value Default value
    required token string API Token

    Response

    • HTTP Code: 200
    • Content-Type: application/json
    {
      "status": "0",
      "message": "List of tags.",
      "data": [
        {
          "name": "Bludit",
          "description": "",
          "template": "",
          "list": [
            "follow-bludit"
          ],
          "key": "bludit"
        },
        {
          "name": "CMS",
          "description": "",
          "template": "",
          "list": [
            "follow-bludit"
          ],
          "key": "cms"
        },
        {
          "name": "Flat files",
          "description": "",
          "template": "",
          "list": [
            "follow-bludit"
          ],
          "key": "flat-files"
        }
      ]
    }

    CURL command example

    The follow request returns a list of published and static pages, limited by the API, you can change the limit in the API settings.

    $ curl -X GET \
        -G "https://www.example.com/api/tags" \
        -d "token=80a09ba055b73f68e3c9e7c9ea12b432"

    Output:

    {
      "status": "0",
      "message": "List of tags.",
      "data": [
        {
          "name": "Bludit",
          "description": "",
          "template": "",
          "list": [
            "follow-bludit"
          ],
          "key": "bludit"
        },
        {
          "name": "CMS",
          "description": "",
          "template": "",
          "list": [
            "follow-bludit"
          ],
          "key": "cms"
        },
        {
          "name": "Flat files",
          "description": "",
          "template": "",
          "list": [
            "follow-bludit"
          ],
          "key": "flat-files"
        }
      ]
    }

    Javascript example

    You can use the Fetch API to get the list of tags.

    <script>
        fetch("https://www.example.com/api/tags?token=eaf5df0a626145cc6d37b76f3eccc826", {
            method: 'get'
        }).then(function(response) {
            return response.json();
        }).then(function(json) {
            console.log(json.data);
        });
    </script>