# Get speech recognition results

Debugging Tools

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: queryRecoResultForText

This interface is used to query the results of speech to text

# 1. How to call

# HTTPS calls

POST https://api.weixin.qq.com/cgi-bin/media/voice/queryrecoresultfortext?access_token=ACCESS_TOKEN&voice_id=VOICE_ID&lang=LANG

# 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 NametypeRequired to fill inExampleIntroductions
access_tokenstringyesACCESS_TOKENInterface invoke credentials, using access_token
voice_idstringyesxxxxxxVoice unique identifier
langstringnozh_CNLanguage, zh_CN or en_US, default Chinese

# Request BodyRequest Payload

nothing

# 3. Return Parameters

# Response Payload

Parameter NametypeIntroductions
resultstringIdentification results

# 4. Note

Call this interface within 10 s of adding the file

# 5. Code examples

Example Requests

https://api.weixin.qq.com/cgi-bin/media/voice/queryrecoresultfortext?access_token=ACCESS_TOKEN&voice_id=xxxxxx&lang=zh_CN

Return an example

{
  "result": "xxxxxxxxxxxxxxxxxx"
}

# 6. Error code

The following is a list of error codes for this interface, other error codes can refer to General error codes

Error codeError DescriptionSolutions
-1system errorThe system is busy, so the developer is asked to try again in a few minutes.
40001invalid credential  access_token isinvalid or not latestAppSecret error while getting access_token, or access_token is invalid.Developers should check that AppSecret is correct, or that they are calling interfaces for the appropriate Official Account

# 7. Scope of application

How this interface can be invoked under different account types:
Weixin Mini Program Official Account Service Account MiniGame Mobile App
  • ✔: The account can call this interface
  • Other account types that are not expressly stated may not be called on this interface without special instructions;