# nearbyPoi.add
Call this API at the server side. For more information, see Server API.
This API supports Cloud Calls. The WeChat DevTools version must be
1.02.1904090
or later (download the latest stable version here), and thewx-server-sdk
version must be0.4.0
or later.
Adds a location.
Calling methods:
# HTTPS Call
# Request Address
POST https://api.weixin.qq.com/wxa/addnearbypoi?access_token=ACCESS_TOKEN
# Request Parameters
Attribute | Type | Default | Required | Description |
---|---|---|---|---|
access_token | string | Yes | Credentials to call API | |
is_comm_nearby | string | Yes | Required. It is "1". | |
pic_list | string | Yes | The picture of the store. A minimum of one picture and a maximum of nine pictures are supported. The pictures may show the exterior of the store, environment, facilities, commodities, and services, and will be displayed on the store page on WeChat. Links to the pictures are obtained via the [Uploading a Picture in an Article to Obtain a URL] API in the document at https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444738729. This property is required. BMP, PNG, JPEG, JPG, or GIF files not larger than 5 MB are supported. The value of pic_list is a string containing one JSON object. | |
service_infos | string | Yes | The list of service tags (optional). The service tag ID, AppID, and the path to the service page are required. Specific formats of the fields are shown below. | |
store_name | string | Yes | The name of the store (required). You need to select the geographical location to pull the store name from Tencent Map. The name cannot be changed. If you need to change the name, reselect the location from Tencent Map or create a location. | |
hour | string | Yes | Business hours (required), in the format of "11:11-12:12". | |
credential | string | Yes | The credential ID (required). It is the 15-digit business license registration number or 9-digit organization code. | |
address | string | Yes | The address (required). | |
company_name | string | Yes | The name of the entity (required). | |
qualification_list | string | Yes | Qualification materials (required). If the value of company_name is inconsistent with the entity of the Mini Program, enter qualification_list. For detailed rules, see the User Guide to Mini Programs Nearby: How to Prove that the Business Entity of the Store Is Associated with the Entity of the Official Account or Mini Program Account (http://kf.qq.com/faq/170401MbUnim17040122m2qY.html). | |
kf_info | string | Yes | The information about the customer service (optional). Custom service profile photo and name are supported. For specific fields, see the following examples. The value of kf_info pic_list is a string containing one JSON object. | |
poi_id | string | Yes | To create a new store, leave the poi_id field empty. To update a store, enter the store's poi_id (optional). | |
NearbyPoiError@error |
# Return Value
# Object
JSON data package that is returned
Attribute | Type | Description |
---|---|---|
errmsg | string | Error message |
errcode | number | Error code |
data | object | Returned data |
data is composed as follows
Property | Type | Description |
---|---|---|
audit_id | string | The ID of the review sheet. |
poi_id | string | The ID of the location nearby |
related_credential | string | The ID of the business qualification document. |
# Frequency Limit
This API cannot be concurrently called for multiple requests. We recommend that this API be called sequentially at a time interval of 1 seconds.
# Request Example
{
"is_comm_nearby": "1", //The value is fixed.
"kf_info": "{\"open_kf\":true,\"kf_headimg\":\"http://mmbiz.qpic.cn/mmbiz_jpg/kKMgNtnEfQzDKpLXYhgo3W3Gndl34gITqmP914zSwhajIEJzUPpx40P7R8fRe1QmicneQMhFzpZNhSLjrvU1pIA/0?wx_fmt=jpeg\",\"kf_name\":\"Harden\"}",
"pic_list": "{\"list\":[\"http://mmbiz.qpic.cn/mmbiz_jpg/kKMgNtnEfQzDKpLXYhgo3W3Gndl34gITqmP914zSwhajIEJzUPpx40P7R8fRe1QmicneQMhFzpZNhSLjrvU1pIA/0?wx_fmt=jpeg\",\"http://mmbiz.qpic.cn/mmbiz_jpg/kKMgNtnEfQzDKpLXYhgo3W3Gndl34gITRneE5FS9uYruXGMmrtmhsBySwddEWUGOibG8Ze2NT5E3Dyt79I0htNg/0?wx_fmt=jpeg\"]}",
"service_infos": "{\"service_infos\":[{\"id\":2,\"type\":1,\"name\":\"Express delivery\",\"appid\":\"wx1373169e494e0c39\",\"path\":\"index\"},{\"id\":0,\"type\":2,\"name\":\"Custom\",\"appid\":\"wx1373169e494e0c39\",\"path\":\"index\"}]}",
"store_name": "Yangcun Xiaoma Barbecue",
"contract_phone": "111111111",
"hour": "00:00-11:11",
"company_name": "Shenzhen Tencent Computer Systems Co., Ltd.",
"credential": "156718193518281",
"address": "Bishuiyuntian Plaza, No. 15-1-8, Bishui Road, Karamay District, Karamay, Xinjiang Uygur Autonomous Region",
"qualification_list": "3LaLzqiTrQcD20DlX_o-OV1-nlYMu7sdVAL7SV2PrxVyjZFZZmB3O6LPGaYXlZWq",
"poi_id": ""
}
# Review Status Notification
The review status notification is pushed to users via an event. The push data is in the format of XML.
# Example Data
<xml>
<ToUserName><![CDATA[gh_4346ac1514d8]]></ToUserName>
<FromUserName><![CDATA[od1P50M-fNQI5Gcq-trm4a7apsU8]]></FromUserName>
<CreateTime>1488856741</CreateTime>
<MsgType><![CDATA[event]]></MsgType>
<Event><![CDATA[add_nearby_poi_audit_info]]></Event>
<audit_id>11111</audit_id>
<status>3</status>
<reason><![CDATA[xxx]]></reason>
<poi_id>111111</poi_id>
</xml>
# Parameters
Parameter | Description |
---|---|
audit_id | The ID of the review sheet. |
status | The review status ("3" indicates that the review is approved, and "2" indicates that the review is rejected.) |
reason | If "status" is "2", the reason for rejection is returned. |
poi_id | poi_id |
# Cloud Call
Cloud call is a capability provided by Mini Program·Cloud Base that allows you to call WeChat APIs in a cloud function. It must be used via
wx-server-sdk
in the cloud function.
# API Calling Method
openapi.nearbyPoi.add
You need to configure the permissions for the
nearbyPoi.add
API viaconfig.json
. Details
# Request Parameters
Attribute | Type | Default | Required | Description |
---|---|---|---|---|
isCommNearby | string | Yes | Required. It is "1". | |
picList | string | Yes | The picture of the store. A minimum of one picture and a maximum of nine pictures are supported. The pictures may show the exterior of the store, environment, facilities, commodities, and services, and will be displayed on the store page on WeChat. Links to the pictures are obtained via the [Uploading a Picture in an Article to Obtain a URL] API in the document at https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444738729. This property is required. BMP, PNG, JPEG, JPG, or GIF files not larger than 5 MB are supported. The value of pic_list is a string containing one JSON object. | |
serviceInfos | string | Yes | The list of service tags (optional). The service tag ID, AppID, and the path to the service page are required. Specific formats of the fields are shown below. | |
storeName | string | Yes | The name of the store (required). You need to select the geographical location to pull the store name from Tencent Map. The name cannot be changed. If you need to change the name, reselect the location from Tencent Map or create a location. | |
hour | string | Yes | Business hours (required), in the format of "11:11-12:12". | |
credential | string | Yes | The credential ID (required). It is the 15-digit business license registration number or 9-digit organization code. | |
address | string | Yes | The address (required). | |
companyName | string | Yes | The name of the entity (required). | |
qualificationList | string | Yes | Qualification materials (required). If the value of company_name is inconsistent with the entity of the Mini Program, enter qualification_list. For detailed rules, see the User Guide to Mini Programs Nearby: How to Prove that the Business Entity of the Store Is Associated with the Entity of the Official Account or Mini Program Account (http://kf.qq.com/faq/170401MbUnim17040122m2qY.html). | |
kfInfo | string | Yes | The information about the customer service (optional). Custom service profile photo and name are supported. For specific fields, see the following examples. The value of kf_info pic_list is a string containing one JSON object. | |
poiId | string | Yes | To create a new store, leave the poi_id field empty. To update a store, enter the store's poi_id (optional). | |
NearbyPoiError@error |
# Return Value
# Object
JSON data package that is returned
Attribute | Type | Description |
---|---|---|
errMsg | string | Error message |
errCode | number | Error code |
data | object | Returned data |
data is composed as follows
Property | Type | Description |
---|---|---|
auditId | string | The ID of the review sheet. |
poiId | string | The ID of the location nearby |
relatedCredential | string | The ID of the business qualification document. |
# Exceptions
# Object
Thrown Exceptions
Property | Type | Description |
---|---|---|
errMsg | string | Error message |
errCode | number | Error code |
Valid values of errCode
Value | Description | Minimum Version |
---|
# Request Example
{
"is_comm_nearby": "1", //The value is fixed.
"kf_info": "{\"open_kf\":true,\"kf_headimg\":\"http://mmbiz.qpic.cn/mmbiz_jpg/kKMgNtnEfQzDKpLXYhgo3W3Gndl34gITqmP914zSwhajIEJzUPpx40P7R8fRe1QmicneQMhFzpZNhSLjrvU1pIA/0?wx_fmt=jpeg\",\"kf_name\":\"Harden\"}",
"pic_list": "{\"list\":[\"http://mmbiz.qpic.cn/mmbiz_jpg/kKMgNtnEfQzDKpLXYhgo3W3Gndl34gITqmP914zSwhajIEJzUPpx40P7R8fRe1QmicneQMhFzpZNhSLjrvU1pIA/0?wx_fmt=jpeg\",\"http://mmbiz.qpic.cn/mmbiz_jpg/kKMgNtnEfQzDKpLXYhgo3W3Gndl34gITRneE5FS9uYruXGMmrtmhsBySwddEWUGOibG8Ze2NT5E3Dyt79I0htNg/0?wx_fmt=jpeg\"]}",
"service_infos": "{\"service_infos\":[{\"id\":2,\"type\":1,\"name\":\"Express delivery\",\"appid\":\"wx1373169e494e0c39\",\"path\":\"index\"},{\"id\":0,\"type\":2,\"name\":\"Custom\",\"appid\":\"wx1373169e494e0c39\",\"path\":\"index\"}]}",
"store_name": "Yangcun Xiaoma Barbecue",
"contract_phone": "111111111",
"hour": "00:00-11:11",
"company_name": "Shenzhen Tencent Computer Systems Co., Ltd.",
"credential": "156718193518281",
"address": "Bishuiyuntian Plaza, No. 15-1-8, Bishui Road, Karamay District, Karamay, Xinjiang Uygur Autonomous Region",
"qualification_list": "3LaLzqiTrQcD20DlX_o-OV1-nlYMu7sdVAL7SV2PrxVyjZFZZmB3O6LPGaYXlZWq",
"poi_id": ""
}