Skip to content

Post API Add Post Example Birthday Greeting

Dominik Magdaleński edited this page Jul 3, 2019 · 1 revision

Post API - /add_post - Birthday Greeting template example with YouTube video

body.json:

{
  "template": "birthday-greeting",
  "title": "\uD83C\uDF89 Happy birthday, Alex! \uD83C\uDF82",
  "media_type": "youtube-video",
  "content_zones": [
    15
  ],
  "youtube_url": "https://www.youtube.com/watch?v=xxOviBI-8fc"
}

Request:

http --follow POST https://dive-networks.com/api/rpc/34/add_post \
Authorization:"Token your-api-token-here" \
< body.json

Response:

HTTP/1.1 201 Created
(...headers...)

{
    "result": {
        "background_color": "ffffff", 
        "body": null, 
        "content_zones": [
            15
        ], 
        "duration": null, 
        "frequency": 300, 
        "fullscreen_playback": false, 
        "id": 13368, 
        "iframe_url": null, 
        "image_height": null, 
        "image_layout": "auto", 
        "image_url": null, 
        "image_width": null, 
        "intro_background_color": "6d4fc3", 
        "intro_text_color": "ffffff", 
        "is_published": true, 
        "media_type": "youtube-video", 
        "override_end": null, 
        "override_start": null, 
        "pdf_height": null, 
        "pdf_numpages": null, 
        "pdf_thumbnail_url": null, 
        "pdf_url": null, 
        "pdf_width": null, 
        "priority": "low", 
        "schedule_end": "2019-07-03T06:48:48.775735-04:00", 
        "schedule_start": "2019-06-26T06:48:48.775684-04:00", 
        "show_data_source_in_player": true, 
        "show_post_in_player_window": true, 
        "show_publication_time": false, 
        "show_text_in_ticker": false, 
        "show_title_in_player": true, 
        "subtitle": null, 
        "template": "birthday-greeting", 
        "text_color": "000000", 
        "text_layout": "auto", 
        "title": "🎉 Happy birthday, Alex! 🎂", 
        "uploaded_file_s3_bucket": "", 
        "uploaded_file_s3_key": "", 
        "uploaded_file_size_bytes": null, 
        "video_filename": null, 
        "video_url": null, 
        "youtube_url": "https://www.youtube.com/watch?v=xxOviBI-8fc"
    }
}