Overview

The Vidizmo Search Mashup API can help users find mashups on the portal with ease. In this article, we will demonstrate how to search for a specific mashup that we updated with custom attributes and basic information in the Update Mashup  article. Through our testing with Postman, we can confirm that this API functions seamlessly in locating desired mashups in your portal.


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.  
  • Prepare a reliable testing platform, such as Postman, to test the APIs effectively.  


Searching Mashup

In order to search a Mashup in the portal:

1. Make a Post request to the following endpoint:

{Your-Domain}/api/v1/mashup/search 

2. Request Details

Add the following request headers:

  • Content-Type: Application/json
  • Authentication: Bearer-Token = (Token received while authentication)


3. Request Body

Specify the search criteria for the Mashup in the request body. The search is performed based on a keyword; here, we use the 'MashupTitle' as the search keyword. We will search for the mashup using its title. Minimum payload required for this API is mentioned in the example response body below. For detailed payload information, refer to the Search Mashup API Documentation

Example Request - Body (JSON)

{
    "pageSize": 24, //Gets or sets the total number of records required (Used in pagination)
    "pageIndex": 0, //Get or sets the start index of the record (Used in pagination)

    "isGlobal": true,

    "keyword": "{{mashupTitle}}", //Represents the keyword used for searching mashups
   
 //Filter the mashups based upon their statuses.
    "status": [
        "Published" 
    ],

    //Parts that will be searched and Returned
    "mashupSearchParts": [
        "CustomAttributes",
        "CustomAttributesStats",
        "Tags",
        "RelatedTags",
        "Categories",
        "MashupFormatStats",
        "ProcessedStats",
        "AuthorStats",
        "Stats",
        "Participation",
        "UserStats",
        "Tracking",
        "TimedData"
    ],
    //Filters live sessions based on the statuses provided
    "mashupSessionStatuses": [
        "Recorded",
        "Running",
        "Paused",
        "Upcoming"
    ],
    "sortType": "DESC", //order in which you want to sort the search
    "showOnChannelLibrary": true,

   /*OrderBy specifies how the search results should be ordered. In this case,
We ordered by the mashup on the basis of "Relevance" and "defaultviewingaccess" */

    "orderBy": "Relevance", 
    "defaultViewingAccesses": [
        "None",
        "Anonymous",
        "ChannelUsers",
        "ChannelUsersAndMainChannelUsers"
    ],
    "includeAllCategories": true
}

After sending the request with the Request Headers and Request Body mentioned above, you'll receive a 200 OK status code if the request was successful and you'll get a response similar to the response body provided below.


Example Response - Body (JSON)

{
    "mashups": [
        {
            "id": 272434,
            "addedBy": {
                "id": {{addedbyId}},
                "isPasswordSet": false
            },

            "author": {
                "firstName": "{{authorFirstName}}",
                "lastName": "{{authorLastName}}",
                "id": 0,
                "isPasswordSet": false
            },

            "tenant": {
                "id": 9571,
                "tenantName": "Testing Portal",
                "subDomainUrl": "{{subDomainURL}}",
                "isSSLEnable": true,
                "weight": 0,
                "uuid": "{{tenantUUID}}"
            },
             //... (other essential fields)
        }
]
}

Note: Replace the placeholders like {{authorFirstName}}, etc. with your specific values.


In response, a complete Mashup Search Result Object is given depending on search criteria you provide. The response we got provides information on the mashup search parts specified in the request body, mashup stats, viewing access, etc., as well as how to filter the search results.