# invokeService

The interface is used to call the service platform shelf API, applicable to the Official Account message template, Mini programs and third-party platform calls, the difference is only access_Token generation.

# HTTPS call

# Request Address

POST https://api.weixin.qq.com/wxa/servicemarket?access_token=ACCESS_TOKEN

# Request parameters

attribute type Default value Required Introductions
access_Token string yes If it is Official Account message template, Then refer toGet_access_TokenIf it is an Mini Program, refer to theauth.getAccessTokenIf it is a third-party platform call, refer to theauthorizer_access_Token
service string yes service ID, the service id can be found on each interface detail page, see the screenshot at the end of the document
api string yes Interface nameThe api can be found on each interface detail page Name, please see the screenshot at the end of the document
data string yes Defined by the service provider interface JSON Format of data, see the interface documentation for each service for details
client_msg_id string yes Random character string ID, the unique identification of the caller's request
async boolean no Whether it is an asynchronous API, when it is an asynchronous call, you must fill in true

# Return value

# Object

Returned JSON Data packet

attribute type Introductions
errcode number Error code
errmsg string Error message
data string Packet Return Information
request_id string Asynchronous call will return, unique id

# Synchronization Request Data Example

{
  "service" : "wx79ac3de8be320b71",
  "api" : "OcrAllInOne",
  "data" : {
    "img_url": "http://mmbiz.qpic.cn/mmbiz_jpg/7UFjuNbYxibu66xSqsQqKcuoGBZM77HIyibdiczeWibdMeA2XMt5oibWVQMgDibriazJSOibLqZxcO6DVVcZMxDKgeAtbQ/0",
    "data_type": 3,
    初始值_type": 1
  },
  "client_msg_id" : "id123"
}

# Synchronous Return Data Example

{
 "errcode": 0,
 "errmsg": "ok",
 "data": "{"idcard_res":{"type":0,"name":{"text":"abc","pos"0312500}}},"image_width":480,"image_height":304}}"
}

# Asynchronous Request Data Example

 {
    "service" : "wxee446d7507c68b11",
    "api" : "SecCheckAsync"
    "data" : {
     "BusinessType": 1,
       "MediaType": 1,
       "TextContent": "hello",
        "MediaUrl": "http://example.com/example.jpg"
    },
    "client_msg_id" : "random_id_456",
    "async" : true,
    "client_msg_id" : "id123"
}

# Asynchronous Return Data Example

{
 "errcode": 0,
 "errmsg": "ok",
 "request_id": " MLwFmCkCxNOthxteVMf3UFWRmb9VPwTMTuxJUAUD-svS-6AqBC9tbzZzDyHFglQ5_aI"
}

# Error code

Error code Description in English Description in Chinese
0 ok success
9301001 Parameter error
初始值 call api service failed Call backend service failed
9301003 internal exception System failure
9301010 consumption failure Inadequate quota
9301011 Frequency limitation
9301012 Service processing timeout
9301014 RequestID
9301015 Backend not processed yet

# Service ID and interface name

The service id and interface name can be found in the following way