Product Model API Usage

Business Process

  • Description
  1. Use product image, product mask image, model image, and model mask image to create a composite result image.
  2. The mask image should be black and white and have the same resolution as the original image.
  • Image Example
demo

Usage Example

    • First, obtain Topview-Uid and Authorization as request header parameters. For details, see the documentation How To Get Topview Uid And Key. Assume Topview-Uid=NsDAaOPF4jLuAie4ewyg and Authorization=Bearer sk-vEsneECh1J5eKHUw4vxHI61e7FvXPnPE1625PmSt3HB【Note: Current account is unavailable ❌】.
Step1: Execute Product AnyShoot - V2 - Product Model - Submit Task Task
curl --location --request POST 'https://api.topview.ai/v2/product_anyShoot/product_model/task/submit' \
--header 'Topview-Uid: NsDAaOPF4jLuAie4ewyg' \
--header 'Authorization: Bearer sk-vEsneECh1J5eKHUw4vxHI61e7FvXPnPE1625PmSt3HB' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--header 'Host: api.topview.ai' \
--header 'Connection: keep-alive' \
--data-raw '{
    "productImageFileId": "540260082bf245d190f909cf7cf6b603",
    "templateImageFileId": "fdad0f9c47364bf5a2f577a5d0a9da13",
    "templateMaskFileId": "a457a6f60d0d4c2babb51419145eac4d",
    "generatingCount": 2
}'
  • response
{
    "code": "200",
    "message": "Success",
    "result": {
        "taskId": "cda20d59c22c4227ae48a08cc03d8b00",
        "status": "success",
        "errorMsg": null,
        "subTaskId": "cda20d59c22c4227ae48a08cc03d8b00",
        "noticeUuid": ""
    }
}
Step2: Execute Product AnyShoot - V2 - Product Model - Query Task Task
curl --location --request GET 'https://api.topview.ai/v2/product_anyShoot/product_model/task/result?taskId=cda20d59c22c4227ae48a08cc03d8b00&needCloudFrontUrl' \
--header 'Authorization: Bearer sk-vEsneECh1J5eKHUw4vxHI61e7FvXPnPE1625PmSt3HB' \
--header 'Topview-Uid: NsDAaOPF4jLuAie4ewyg' \
--header 'Accept: */*' \
--header 'Host: api.topview.ai' \
--header 'Connection: keep-alive'
  • response
{
    "code": "200",
    "message": "Success",
    "result": {
        "taskId": "cda20d59c22c4227ae48a08cc03d8b00",
        "status": "success",
        "errorMsg": "",
        "costCredit": 1.00,
        "anyfitImages": [
            {
                "key": "2df987fd604e4a74ac341f8a49a6d501",
                "url": "https://aigc.s3.amazonaws.com/analyzed_video/task/any_fit/88b5a7ff5ef741f5b57800a957bf4df2/0.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20250829T102825Z&X-Amz-SignedHeaders=host&X-Amz-Expires=86400&X-Amz-Credential=AKIARMCUIMKIOTHGVNFI%2F20250829%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=c57e329a8943b1cfd42d85ebfaf4ac07deadded2fc5b813ce8a7e5a478a0c027"
            },
            {
                "key": "e5648f987b7c47979a0fe15f7b473372",
                "url": "https://aigc.s3.amazonaws.com/analyzed_video/task/any_fit/0a0ca7eb9a74458c9c780fb0aa5aa55a/0.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20250829T102825Z&X-Amz-SignedHeaders=host&X-Amz-Expires=86400&X-Amz-Credential=AKIARMCUIMKIOTHGVNFI%2F20250829%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=810687a6343e9d33344a151b4734d0c238dcf71203a263b0df41ad34f7d76dc6"
            }
        ]
    }
}