PHP code example of haosijia / feiyu-crm

1. Go to this page and download the library: Download haosijia/feiyu-crm 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/ */

    

haosijia / feiyu-crm example snippets




use FeiYuCRM\FeiYu;

$feiyu = new FeiYu([
  'host' => 'https://feiyu.oceanengine.com',
  'pull_route' => '/crm/v2/openapi/pull-clues/',
  'push_route' => '/crm/v2/openapi/clue/callback/',
  'signature_key' => 'ABCDEFGHIGKLMNOP',
  'token' => '01234567890123abcdefghijklmnopqrstuvwxyz',
]);

// 拉取数据方法案例
$feiyu->pullData('2019-08-01', '2019-09-01', 100)->run(function($customers){
  foreach ($customers as $customer) {
    // run yourself function
    print_r($customer);
    die;
  }
});

// 回传数据方法案例
$res = $feiyu->pushData([
  'clue_id' => '1234567891234567891',
  'clue_convert_state' => 3,
]);