batch.php 578 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. $app = require __DIR__ . '/app.php';
  3. /** @var \WeWork\Api\Batch $batch */
  4. $batch = $app->get('batch');
  5. try {
  6. $batch->invite([
  7. 'user' => ['UserID1', 'UserID2', 'UserID3']
  8. ]);
  9. } catch (Exception $e) {
  10. }
  11. try {
  12. $batch->syncUser(['media_id' => 'xxxxxx']);
  13. } catch (Exception $e) {
  14. }
  15. try {
  16. $batch->replaceUser(['media_id' => 'xxxxxx']);
  17. } catch (Exception $e) {
  18. }
  19. try {
  20. $batch->replaceParty(['media_id' => 'xxxxxx']);
  21. } catch (Exception $e) {
  22. }
  23. try {
  24. $batch->getResult('JOBID');
  25. } catch (Exception $e) {
  26. }