All URIs are relative to https://openapi.alipay.com.
Method | HTTP request | Description |
---|---|---|
batchquery() | POST /v3/alipay/open/public/group/batchquery | 查询用户分组列表 |
create() | POST /v3/alipay/open/public/group/create | 用户分组创建接口 |
delete() | DELETE /v3/alipay/open/public/group/delete | 用户分组删除接口 |
modify() | POST /v3/alipay/open/public/group/modify | 用户分组修改接口 |
batchquery(): \Alipay\OpenAPISDK\Model\AlipayOpenPublicGroupBatchqueryResponseModel
查询用户分组列表
使用该接口查询分组列表,并配合其它分组管理接口使用,最多显示200条
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Alipay\OpenAPISDK\Api\AlipayOpenPublicGroupApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
// 初始化alipay参数
$alipayConfig = new \Alipay\OpenAPISDK\Util\Model\AlipayConfig();
$alipayConfig->setAppId('app_id');
$alipayConfig->setPrivateKey('private_key');
// 密钥模式
$alipayConfig->setAlipayPublicKey('alipay_public_key');
// 证书模式
// $alipayConfig->setAppCertPath('../appCertPublicKey.crt');
// $alipayConfig->setAlipayPublicCertPath('../alipayCertPublicKey_RSA2.crt');
// $alipayConfig->setRootCertPath('../alipayRootCert.crt');
$alipayConfig->setEncryptKey('encrypt_key');
$alipayConfigUtil = new \Alipay\OpenAPISDK\Util\AlipayConfigUtil($alipayConfig);
$apiInstance->setAlipayConfigUtil($alipayConfigUtil);
try {
$result = $apiInstance->batchquery();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AlipayOpenPublicGroupApi->batchquery: ', $e->getMessage(), PHP_EOL;
}
This endpoint does not need any parameter.
\Alipay\OpenAPISDK\Model\AlipayOpenPublicGroupBatchqueryResponseModel
No authorization required
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to README]
create($alipayOpenPublicGroupCreateModel): \Alipay\OpenAPISDK\Model\AlipayOpenPublicGroupCreateResponseModel
用户分组创建接口
开发者可使用此接口根据指定条件从关注用户中圈定人群生成分组,分组可用于组发消息等场景,分组圈定的人群必须大于50人。
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Alipay\OpenAPISDK\Api\AlipayOpenPublicGroupApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
// 初始化alipay参数
$alipayConfig = new \Alipay\OpenAPISDK\Util\Model\AlipayConfig();
$alipayConfig->setAppId('app_id');
$alipayConfig->setPrivateKey('private_key');
// 密钥模式
$alipayConfig->setAlipayPublicKey('alipay_public_key');
// 证书模式
// $alipayConfig->setAppCertPath('../appCertPublicKey.crt');
// $alipayConfig->setAlipayPublicCertPath('../alipayCertPublicKey_RSA2.crt');
// $alipayConfig->setRootCertPath('../alipayRootCert.crt');
$alipayConfig->setEncryptKey('encrypt_key');
$alipayConfigUtil = new \Alipay\OpenAPISDK\Util\AlipayConfigUtil($alipayConfig);
$apiInstance->setAlipayConfigUtil($alipayConfigUtil);
$alipayOpenPublicGroupCreateModel = new \Alipay\OpenAPISDK\Model\AlipayOpenPublicGroupCreateModel(); // \Alipay\OpenAPISDK\Model\AlipayOpenPublicGroupCreateModel
try {
$result = $apiInstance->create($alipayOpenPublicGroupCreateModel);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AlipayOpenPublicGroupApi->create: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
alipayOpenPublicGroupCreateModel | \Alipay\OpenAPISDK\Model\AlipayOpenPublicGroupCreateModel | [optional] |
\Alipay\OpenAPISDK\Model\AlipayOpenPublicGroupCreateResponseModel
No authorization required
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to README]
delete($groupId): object
用户分组删除接口
调用接口删除用户分组
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Alipay\OpenAPISDK\Api\AlipayOpenPublicGroupApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
// 初始化alipay参数
$alipayConfig = new \Alipay\OpenAPISDK\Util\Model\AlipayConfig();
$alipayConfig->setAppId('app_id');
$alipayConfig->setPrivateKey('private_key');
// 密钥模式
$alipayConfig->setAlipayPublicKey('alipay_public_key');
// 证书模式
// $alipayConfig->setAppCertPath('../appCertPublicKey.crt');
// $alipayConfig->setAlipayPublicCertPath('../alipayCertPublicKey_RSA2.crt');
// $alipayConfig->setRootCertPath('../alipayRootCert.crt');
$alipayConfig->setEncryptKey('encrypt_key');
$alipayConfigUtil = new \Alipay\OpenAPISDK\Util\AlipayConfigUtil($alipayConfig);
$apiInstance->setAlipayConfigUtil($alipayConfigUtil);
$groupId = 100; // string | 分组ID,通过<a href=\"https://opendocs.alipay.com/apis/api_6/alipay.open.public.group.create\">alipay.open.public.group.create</a>(用户分组创建接口) 创建用户分组获取。
try {
$result = $apiInstance->delete($groupId);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AlipayOpenPublicGroupApi->delete: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
groupId | string | 分组ID,通过<a href="https://opendocs.alipay.com/apis/api_6/alipay.open.public.group.create\">alipay.open.public.group.create</a>(用户分组创建接口) 创建用户分组获取。 | [optional] |
object
No authorization required
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to README]
modify($alipayOpenPublicGroupModifyModel): object
用户分组修改接口
调用改接口修改用户分组,仅支持修改分组名称。
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Alipay\OpenAPISDK\Api\AlipayOpenPublicGroupApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
// 初始化alipay参数
$alipayConfig = new \Alipay\OpenAPISDK\Util\Model\AlipayConfig();
$alipayConfig->setAppId('app_id');
$alipayConfig->setPrivateKey('private_key');
// 密钥模式
$alipayConfig->setAlipayPublicKey('alipay_public_key');
// 证书模式
// $alipayConfig->setAppCertPath('../appCertPublicKey.crt');
// $alipayConfig->setAlipayPublicCertPath('../alipayCertPublicKey_RSA2.crt');
// $alipayConfig->setRootCertPath('../alipayRootCert.crt');
$alipayConfig->setEncryptKey('encrypt_key');
$alipayConfigUtil = new \Alipay\OpenAPISDK\Util\AlipayConfigUtil($alipayConfig);
$apiInstance->setAlipayConfigUtil($alipayConfigUtil);
$alipayOpenPublicGroupModifyModel = new \Alipay\OpenAPISDK\Model\AlipayOpenPublicGroupModifyModel(); // \Alipay\OpenAPISDK\Model\AlipayOpenPublicGroupModifyModel
try {
$result = $apiInstance->modify($alipayOpenPublicGroupModifyModel);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AlipayOpenPublicGroupApi->modify: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
alipayOpenPublicGroupModifyModel | \Alipay\OpenAPISDK\Model\AlipayOpenPublicGroupModifyModel | [optional] |
object
No authorization required
- Content-Type:
application/json
- Accept:
application/json