BatchInviteTest.php 1003 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php /*
  2. * Copyright (C) 2018 All rights reserved.
  3. *
  4. * @File BatchInviteTest.php
  5. * @Brief
  6. * @Author abelzhu, abelzhu@tencent.com
  7. * @Version 1.0
  8. * @Date 2018-01-02
  9. *
  10. */
  11. include_once("../src/CorpAPI.class.php");
  12. include_once("../src/ServiceCorpAPI.class.php");
  13. include_once("../src/ServiceProviderAPI.class.php");
  14. $config = require('./config.php');
  15. // 需启用 "管理工具" -> "通讯录同步", 并使用该处的secret, 才能通过API管理通讯录
  16. //
  17. $api = new CorpAPI($config['CORP_ID'], $config['APP_SECRET']);
  18. try {
  19. //
  20. $invalidUserIdList = null;
  21. $invalidPartyIdList = null;
  22. $invalidTagIdList = null;
  23. $api->BatchInvite(
  24. array('ZhuShengBen', 'abelzhu', 'userid_for_invite_test'), array(1, 2, 111), array(1, 222),
  25. $invalidUserIdList, $invalidPartyIdList, $invalidTagIdList);
  26. var_dump($invalidUserIdList);
  27. var_dump($invalidPartyIdList);
  28. var_dump($invalidTagIdList);
  29. } catch (Exception $e) {
  30. echo $e->getMessage() . "\n";
  31. }