You need to configure and send HTTP POST requests to call the API operations provided by the text-based image retrieval model. This topic describes the common request parameters for the API operations provided by the text-based image retrieval model.

POST requests

You need to encapsulate the API name (function_name), parameter dictionary (function_param), and data that you want to upload in POST requests. All requests use the following syntax:
  • Request syntax
    You can specify the parameters based on your business requirements in POST requests to call different API operations provided by the text-based image retrieval service. The following code provides an example of the request syntax:
    {   
        "function_name": "XXX"  # Required. The name of the API operation that you want to call. 
        "function_params": {
            param1: XXX # The parameter of the API operation. For more information, see the parameter descriptions of the corresponding API operations. 
            param2:
            ....
        },
     }
  • Request parameters
    Parameter Required Description Type
    function_name Yes The name of the API operation. Valid values:
    • API operations that can be used to manage databases: init, get, delete, add, and save.
    • API operations that can be used to manage a single database: db_set, db_get, db_search, and db_delete.
    STRING
    function_params Varies based on function_name For more information, see the topic that corresponds to the API operation that is specified by function_name. DICT
  • Response parameters

    For more information, see the topic that corresponds to the API operation that is specified by function_name.