Overview

The Start Processing API in Vidizmo Portal is used to initiate advanced content processing. It can perform tasks like encoding on mashups, making them compatible with various devices and platforms. You can also explore other options like clipping and transcription. 


In a previous article titled Upload Content we discussed the process of creating mashups within Vidizmo Portal. Once you have created a mashup, you can utilize the Start Processing API to initiate the encoding and transcription processes and then monitor the progress of our mashup being processed utilizing the Workflow Status Api.


While we have primarily discussed transcription and encoding in this article, the Start Processing API offers a multitude of advanced processing options. These include clipping etc. To explore these advanced processing options, you can refer to the Start Processing API Documentation. We tested these APIs on Postman to ensure smooth functionality.


Before You Start

  • Authorize yourself in the portal by using the following endpoint: /api/v1/user/authenticate/. To learn how to achieve authorization, refer to the User Authentication Guide.  
  • Once you have obtained the authorization token, you can proceed to create a mashup in the portal.
  • Prepare a reliable testing platform, such as Postman, to test the APIs effectively. 

Content Processing Request

To initiate the processing workflow for a mashup, follow these details: 


1. Make POST request to the following endpoint:

{{Your-Domain}}/api/v1/mashup/{{mashupId}}/start-processing 
Replace {{Your-Domain}} with your tenant URL and {{mashupId}} with the unique identifier of your Mashup object, received while creating the mashup. 

 

2. Request Details 

The payload for the request is customized based on specific needs, such as encoding and transcription. However, you can refer to the Start Processing API for the complete payload. 

 

Example - Request Body (JSON): 

{ 

  "title": "{{mashupTitle}}", //Mashup title whose processing is going to be done 
  "mashupId": {{mashupId}}, // Unique Identifier of Mashup 
  "format": "Audio", 
  "mashupUUID": "{{mashupUUID}}", //Mashup UUID whose processing is going to be done 
  "transcoding": true,  
  "transcribe": { 
    "translate": { 
      "translationLanguages": [ 
        "en-us" 
      ] 
    } 
}, 
  "visualInsight": true, 
  "detect": { 
    "detectionTypes": [ 
      "Transcribe" 
    ] 
  } 
} 

 

Note: Here the MashupId and MashupUUID, Mashup Title you would have received while creating a mashup and the same would be used here. 


Authorization 

  • Bearer Token: {{Token}}, token received while authentication. 

 

3. Response Details 

If your Mashup processing workflow is successfully queued, the Status Code is 200 and the response body will return true. 


Example - Response Body (JSON)

true


Next Steps 

Once the processing workflow is initiated, the system will begin the requested operations, such as encoding and transcription, on the specified mashup. You can monitor the progress as well. This will be discussed in the below section: 


To Get Workflow Status Update

To monitor the progress of your mashup being processed, follow these steps: 


1. Make a POST request to the following endpoint: 

 {{Your-Domain}}/api/v1/workflow/search/queue 

This Api will respond with the list of workflows in the Queues based on the search criteria you’ll provide. 

 

2. Request Details 

The payload for the request is customised based on specific needs. However, you can refer to the Workflow Search API for the complete payload information. 

 

Example - Request Body (JSON): 

{ 
    "objectIds": [   // ObjectIds takes the ids of Objects against which workflows are initiated 
        {{mashupId}} // Unique Identifier of Mashup 
        ], 
    "state": [           //Current State of Workflow 
        "Running", 
        "Pending", 
        "Finished" 
    ], 
    "pageSize": 24 //Number of records to be returned 

} 

In the objectIds array, you have the flexibility to provide one or more process IDs for which you wish to retrieve the status. In our example, we included the mashup ID, which is the unique identifier for the mashup on which we performed encoding and transcription 

 

3. Response Details

If the response is successful, you’ll get a list of Workflows with their description.


Example - Response Body (

{
    "workflowqueue": [
        {
            "id": 1476599, 
            "description": "Free_Test_Data_100KB_MP3",
            "contextParameters": "{\r\n  \"$type\": \"System.Collections.Generic.Dictionary`2[[System.String, System.Private.CoreLib],[System.Object, System.Private.CoreLib]], System.Private.CoreLib\",\r\n  \"Culture\": \"en-us\"\r\n}",
            "percentage": 6.2,
            "machineGuid": "VIDTSTENC02KHI",
            "state": "Pending",
            "errorCount": 0,
            "workflowParameters": "{\"Transcribe\":{\"Transcription\":false,\"Translate\":{\"TranslationLanguages\":[\"en-us\"]},\"UseComprehend\":false},\"PreviewThumbnails\":{\"PreviewThumbnails\":true},\"GenerateAudioPCM\":false,\"MashupId\":273256,\"MashupUUID\":\"41fe8a6c-6472-4d9c-bdfb-6b9dfc585a10\",\"TenantId\":9571,\"Format\":\"Audio\",\"Title\":\"Free_Test_Data_100KB_MP3\",\"GenerateThumbnails\":true,\"Transcoding\":true,\"VisualInsight\":true,\"Detect\":{\"DetectionTypes\":[\"Transcribe\"],\"OverwriteExistingTimedData\":false}}",
            "objectId": 273256,
            "objectUUID": "41fe8a6c-6472-4d9c-bdfb-6b9dfc585a10",
            "subject": "Audio",
            "workflow": {
                "id": 8,
                "tenantId": 0,
                "name": "VIDIZMO On-Premise Encoder",
                "isDeleted": false,
                "quota": 9.0,
                "totalResultsCount": 0,
                "isNotifyOnProcessingFailure": true,
                "isNotifyOnProcessingSuccess": true,
                "isSequential": false,
                "concurrency": "All"
            },
            "tenant": {
                "id": 9571,
                "isSSLEnable": false,
                "weight": 0,
                "uuid": "8b3329ba-c20a-425e-8a5b-02201ec52ac7"
            },
            "addedBy": {
                "firstName": "Alex",
                "lastName": "Hales",
                "id": 98743,
                "isPasswordSet": false
            },
            "updatedBy": {
                "id": 0,
                "isPasswordSet": false
            },
            "triggeredBy": {
                "guid": "244ea8ae-9b22-4795-9b09-6ad3fcec5244",
                "eventDate": "0001-01-01T00:00:00",
                "status": "None",
                "subjectType": "None",
                "subjectId": 0,
                "tenantId": 0,
                "vidizmoEventId": "All",
                "userProfileId": 0,
                "isSystem": false,
                "triggeredByObjectType": "None",
                "triggeredByObjectId": 0,
                "id": 0
            },
            "addedDate": "2023-09-27T08:14:00.91",
            "modifiedDate": "2023-09-27T08:14:01.17"
        }
    ],
    "totalRecords": 1
}

The above response provides information about the workflow of our mashup which includes its Id, status , descriptions, percentages, machine GUIDs, and states . You can use this data to monitor the progress of your mashup being processed.


For more detailed information and advanced use cases, please refer to the comprehensive Workflow Status API Documentation.


Read Next

Using REST API - Search Mashup