Skip to content

Post API Add Post Example YouTube Video

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

Post API - /add_post - YouTube Video template example

body.json:

{
  "template": "video",
  "title": "Having a bad day? Watch this!",
  "content_zones": [15],
  "youtube_url": "https://www.youtube.com/watch?v=NC9YGuDcjrE"
}

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": 13358, 
        "iframe_url": null, 
        "image_height": null, 
        "image_layout": "auto", 
        "image_url": null, 
        "image_width": null, 
        "intro_background_color": null, 
        "intro_text_color": null, 
        "is_published": true, 
        "media_type": null, 
        "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-01T06:41:57.848940-04:00", 
        "schedule_start": "2019-06-24T06:41:57.848892-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": "video", 
        "text_color": null, 
        "text_layout": "auto", 
        "title": "Having a bad day? Watch this!", 
        "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=NC9YGuDcjrE"
    }
}