# List All Topics

This API is used to list the topics for a specific appID

[block:callout]
{
  "type": "info",
  "title": "Know Your Endpoint",
  "body": "Based on the domain you use to log in to imiconnect, the endpoint for your API varies. See the [endpoint](https://developers.imiconnect.io/reference/endpoints) section to understand which endpoint to use for your domain."
}
[/block]

**For Topic**:

The following is the error code displayed when the Topic messaging is disabled for your tenant.

[block:code]
{
  "codes": [
    {
      "code": "{\n\n\"code\": 69,\n\n\"description\": \"Topics based messaging feature is not available for your tenant\"\n\n}",
      "language": "json"
    }
  ]
}
[/block]

[block:callout]
{
  "type": "info",
  "body": "To enable the Topic messaging for your tenant, contact your account manager.",
  "title": "Note"
}
[/block]

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Topic APIs",
    "version": "6.21.0"
  },
  "servers": [
    {
      "url": "https://rtm.imiconnect.io/"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "key"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/apps/$(appid)/topics": {
      "get": {
        "summary": "List All Topics",
        "description": "This API is used to list the topics for a specific appID",
        "operationId": "list",
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "description": "Application/JSON",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "secretKey",
            "in": "header",
            "description": "Client key that can be accessed from your app asset configuration page on imiconnect platform",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "appid",
            "in": "path",
            "description": "The ID of the app asset that you can obtain from IMIconnect platform",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\"topics\" : [{\n\t\t\t\"id\" : \"591d44c3e4b09eee109c1541\",\n\t\t\t\"ref\" : \"World News\",\n\t\t\t\"created_on\" : \"2017-05-26T18 12:22:51.001Z\",\n\t\t\t\"description\" : \"World wide news will be anounced\",\n\t\t\t\"topic\" : \"news\",\n\t\t\t\"topic_group\" : \"newsGroup\"\n\t\t}, {\n\t\t\t\"id\" : \"591d7b7de4b09e0d95d4f73d\",\n\t\t\t\"ref\" : \"offer ref\",\n\t\t\t\"created_on\" : \"2017-05-26T18 12:22:51.001Z\",\n\t\t\t\"description\" : \"Get Benifits by subscribe\",\n\t\t\t\"topic\" : \"offers\",\n\t\t\t\"topic_group\" : \"Extra Benifits\"\n\t\t}\n\t],\n\t\"trans_id\" : \"0c19ad72-179c-4d89-bf6d-2e104e3d62f5\",\n\t\"description\" : \"success\",\n\t\"code\" : \"0\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "topics": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "591d44c3e4b09eee109c1541"
                          },
                          "ref": {
                            "type": "string",
                            "example": "World News"
                          },
                          "created_on": {
                            "type": "string",
                            "example": "2017-05-26T18 12:22:51.001Z"
                          },
                          "description": {
                            "type": "string",
                            "example": "World wide news will be anounced"
                          },
                          "topic": {
                            "type": "string",
                            "example": "news"
                          },
                          "topic_group": {
                            "type": "string",
                            "example": "newsGroup"
                          }
                        }
                      }
                    },
                    "trans_id": {
                      "type": "string",
                      "example": "0c19ad72-179c-4d89-bf6d-2e104e3d62f5"
                    },
                    "description": {
                      "type": "string",
                      "example": "success"
                    },
                    "code": {
                      "type": "string",
                      "example": "0"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "-X GET https://{{rtmsapi}}/rtmsAPI/api/v1/apps/{{inappid}}/topics/\n-H \"secretKey: {secretKey}\"\n"
            },
            {
              "language": "ruby",
              "code": "require 'httparty'\n# Create the HTTP objects and post request\nhttp = HTTParty.get(\"https://{{rtmsapi}}/rtmsAPI/api/v1/apps/{{inappid}}/topics\",\n    :headers => {\n                          'secretKey ' => '{secretKey}’\n            }\n)\n# Print on console\nputs http\n"
            },
            {
              "language": "javascript",
              "code": "var data = null;\n\nvar xhr = new XMLHttpRequest();\n\nxhr.addEventListener(\"readystatechange\", function () {\n  if (this.readyState === this.DONE) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"GET\", \" https://{{rtmsapi}}/rtmsAPI/api/v1/apps/{{inappid}}/topics/\");\nxhr.setRequestHeader(\"secretKey\", \"{secretKey}\");\nxhr.send(data);\n"
            },
            {
              "language": "python",
              "code": "import requests\n\nurl = \" https://{{rtmsapi}}/rtmsAPI/api/v1/apps/{{inappid}}/topics/\"\n\nheaders = {'secretKey': '{secretKey}’}\n\nresponse = requests.request(\"GET\", url, headers=headers)\n\nprint(response.text)\n"
            }
          ],
          "samples-languages": [
            "curl",
            "ruby",
            "javascript",
            "python"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [
      {
        "key": "content-type",
        "value": "application/json"
      }
    ],
    "explorer-enabled": false,
    "proxy-enabled": false
  },
  "x-readme-fauxas": true,
  "_id": "6a7c6dbdd82fb949b4e99b6b:6a7c6dbdd82fb949b4e99c10"
}
```