General information

Mediatopic publishing with a confirmation from the user. To publish using a similar format attachment parameter, as well as in the method mediatopic.post.

Your application must be approved on our platform to work correctly. For non-approved apps topics won’t be created and you will get 0 as a topic id in a result

Method signature

FAPI.UI.postMediatopic(attachment, status);
ParameterRequiredTypeDescription
attachmentYesjsonJson-coded information on the topic published by the media (see. The format below)
statusNobooleanSet mediatopic as the current user status

Example usage

FAPI.UI.postMediatopic({
    "media":[
        {
            "type": "text",
            "text": "Here you can see odnoklassniki API docs(click the link)"
        },
        {
            "type": "link",
            "url": "https://apiok.ru"
        },
        {
            "type": "poll",
            "question": "Do you like our API?",
            "answers": [
                { "text": "Yes" },
                { "text": "No" }
            ],
            "options": "SingleChoice,AnonymousVoting"
        }
    ]
}, false);

Callback example

As a result dialog with topic preview will be displayed to user. User can either accept or decline to create a topic.

Following values can be passed to API_callback function as a result:

Callback if topic was successfully created

method: “postMediatopic”

result: “ok”

data: “70102413183763” /* topic id */

Callback if user declined to create a topic

Web

method: “postMediatopic”

result: “cancel”

data: “null”

Mobile

method: “postMediatopic”

result: “error”

data: “cancel”

Dialog example

As a result dialog with topic preview will be displayed to user

Dialog example on web

Dialog example on mobile