Persist channels

/cm/channels/persist Saves channels information and channels attributes details.

Allow to

  1. Create a Channel

  2. Rename Channel

  3. Change attribute values (ProjectType.vals)

Table 1. Details

Resource path

/api/core/v1/cm/channels/persist

HTTP method

POST

Request content type

  • application/xml; charset=UTF-8;

  • application/json

  • application/json+compact

Response content type

  • application/xml; charset=UTF-8;

  • application/json

  • application/json+compact

Channel attribute persisting

Channel attributes are stored in ProjectType

Only provided attribute values are persisted, other values that are not provided in ProjectType.vals will be not changed.
Only values of attributes registered in OMN could be saved.

Body parameters

Accepts PimType with ProjectType

Return Type

PimType with statuses ResponsesType about each persisted channel.

Responses

Table 2. Http response codes
Code Message Datatype

200

PimType with list of responses

PimType

500

Error in ResponseType

ResponseType

Samples

Please use transform endpoint to get the JSON/compact-JSON samples from the XML one.
curl
curl --location --request POST 'https://<OMN_SERVER>/api/core/v1/cm/channels/persist' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/xml' \
--data-raw '<BODY>'
1. Create a new Channel
Request body

With Channel tid, parentTid and type:

XML

<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <projects>
        <project tid="MyNewChannel" parentTid="FS2024" type="Advertising media">
            <name>My New Channel</name>
            <vals>
                <val attr="Advertising_media_name">
                    <itm>Test Ad Media</itm>
                </val>
                <val attr="FP_SERIES_COLOR" type="multiple">
                    <itm pos="0">0</itm>
                </val>
                <val attr="FP_SERIES_NAME">
                    <itm pos="0">New Series</itm>
                </val>
                <val attr="FP_SERIES_OFFSET">
                    <itm>0</itm>
                </val>
                <val attr="Comment">
                    <itm>Initially created!</itm>
                </val>
            </vals>
        </project>
    </projects>
</pim>

JSON

{
    "projects": {
        "project": [
            {
                "name": "My New Channel",
                "vals": {
                    "val": [
                        {
                            "itm": [
                                {
                                    "value": "Test Ad Media"
                                }
                            ],
                            "attr": "Advertising_media_name"
                        },
                        {
                            "itm": [
                                {
                                    "value": "0",
                                    "pos": 0
                                }
                            ],
                            "attr": "FP_SERIES_COLOR",
                            "type": "multiple"
                        },
                        {
                            "itm": [
                                {
                                    "value": "New Series",
                                    "pos": 0
                                }
                            ],
                            "attr": "FP_SERIES_NAME"
                        },
                        {
                            "itm": [
                                {
                                    "value": "0"
                                }
                            ],
                            "attr": "FP_SERIES_OFFSET"
                        },
                        {
                            "itm": [
                                {
                                    "value": "Initially created!"
                                }
                            ],
                            "attr": "Comment"
                        }
                    ]
                },
                "tid": "MyNewChannel",
                "parentTid": "FS2024",
                "type": "Advertising media"
            }
        ]
    },
    "schemaVersion": "5.6.0"
}

JSON Compact

{
    "projects": {
        "entries": [
            {
                "name": "My New Channel",
                "vals": {
                    "entries": [
                        {
                            "attr": "Advertising_media_name",
                            "value": "Test Ad Media"
                        },
                        {
                            "attr": "FP_SERIES_COLOR",
                            "type": "multiple",
                            "value": [
                                {
                                    "value": "0",
                                    "pos": 0
                                }
                            ]
                        },
                        {
                            "attr": "FP_SERIES_NAME",
                            "value": "New Series"
                        },
                        {
                            "attr": "FP_SERIES_OFFSET",
                            "value": "0"
                        },
                        {
                            "attr": "Comment",
                            "value": "Initially created!"
                        }
                    ]
                },
                "tid": "MyNewChannel",
                "parentTid": "FS2024",
                "type": "Advertising media"
            }
        ]
    },
    "schemaVersion": "5.6.0"
}

With Channel tid, parentId and type:

<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <projects>
        <project tid="MyNewChannel" parentId="52796" type="Advertising media">
            <name>My New Channel</name>
            <vals>
                <val attr="Advertising_media_name">
                    <itm>Test Ad Media</itm>
                </val>
                <val attr="FP_SERIES_COLOR" type="multiple">
                    <itm pos="0">0</itm>
                </val>
                <val attr="FP_SERIES_NAME">
                    <itm pos="0">New Series</itm>
                </val>
                <val attr="FP_SERIES_OFFSET">
                    <itm>0</itm>
                </val>
                <val attr="Comment">
                    <itm>Initially created!</itm>
                </val>
            </vals>
        </project>
    </projects>
</pim>
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2024-12-16T04:23:48.707Z</itm>
        <itm key="sourceEnv">ocd_dev</itm>
    </meta>
    <responses>
        <response dataType="project" tid="MyNewChannel">
            <status>SUCCESS</status>
        </response>
    </responses>
</pim>
2. Rename Channel
Request body

By id:

<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <projects>
        <project id="190041">
            <name>My New Renamed Channel</name>
        </project>
    </projects>
</pim>

By tid:

<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <projects>
        <project tid="MyNewChannel">
            <name>My New Renamed Channel</name>
        </project>
    </projects>
</pim>
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2024-12-16T04:28:11.810Z</itm>
        <itm key="sourceEnv">ocd_dev</itm>
    </meta>
    <responses>
        <response dataType="project" tid="MyNewChannel">
            <status>SUCCESS</status>
        </response>
    </responses>
</pim>
3. Save channel attributes and new name
Request body

By id:

<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <projects>
        <project id="190041">
            <name>My New Renamed Channel</name>
            <vals>
                <val attr="Advertising_media_name">
                    <itm>Test Ad Media</itm>
                </val>
                <val attr="FP_SERIES_COLOR" type="multiple">
                    <itm pos="0">0</itm>
                </val>
                <val attr="FP_SERIES_NAME">
                    <itm pos="0">New Series</itm>
                </val>
                <val attr="FP_SERIES_OFFSET">
                    <itm>0</itm>
                </val>
                <val attr="Comment">
                    <itm>New Comment</itm>
                </val>
            </vals>
        </project>
    </projects>
</pim>

By tid:

<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <projects>
        <project tid="MyNewChannel">
            <name>My New Renamed Channel</name>
            <vals>
                <val attr="Advertising_media_name">
                    <itm>Test Ad Media</itm>
                </val>
                <val attr="FP_SERIES_COLOR" type="multiple">
                    <itm pos="0">0</itm>
                </val>
                <val attr="FP_SERIES_NAME">
                    <itm pos="0">New Series</itm>
                </val>
                <val attr="FP_SERIES_OFFSET">
                    <itm>0</itm>
                </val>
                <val attr="Comment">
                    <itm>New Comment</itm>
                </val>
            </vals>
        </project>
    </projects>
</pim>
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2024-12-16T04:29:55.794Z</itm>
        <itm key="sourceEnv">ocd_dev</itm>
    </meta>
    <responses>
        <response dataType="project" tid="MyNewChannel">
            <status>SUCCESS</status>
        </response>
    </responses>
</pim>

Error responses

Channel creation failed
Channel type missing
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2024-12-16T04:36:20.488Z</itm>
        <itm key="sourceEnv">ocd_dev</itm>
    </meta>
    <responses>
        <response dataType="project" tid="MyVeryNewChannel">
            <status>ERROR</status>
            <description>Project type 'null' not found</description>
        </response>
    </responses>
</pim>

Welcome to the AI Chat!

Write a prompt to get started...