This tutorial adds two contents into MMS in parallel.

Reference manual for * Add Content (Pull)

Input creation (json)

Create a file (demo_3.json) having the following content

{
        "Type": "Workflow",
        "Label": "1",
        "Variables": {
                "TitleOfVideo_1": "My Title of the video_1 content",
                "TitleOfVideo_2": "My Title of the video_2 content"
        },
        "Task": {
                "Type": "GroupOfTasks",
                "Parameters": {
                        "ExecutionType": "parallel",
                        "Tasks": [
                                {
                                        "Label": "${TitleOfVideo_1}",
                                        "Type": "Add-Content",
                                        "Parameters": {
                                        "SourceURL": "http://techslides.com/demos/sample-videos/small.mp4",
                                                "FileFormat": "mp4",
                                                "ContentType": "video",
                                                "UserData": { "MyData": "this is my video data" },
                                                "Title": "${TitleOfVideo_1}"
                                        }
                                },
                                {
                                        "Label": "${TitleOfVideo_2}",
                                        "Type": "Add-Content",
                                        "Parameters": {
                                        "SourceURL": "http://techslides.com/demos/sample-videos/small.mp4",
                                                "FileFormat": "mp4",
                                                "ContentType": "video",
                                                "UserData": { "MyData": "this is my video data" },
                                                "Title": "${TitleOfVideo_2}"
                                        }
                                }
                        ]
                }
        }
}

Command

Run the following HTTP POST having as input userKey, APIKey and demo_3.json: * curl -k -v -X POST -u 654:SU1.8AO1O2z0gdezR99BIPvAz2y4LNUsCKcKJrSrQ_S4lS33iZ4zGJ8kfWxQqmOhKL -d @demo_3.json -H "Content-Type: application/json" https://mms-api.catrasoft.cloud/catramms/v1/ingestion

The return will be: * { "workflow": { "ingestionRootKey": 252, "label": "1" }, "tasks": [ { "ingestionJobKey": 841, "label": "My Title of the video_1 content" }, { "ingestionJobKey": 842, "label": "My Title of the video_2 content" } ] }

Get the status of the entire Workflow

To get the status of the above ingestion, run the HTTP GET having as input the ingestionRootKey: * curl -k -v -u 654:SU1.8AO1O2z0gdezR99BIPvAz2y4LNUsCKcKJrSrQ_S4lS33iZ4zGJ8kfWxQqmOhKL https://mms-api.catrasoft.cloud/catramms/v1/ingestion/252

The return will be:

{
    "workflow" : 
    {
        "ingestionRootKey" : 252,
        "label" : "1",
        "tasks" : 
        [
            {
                "downloadingProgress" : 100,
                "endIngestion" : "2018-05-15T12:46:45Z",
                "errorMessage" : null,
                "ingestionJobKey" : 841,
                "ingestionType" : "Add-Content",
                "label" : "My Title of the video_1 content",
                "mediaItemKey" : 3,
                "physicalPathKey" : null,
                "startIngestion" : "2018-05-15T12:46:42Z",
                "status" : "End_TaskSuccess",
                "uploadingProgress" : null,
                "videoDetails" : 
                {
                    "audioBitRate" : 83050,
                    "audioChannels" : 1,
                    "audioCodecName" : "aac",
                    "audioSampleRate" : 48000,
                    "bitRate" : 551193,
                    "durationInMilliSeconds" : 5000,
                    "videoAvgFrameRate" : "30/1",
                    "videoBitRate" : 465641,
                    "videoCodecName" : "h264",
                    "videoHeight" : 320,
                    "videoProfile" : "Constrained Baseline",
                    "videoWidth" : 560
                }
            },
            {
                "downloadingProgress" : 100,
                "endIngestion" : "2018-05-15T12:46:45Z",
                "errorMessage" : null,
                "ingestionJobKey" : 842,
                "ingestionType" : "Add-Content",
                "label" : "My Title of the video_2 content",
                "mediaItemKey" : 4,
                "physicalPathKey" : null,
                "startIngestion" : "2018-05-15T12:46:42Z",
                "status" : "End_TaskSuccess",
                "uploadingProgress" : null,
                "videoDetails" : 
                {
                    "audioBitRate" : 83050,
                    "audioChannels" : 1,
                    "audioCodecName" : "aac",
                    "audioSampleRate" : 48000,
                    "bitRate" : 551193,
                    "durationInMilliSeconds" : 5000,
                    "videoAvgFrameRate" : "30/1",
                    "videoBitRate" : 465641,
                    "videoCodecName" : "h264",
                    "videoHeight" : 320,
                    "videoProfile" : "Constrained Baseline",
                    "videoWidth" : 560
                }
            }
        ]
    }
}

Get the status of the single Task

To get the status of the above ingestion, run the HTTP GET having as input the ingestionRootKey: * curl -k -v -u 654:SU1.8AO1O2z0gdezR99BIPvAz2y4LNUsCKcKJrSrQ_S4lS33iZ4zGJ8kfWxQqmOhKL https://mms-api.catrasoft.cloud/catramms/v1/ingestion/252/842

The return will be:

{
    "workflow" : 
    {
        "ingestionRootKey" : 252,
        "label" : "1",
        "tasks" : 
        [
            {
                "downloadingProgress" : 100,
                "endIngestion" : "2018-05-15T12:46:45Z",
                "errorMessage" : null,
                "ingestionJobKey" : 842,
                "ingestionType" : "Add-Content",
                "label" : "My Title of the video_2 content",
                "mediaItemKey" : 4,
                "physicalPathKey" : null,
                "startIngestion" : "2018-05-15T12:46:42Z",
                "status" : "End_TaskSuccess",
                "uploadingProgress" : null,
                "videoDetails" : 
                {
                    "audioBitRate" : 83050,
                    "audioChannels" : 1,
                    "audioCodecName" : "aac",
                    "audioSampleRate" : 48000,
                    "bitRate" : 551193,
                    "durationInMilliSeconds" : 5000,
                    "videoAvgFrameRate" : "30/1",
                    "videoBitRate" : 465641,
                    "videoCodecName" : "h264",
                    "videoHeight" : 320,
                    "videoProfile" : "Constrained Baseline",
                    "videoWidth" : 560
                }
            }
        ]
    }
}