This tutorial just add a content into MMS.

Reference manual for * Add Content (Pull)

Input creation (json)

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

{
        "Type": "Workflow",
        "Label": "Workflow 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}"
                }
        }
}

Command to add the content

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

The return will be: * { "workflow": { "ingestionRootKey": 248, "label": "Workflow 1" }, "tasks": [ { "ingestionJobKey": 834, "label": "This is my video" } ] }

Get the status

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

The return will be:

{
    "workflow" : 
    {
        "ingestionRootKey" : 248,
        "label" : "Workflow 1",
        "tasks" : 
        [
            {
                "downloadingProgress" : 100,
                "endIngestion" : "2018-05-15T10:51:48Z",
                "errorMessage" : null,
                "ingestionJobKey" : 834,
                "ingestionType" : "Add-Content",
                "label" : "This is my video",
                "mediaItemKey" : 1,
                "physicalPathKey" : 653,
                "startIngestion" : "2018-05-15T10:51:45Z",
                "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
                }
            }
        ]
    }
}

To get the content back (delivery)

To get the content back through an HTTP delivery, it is needed first to create an authorization (run the HTTP GET having as input the physicalPathKey): * curl -k -v -u 654:SU1.8AO1O2z0gdezR99BIPvAz2y4LNUsCKcKJrSrQ_S4lS33iZ4zGJ8kfWxQqmOhKL https://mms-api.catrasoft.cloud/catramms/v1/delivery/653

The return will be: * { "deliveryURL": "https://mms-delivery.catrasoft.cloud/MMS_0000/CatraSoft/000/000/561/833_source.mp4?token=4&outputFileName=myName.mp4", "deliveryFileName": "myName.mp4", "authorizationKey": 4, "ttlInSeconds": 120, "maxRetries": 10 }

Then download the content through the provided HTTP request: * https://mms-delivery.catrasoft.cloud/MMS_0000/CatraSoft/000/000/561/833_source.mp4?token=4&outputFileName=myName.mp4