# Publish a generic object

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

The target of the request is the handle of the generic object.

## Example

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

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

Prerequisite:

* The app is published.

1. Create a generic object in the app. The object is created once the app is published.

The client sends:

```
{
  "jsonrpc": "2.0",
  "id": 9,
  "method": "CreateObject",
  "handle": 1,
  "params": [
    {
      "qInfo": {
        "qId": "LB01",
        "qType": "ListObject"
      },
      "qListObjectDef": {
        "qStateName": "$",
        "qLibraryId": "",
        "qDef": {
          "qFieldDefs": [
            "Country"
          ],
          "qFieldLabels": [
            "Country Label"
          ],
          "qSortCriterias": [
            {
              "qSortByLoadOrder": 1
            }
          ]
        },
        "qInitialDataFetch": [
          {
            "qTop": 0,
            "qHeight": 1,
            "qLeft": 0,
            "qWidth": 1
          }
        ]
      }
    }
  ]
}
```

The engine returns:

```
{
  "jsonrpc": "2.0",
  "id": 9,
  "result": {
    "qReturn": {
      "qType": "GenericObject",
      "qHandle": 5
    },
    "qInfo": {
      "qId": "LB01",
      "qType": "ListObject"
    }
  },
  "change": [
    5
  ]
}
```

The generic object is created and has 5 as a handle.

2. Publish the generic object. The handle of the request is 5 because the handle of the generic object is 5.

The client sends:

```
{
  "jsonrpc": "2.0",
  "id": 10,
  "method": "Publish",
  "handle": 5,
  "params": []
}
```

The engine returns:

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

The generic object is published.

3. Check that the object is published: The handle of the request is 5 because the generic object has five as a handle.

The client sends:

```
{
  "jsonrpc": "2.0",
  "id": 13,
  "method": "GetLayout",
  "handle": 5,
  "params": []
}
```

The engine returns:

{ "jsonrpc": "2.0", "id": 13, "result": { "qLayout": { "qInfo": { "qId": "LB01", "qType": "ListObject" }, "qMeta": { "title": "", "privileges": [ "create", "read", "update", "delete", "publish", "changeowner" ], "modifiedDate": "2014-08-22T11:59:15.061Z", "published": true, "publishTime": "2014-08-22T11:59:15.035Z", "approved": false, "owner": { "userId": "platform\_tester", "userDirectory": "QT", "name": "platform\_tester", "privileges": null, "id": "255a9338-b038-479b-9543-1c2c9045cc1f" }, "qSize": -1 }, "qSelectionInfo": {}, "qListObject": { "qStateName": "$", "qSize": { "qcx": 1, "qcy": 1 }, "qDimensionInfo": { "qFallbackTitle": "Country Label", "qApprMaxGlyphCount": 7, "qCardinal": 1, "qSortIndicator": "A", "qGroupFallbackTitles": [ "Country Label" ], "qGroupPos": 0, "qStateCounts": { "qLocked": 0, "qSelected": 0, "qOption": 1, "qDeselected": 0, "qAlternative": 0, "qExcluded": 0, "qSelectedExcluded": 0, "qLockedExcluded": 0 }, "qTags": [ "$ascii", "$text" ], "qDimensionType": "D", "qGrouping": "N", "qNumFormat": { "qType": "R", "qnDec": 14, "qUseThou": 1, "qFmt": "##############", "qDec": "," }, "qIsAutoFormat": true, "qGroupFieldDefs": [ "Country" ] }, "qExpressions": [], "qDataPages": [ { "qMatrix": [ [ { "qText": "Germany", "qNum": "NaN", "qElemNumber": 0, "qState": "O" } ] ], "qTails": [], "qArea": { "qLeft": 0, "qTop": 0, "qWidth": 1, "qHeight": 1 } } ] } } } }

The generic object 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/May2025/Subsystems/EngineAPI/Content/Sense_EngineAPI/WorkingWithAppsAndVisualizations/PublishAppVisualizations/publish-app-to-stream.htm)
* [Publish a bookmark](https://help.qlik.com/en-US/sense-developer/May2025/Subsystems/EngineAPI/Content/Sense_EngineAPI/DiscoveringAndAnalysing/Bookmarks/publish-bookmark.htm)
* [Publish a dimension](https://help.qlik.com/en-US/sense-developer/May2025/Subsystems/EngineAPI/Content/Sense_EngineAPI/WorkingWithAppsAndVisualizations/PublishAppVisualizations/publish-dimension.htm)
* [Publish a measure](https://help.qlik.com/en-US/sense-developer/May2025/Subsystems/EngineAPI/Content/Sense_EngineAPI/WorkingWithAppsAndVisualizations/PublishAppVisualizations/publish-measure.htm)