This tutorial implements the following Workflow: * a content is added into MMS * on success an email is sent

Reference manual for * Add Content (Pull) * Notification through email

Input creation (json)

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

{
        "Type": "Workflow",
        "Label": "1",
        "Variables": {
                "Title": "My Title of the content"
        },
        "Task": {
                "Label": "This is my video",
                "Type": "Add-Content",
                "Parameters": {
                        "SourceURL": "http://techslides.com/demos/sample-videos/small.mp4",
                        "FileFormat": "mp4",
                        "ContentType": "video",
                        "UserData": { "MyData": "this is my data" },
                        "Title": "${Title}"
                },
                "OnSuccess": {
                        "Task": {
                                "Type": "Email-Notification",
                                "Parameters": {
                                        "EmailAddress": "giulianoc@catrasoftware.it",
                                        "Subject": "Task finished",
                                        "Message": "Task __INGESTIONJOBKEY__ has finished"
                                }
                        }
                }
        }
}

Command

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

The return will be: * { "workflow": { "ingestionRootKey": 251, "label": "1" }, "tasks": [ { "ingestionJobKey": 839, "label": "This is my video" }, { "ingestionJobKey": 840, "label": "" } ] }

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/251

The return will be:

{
    "workflow" : 
    {
        "ingestionRootKey" : 251,
        "label" : "1",
        "tasks" : 
        [
            {
                "downloadingProgress" : 100,
                "endIngestion" : "2018-05-15T12:30:11Z",
                "errorMessage" : null,
                "ingestionJobKey" : 839,
                "ingestionType" : "Add-Content",
                "label" : "This is my video",
                "mediaItemKey" : 2,
                "physicalPathKey" : null,
                "startIngestion" : "2018-05-15T12:30:08Z",
                "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
                }
            },
            {
                "endIngestion" : "2018-05-15T12:30:13Z",
                "errorMessage" : null,
                "ingestionJobKey" : 840,
                "ingestionType" : "Email-Notification",
                "label" : "",
                "mediaItemKey" : null,
                "physicalPathKey" : null,
                "startIngestion" : "2018-05-15T12:30:08Z",
                "status" : "End_TaskSuccess"
            }
        ]
    }
}

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/251/839

The return will be:

{
    "workflow" : 
    {
        "ingestionRootKey" : 251,
        "label" : "1",
        "tasks" : 
        [
            {
                "downloadingProgress" : 100,
                "endIngestion" : "2018-05-15T12:30:11Z",
                "errorMessage" : null,
                "ingestionJobKey" : 839,
                "ingestionType" : "Add-Content",
                "label" : "This is my video",
                "mediaItemKey" : 2,
                "physicalPathKey" : null,
                "startIngestion" : "2018-05-15T12:30:08Z",
                "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
                }
            }
        ]
    }
}