# Get the DOM structure of the merchandise card
Interface should be called on the server side, not in the front end (Weixin Mini Program, web pages, APP, etc.) directly called, specific reference interface call guide
Interface name: ecsgetproductcardinfo
This interface is used to get the DOM structure needed to insert the merchandise card in the article
Note: Different article types support a different range of card types
- Image Messages: Support small cards, text links, cards
- Graphic Messages: Support for large cards, small cards, text links
# 1. How to call
# HTTPS calls
POST https://api.weixin.qq.com/channels/ec/service/product/getcardinfo?access_token=ACCESS_TOKEN
# Cloud Calls
- This interface does not support cloud calls
# Third party invocation
- Third Party Platform calls are not supported by this interface.
# 2. Request parameters
# Query parametersQuery String parameters
Parameter Name | type | Required to fill in | Introductions |
---|---|---|---|
access_token | string | yes | Interface invoke credentials, using access_token |
# Request BodyRequest Payload
Parameter Name | type | Required to fill in | Example | Introductions |
---|---|---|---|---|
product_id | string | yes | 1000000000 | Product ID |
article_type | string | yes | newspic | Article type, currently supported: picture message (newspic), graphic message (news) |
card_type | number | yes | 2 | Card type, currently supported: large card (0), small card (1), text link (2), bar card (3) |
# 3. Return Parameters
# Response Payload
Parameter Name | type | Introductions |
---|---|---|
errcode | number | Error code |
errmsg | string | Error message |
product_key | string | Product key, some article types need this key to insert product card |
DOM | string | Product card DOM structure, most article types need to insert product card DOM structure |
# 4. Note
The errcode will be 0 when the call is successful under normal circumstances.Error when WeChat will return the error code and other information, please query the error message according to the error code.
The product_key and DOM are returned only in requests for article types and card types that require this field.
# 5. Code examples
Example Requests
{
"product_id": "1000000000",
"article_type": "newspic",
"card_type": 2
}
Return an example
{
"errcode": 0,
"errmsg": "ok",
"product_key": "PRODUCT_KEY",
"DOM": "DOM"
}
# 6. Error code
The following is a list of error codes for this interface, other error codes can refer to General error codes
Error code | Error Description | Solutions |
---|---|---|
0 | ok | success |
10170001 | Illegal Product ID | |
10170002 | Types of articles not supported | |
10170003 | Card types not supported |
# 7. Scope of application
Official Account | Service Account |
---|---|
✔ | ✔ |
- ✔: The account can call this interface
- Other account types that are not expressly stated may not be called on this interface without special instructions;