# Publish a dimension

Publish a dimension that belongs to a published app, by using the [Publish method](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/EngineJSONAPI/Content/service-genericdimension-publish.htm).

The target of the request is the handle of the dimension.

## Example

[](https://help.qlik.com/en-US/sense-developer/Subsystems/EngineAPI/Content/Sense_EngineAPI/WorkingWithAppsAndVisualizations/PublishAppVisualizations/publish-dimension.htm)

#### The goal is to publish a dimension that belongs to an app that is published.

Prerequisite:

* The app is published.

1. Create a dimension in the app.

The client sends:

```
{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "CreateDimension",
  "handle": 1,
  "params": [
    {
      "qInfo": {
        "qId": "Dimension01",
        "qType": "Dimension"
      },
      "qDim": {
        "qGrouping": "N",
        "qFieldDefs": [
          "Country"
        ],
        "qFieldLabels": [
          "Country library label"
        ]
      }
    }
  ]
}
```

The engine returns:

```
{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "qReturn": {
      "qType": "GenericDimension",
      "qHandle": 2
    },
    "qInfo": {
      "qId": "Dimension01",
      "qType": "Dimension"
    }
  },
  "change": [
    2
  ]
}
```

The dimension is created and has 2 as a handle.

2. Publish the dimension. The handle of the request is 2 because the handle of the dimension is 2.

The client sends:

```
{
  "jsonrpc": "2.0",
  "id": 4,
  "method": "Publish",
  "handle": 2,
  "params": []
}
```

The engine returns:

```
{
  "jsonrpc": "2.0",
  "id": 4,
  "result": {}
}
```

The dimension is published.

3. Check that the dimension is published.

The client sends:

```
{
  "jsonrpc": "2.0",
  "id": 6,
  "method": "GetLayout",
  "handle": 2,
  "params": []
}
```

The engine returns:

{ "jsonrpc": "2.0", "id": 6, "result": { "qLayout": { "qInfo": { "qId": "Dimension01", "qType": "Dimension" }, "qMeta": { "title": "", "privileges": [ "create", "read", "update", "delete", "publish", "changeowner" ], "modifiedDate": "2014-07-31T09:15:05.532Z", "published": true, "publishTime": "2014-07-31T09:15:05.507Z", "approved": false, "owner": { "userId": "platform\_tester", "userDirectory": "QT", "name": "platform\_tester", "privileges": null, "id": "c6f69127-55a0-4ddb-a92a-585874390da6" }, "qSize": -1 }, "qDim": { "qGrouping": "N", "qFieldDefs": [ "Country" ], "qFieldLabels": [ "Country library label" ] }, "qDimInfos": [ { "qApprMaxGlyphCount": 7, "qCardinal": 1, "qTags": [ "$ascii", "$text" ] } ] } } }

The dimension is published. Result: result/qLayout/qMeta/published is set to true.

## Learn more

* [Publish an app to a stream](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/EngineAPI/Content/Sense_EngineAPI/WorkingWithAppsAndVisualizations/PublishAppVisualizations/publish-app-to-stream.htm)
* [Publish a bookmark](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/EngineAPI/Content/Sense_EngineAPI/DiscoveringAndAnalysing/Bookmarks/publish-bookmark.htm)
* [Publish a generic object](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/EngineAPI/Content/Sense_EngineAPI/WorkingWithAppsAndVisualizations/PublishAppVisualizations/publish-generic-object.htm)
* [Publish a measure](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/EngineAPI/Content/Sense_EngineAPI/WorkingWithAppsAndVisualizations/PublishAppVisualizations/publish-measure.htm)