linkstring必填
WeChat Official Account article short link or intermediate link to convert.
https://api.sandbase.ai/v1/api/wechat-mp/convert-article-linkExpands a WeChat Official Account article link to its resolved long-form destination. Use it to normalize a short or intermediate link before article lookup or collection.
您的輸出會顯示在這裡
完成輸入後,點擊執行。
This API takes a WeChat Official Account article link and returns two normalized URLs for the same article. It needs one input, link, which can be a short link or an intermediate link.
long_url values.mp.weixin.qq.com/s/... link for sharing or display.curl -X POST "https://api.sandbase.ai/v1/api/wechat-mp/convert-article-link" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"link": "http://mp.weixin.qq.com/s?__biz=MjM5NzI3NDg4MA==&mid=2659064933&idx=1&sn=c536f78d7358bc2dfe90cde700e21d55&chksm=bc881cb3f28a27f35e0711803b28d8110305cfc1b8beb651674e1aa7870ddf963c658f4dc19a&scene=7#rd"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
link | string | Yes | WeChat Official Account article short link or intermediate link to convert. |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"long_url": "https://mp.weixin.qq.com/s?__biz=MjM5NzI3NDg4MA==&mid=2659064933&idx=1&sn=c536f7…",
"short_url": "https://mp.weixin.qq.com/s/THnBSh_vaxhLeYa2lp3d1g"
}
| Field | Meaning |
|---|---|
long_url | The article link in long form. It carries the __biz, mid, idx and sn query parameters that identify the account and the article. |
short_url | The short form of the article link, in the format https://mp.weixin.qq.com/s/<code>. |
link field. The example input is an intermediate link that includes extra parameters such as chksm and scene.long_url drops the chksm and scene parameters from the input link and keeps __biz, mid, idx and sn.$0.014286 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
開始建置
具備統一驗證與用量追蹤的平台 API 端點。
curl -X POST "https://api.sandbase.ai/v1/api/wechat-mp/convert-article-link" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"link": "http://mp.weixin.qq.com/s?__biz=MjM5NzI3NDg4MA==&mid=2659064933&idx=1&sn=c536f78d7358bc2dfe90cde700e21d55&chksm=bc881cb3f28a27f35e0711803b28d8110305cfc1b8beb651674e1aa7870ddf963c658f4dc19a&scene=7#rd"
}'請將您的 SandBase API 金鑰設定在伺服器環境中。請求使用 Bearer 驗證。
export SANDBASE_API_KEY="YOUR_API_KEY"請將金鑰保留在伺服器端,不要在瀏覽器程式碼中公開。
linkstring必填WeChat Official Account article short link or intermediate link to convert.
這是此 API 的已儲存範例回應;檢視時不會發出即時請求。
尚未發布已儲存回應。請在 Playground 中執行 API 以檢視其回應。
探索更多
| API | 價格 | 回應 |
|---|---|---|
WeChat MP | 每次呼叫 $0.014286 | JSON |
WeChat MP | 每次呼叫 $0.142857 | JSON |
WeChat MP | 每次呼叫 $0.042857 | JSON |
WeChat MP | 每次呼叫 $0.028571 | JSON |
WeChat MP | 每次呼叫 $0.021429 | JSON |
WeChat MP | 每次呼叫 $0.021429 | JSON |
問題
使用 POST 請求將您的 SandBase API 金鑰放在 Authorization 標頭(Bearer)中,並以 JSON 主體傳入參數,即可呼叫 https://api.sandbase.ai/v1/api/wechat-mp/convert-article-link。您也可以直接在本頁的 Playground 試用,不必撰寫程式碼。
每次 $0.014286,並從您的 SandBase 餘額中扣款。您只會為實際發出的呼叫付費;沒有訂閱方案。
必要:link (string)。 本頁的 Parameters 表格與 Playground 會列出每個欄位。
在同一個 HTTP 請求中回傳的 JSON 回應(同步)。 本頁的 README 包含範例回應。
不需要。WeChat MP Article Link Conversion 是透過 SandBase 運作,因此一組 SandBase API 金鑰即可使用此端點以及目錄中的其他所有 API 和模型。您不需要另外申請 WeChat MP API 存取權。