Skip to main content
POST
/
external-api
/
publications
Create Publication
curl --request POST \
  --url https://api.example.com/external-api/publications \
  --header 'Content-Type: application/json' \
  --data '
[
  {
    "external_id": "<string>",
    "channel_id": 123,
    "payment_status": "<string>",
    "text": "<string>",
    "text_len": 123,
    "media_type": "<string>",
    "file_id": "<string>",
    "file_url": "<string>",
    "album": {
      "album": [
        {
          "id": 123,
          "file_id": "<string>",
          "file_url": "<string>",
          "media_type": "<string>",
          "caption": "<string>",
          "caption_len": 123,
          "has_spoiler": true,
          "footers": [
            {
              "id": 123,
              "footer_text": "<string>",
              "text_len": 123,
              "is_selected": true
            }
          ]
        }
      ]
    },
    "poll": {
      "poll": {
        "question": "<string>",
        "options": [
          "<string>"
        ],
        "is_anonymous": true,
        "type": "<string>",
        "allows_multiple_answers": true,
        "correct_option_id": 123,
        "explanation": "<string>",
        "open_period": 123,
        "close_date": "<string>"
      }
    },
    "inline_buttons": {
      "inline_keyboard": [
        [
          {
            "text": "<string>",
            "url": "<string>",
            "callback_data": "<string>",
            "web_url": "<string>",
            "login_url": "<string>",
            "switch_inline_query": "<string>",
            "switch_inline_query_current_chat": "<string>",
            "switch_inline_query_chosen_chat": "<string>",
            "copy_text": "<string>",
            "callback_game": "<string>",
            "pay": "<string>"
          }
        ]
      ]
    },
    "auto_delete": 123,
    "with_sound_notification": true,
    "price": 123,
    "publish_date": "<string>",
    "wp_preview": true,
    "allow_comments": true,
    "has_spoiler": true,
    "protect_content": true,
    "wp_preview_config": {
      "is_disabled": true,
      "url": "<string>",
      "prefer_small_media": true,
      "show_above_text": true
    },
    "comment": "<string>"
  }
]
'
{
  "publications": [
    {
      "id": 123,
      "external_id": "<string>"
    }
  ]
}

Headers

X-Partner-Id
string

Body

application/json
external_id
string
channel_id
integer
payment_status
string
text
string
text_len
integer
media_type
string
file_id
string
file_url
string
album
object
poll
object
inline_buttons
object
auto_delete
integer
with_sound_notification
boolean
price
integer
publish_date
string
wp_preview
boolean
allow_comments
boolean
has_spoiler
boolean
protect_content
boolean
wp_preview_config
object
comment
string

Response

201 - application/json
publications
object[]
required