PHP code example of roiwk / umeng-open-api

1. Go to this page and download the library: Download roiwk/umeng-open-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

roiwk / umeng-open-api example snippets




use Roiwk\UmengOpenAPI\Factory;

$app = Factory::umini([
    'api_key'       => 'your key',
    'api_secret'    => 'your secret',
    'app_key'       => 'your APPKEY',
    // 指定 API 调用返回结果的类型:json(default)/array/object/raw(resultObject)
    'response_type' => 'json',
]);

// 参数1:api名 (com.umeng.umini:umeng.umini.getTotalUser-1, 传"getTotalUser" 即可)
// 参数2: 请求参数数组
$app->get('getTotalUser', [
    'fromDate'  => '2020-11-01',
    'toDate'    => '2020-11-01',
    'pageIndex' => 1,
    'pageSize'  => 10,
]);