Esempio n. 1
0
 /**
  * Get users
  * https://cybozudev.zendesk.com/hc/ja/articles/202363040#step2
  *
  * @param array $ids
  * @param array $codes
  * @param integer $offset
  * @param integer $limit
  * @return array
  */
 public function get(array $ids = [], array $codes = [], $offset = 0, $limit = self::MAX_GET_USERS)
 {
     $options = ['json' => ['ids' => !empty($ids) ? $ids : [], 'codes' => !empty($codes) ? $codes : []]];
     $options['json']['size'] = $limit;
     $options['json']['offset'] = $offset;
     return $this->client->get(UserApi::generateUrl('users.json'), $options)->getBody()->jsonSerialize()['users'];
 }
Esempio n. 2
0
 /**
  * Get post csv result
  * https://cybozudev.zendesk.com/hc/ja/articles/202361320
  *
  * @param int $id
  * @return array
  */
 public function result($id)
 {
     $options = ['query' => ['id' => $id]];
     return $this->client->get(UserApi::generateUrl('csv/result.json'), $options)->getBody()->jsonSerialize();
 }
Esempio n. 3
0
 public function testGenerateUrl()
 {
     self::assertEquals('/v1/users.json', UserApi::generateUrl('users.json'));
 }
Esempio n. 4
0
 /**
  * Get organizations and titles of user
  * https://cybozudev.zendesk.com/hc/ja/articles/202124774#step2
  *
  * @param string $code
  * @return array
  */
 public function get($code)
 {
     $options = ['json' => ['code' => $code]];
     return $this->client->get(UserApi::generateUrl('user/organizations.json'), $options)->getBody()->jsonSerialize()['organizationTitles'];
 }
Esempio n. 5
0
 /**
  * Get users and titles of organization
  * https://cybozudev.zendesk.com/hc/ja/articles/202124774#step2
  *
  * @param string $code
  * @return array
  */
 public function get($code, $offset = 0, $limit = self::MAX_GET_USERS)
 {
     $options = ['json' => ['code' => $code, 'offset' => $offset, 'size' => $limit]];
     return $this->client->get(UserApi::generateUrl('organization/users.json'), $options)->getBody()->jsonSerialize()['userTitles'];
 }