按照特定的发动机代码搜索产品

搜索乘用车只是 TecDoc 目录服务的其中一个搜索标准。在这个示例中,我们根据 motorcode 进行搜索。在这里我们使用一个为“CABA”motorcode。我们将使用 getMotorIdsByManuIdCriteria2 并设置参数motorCode为我们的关键词。

getMotorIdsByManuIdCriteria2

JSON Input

{
    "getMotorIdsByManuIdCriteria2": {
        "country": "CN",
        "lang": "EN",
        "motorCode": "CABA",
        "provider": "Your provider ID",
    }
}

JSON Output

{
    "data": {
        "array": [{
            "motorId": 20590
        }]
    },
    "status": 200
}

这个返回了motorId。这个为 TecDoc 的内部ID,如果你需要详细信息,使用 getMotorByIds2 方法。

getMotorByIds2

JSON Input

{
    "getMotorByIds2": {
        "country": "CN",
        "lang": "EN",
        "motorIds": {
            "array": [
                20590
            ]
        },
        "provider": "Your provider ID",
    }
}

JSON Output

{
    "data": {
        "array": [{
            "motorDetails": {
                "cylinder": 4,
                "cylinderCapacity": 1798,
                "fuelType": "Petrol",
                "manuId": 5,
                "manuText": "AUDI",
                "motorCode": "CABA",
                "motorId": 20590,
                "motorNumber": 20590,
                "motorType": "Petrol Engine",
                "powerHP": 120,
                "powerKW": 88
            },
            "motorId": 20590
        }]
    },
    "status": 200
}

你会看到发动机的详情。我们知道这个发动机属于奥迪。但是这还不是我们想要的最终结果。我们想要的是一个与这个发动机相关的产品列表。为了实现这个目标,我们将使用 getArticleIdsWithStategetAssignedArticlesByIds6

在这个请求中我们搜索的是 motoCode,所以我们需要设置linkingTargetType“M”linkingTargetIdmotorId 20590。我们还需要增加更多的标准来筛选品牌、配件总成或者产品组(genericArticleId)。我们决定按照品牌进行筛选。

getArticleIdsWithState

JSON Input

{
    "getArticleIdsWithState": {
        "articleCountry": "CN",
        "lang": "EN",
        "brandNo": {
            "array": [
                5
            ]
        },
        "linkingTargetId": 20590,
        "linkingTargetType": "M",
        "provider": "Your provider ID",
        "sort": 1
    }
}

JSON Output

{
    "data": {
        "array": [{
                "articleId": 7614723,
                "articleLinkId": 7616159,
                "articleNo": "7.00470.07.0",
                "articleStateId": 1,
                "brandName": "PIERBURG",
                "brandNo": 5,
                "genericArticleId": 761,
                "genericArticleName": "Boost Pressure Control Valve",
                "sortNo": 7616159
            },
            {
                "articleId": 186812351,
                "articleLinkId": 186812906,
                "articleNo": "7.07152.04.0",
                "articleStateId": 1,
                "brandName": "PIERBURG",
                "brandNo": 5,
                "genericArticleId": 1260,
                "genericArticleName": "Water Pump",
                "sortNo": 186812906
            },
            {
                "articleId": 7668615,
                "articleLinkId": 7669002,
                "articleNo": "7.22184.74.0",
                "articleStateId": 1,
                "brandName": "PIERBURG",
                "brandNo": 5,
                "genericArticleId": 3926,
                "genericArticleName": "Air Mass Sensor",
                "sortNo": 7669002
            },
            {
                "articleId": 7619555,
                "articleLinkId": 7620403,
                "articleNo": "7.01830.13.0",
                "articleStateId": 1,
                "brandName": "PIERBURG",
                "brandNo": 5,
                "genericArticleId": 4314,
                "genericArticleName": "Diverter Valve, charger",
                "sortNo": 7620403
            },
            {
                "articleId": 252356671,
                "articleLinkId": 252356875,
                "articleNo": "7.07796.08.0",
                "articleStateId": 1,
                "brandName": "PIERBURG",
                "brandNo": 5,
                "genericArticleId": 5763,
                "genericArticleName": "Control Unit, fuel pump",
                "sortNo": 252356875
            },
            {
                "articleId": 252356670,
                "articleLinkId": 252356913,
                "articleNo": "7.07796.09.0",
                "articleStateId": 1,
                "brandName": "PIERBURG",
                "brandNo": 5,
                "genericArticleId": 5763,
                "genericArticleName": "Control Unit, fuel pump",
                "sortNo": 252356913
            },
            {
                "articleId": 252356931,
                "articleLinkId": 252357070,
                "articleNo": "7.07796.10.0",
                "articleStateId": 1,
                "brandName": "PIERBURG",
                "brandNo": 5,
                "genericArticleId": 5763,
                "genericArticleName": "Control Unit, fuel pump",
                "sortNo": 252357070
            },
            {
                "articleId": 252356930,
                "articleLinkId": 252357071,
                "articleNo": "7.07796.11.0",
                "articleStateId": 1,
                "brandName": "PIERBURG",
                "brandNo": 5,
                "genericArticleId": 5763,
                "genericArticleName": "Control Unit, fuel pump",
                "sortNo": 252357071
            }
        ]
    },
    "status": 200
}

在返回的结果中,我们获得了articleId’sarticleLinkId,所以我们可以使用这些值来发送最后的请求 getAssignedArticlesByIds6 了。