Example #1
0
 /**
  * Post space
  * https://cybozudev.zendesk.com/hc/ja/articles/202166210#step1
  *
  * @param integer $id
  * @param string  $name
  * @param array   $members
  * @param boolean $isPrivate
  * @param boolean $isGuest
  * @param boolean $fixedMember
  * @return array
  */
 public function post($id, $name, array $members, $isPrivate = false, $isGuest = false, $fixedMember = false)
 {
     $options = ['json' => ['id' => $id, 'name' => $name, 'members' => $members, 'isPrivate' => $isPrivate, 'isGuest' => $isGuest, 'fixedMember' => $fixedMember]];
     return $this->client->post(KintoneApi::generateUrl('template/space.json'), $options)->getBody()->jsonSerialize();
 }
Example #2
0
 /**
  * Post file
  * https://cybozudev.zendesk.com/hc/ja/articles/202350470
  *
  * @param string $filename
  * @return string
  */
 public function file($filename)
 {
     $options = ['multipart' => [['name' => 'file', 'filename' => basename($filename), 'contents' => fopen($filename, 'r')]]];
     return $this->client->post(UserApi::generateUrl('file.json'), $options)->getBody()->jsonSerialize()["fileKey"];
 }
Example #3
0
 /**
  * Post guest users
  * https://cybozudev.zendesk.com/hc/ja/articles/202931674#step1
  *
  * @param array $guests
  * @return array
  */
 public function post(array $guests)
 {
     $options = ['json' => ['guests' => $guests]];
     return $this->client->post(KintoneApi::generateUrl('guests.json'), $options)->getBody()->jsonSerialize();
 }
Example #4
0
 /**
  * Post thread comment
  * https://cybozudev.zendesk.com/hc/ja/articles/209732306
  *
  * @param int $spaceId
  * @param int $threadId
  * @param string $comment
  * @param array $mentions
  * @param array $files
  * @param int $guestSpaceId
  * @return array
  */
 public function comment($spaceId, $threadId, $comment, $mentions = [], $files = [], $guestSpaceId = null)
 {
     $options = ['json' => ['space' => $spaceId, 'thread' => $threadId, 'comment' => ['text' => $comment, 'mentions' => $mentions, 'files' => $files]]];
     return $this->client->post(KintoneApi::generateUrl('space/thread/comment.json', $guestSpaceId), $options)->getBody()->jsonSerialize();
 }
Example #5
0
 /**
  * Post file
  * https://cybozudev.zendesk.com/hc/ja/articles/201941824#step1
  *
  * @param string $filename
  * @param int $guestSpaceId
  * @return string
  */
 public function post($filename, $guestSpaceId = null)
 {
     $options = ['multipart' => [['name' => 'file', 'filename' => basename($filename), 'contents' => fopen($filename, 'r')]]];
     return $this->client->post(KintoneApi::generateUrl('file.json', $guestSpaceId), $options)->getBody()->jsonSerialize()["fileKey"];
 }
Example #6
0
 /**
  * Post form fields to preview app
  * https://cybozudev.zendesk.com/hc/ja/articles/204529724#anchor_changeform_addfields
  *
  * @param integer $id
  * @param array   $fields
  * @param integer $guestSpaceId
  * @param integer $revision
  * @return array
  */
 public function postFields($id, array $fields, $guestSpaceId = null, $revision = -1)
 {
     $options = ['json' => ['app' => $id, 'properties' => $fields, 'revision' => $revision]];
     return $this->client->post(KintoneApi::generateUrl('preview/app/form/fields.json', $guestSpaceId), $options)->getBody()->jsonSerialize();
 }
Example #7
0
 /**
  * Post bulkRequest
  * https://cybozudev.zendesk.com/hc/ja/articles/201941814
  *
  * @param array $requests
  * @param integer $guestSpaceId
  * @return array
  */
 public function postBulkRequest(array $requests, $guestSpaceId = null)
 {
     $options = ['json' => ['requests' => $requests]];
     return $this->client->post(KintoneApi::generateUrl('bulkRequest.json', $guestSpaceId), $options)->getBody()->jsonSerialize()['results'];
 }
Example #8
0
 /**
  * Post records
  * https://cybozudev.zendesk.com/hc/ja/articles/202166160#step2
  *
  * @param integer $appId
  * @param array $records
  * @param integer $guestSpaceId
  * @return array
  */
 public function post($appId, array $records, $guestSpaceId = null)
 {
     $options = ['json' => ['app' => $appId, 'records' => $records]];
     return $this->client->post(KintoneApi::generateUrl('records.json', $guestSpaceId), $options)->getBody()->jsonSerialize();
 }
Example #9
0
 /**
  * Post record comment
  * https://cybozudev.zendesk.com/hc/ja/articles/209758903
  *
  * @param integer $appId
  * @param integer $record
  * @param string  $comment
  * @param array   $mentions
  * @param integer $guestSpaceId
  * @return array
  */
 public function post($appId, $record, $comment, $mentions = [], $guestSpaceId = null)
 {
     $options = ['json' => ['app' => $appId, 'record' => $record, 'comment' => ['text' => $comment, 'mentions' => $mentions]]];
     return $this->client->post(KintoneApi::generateUrl('record/comment.json', $guestSpaceId), $options)->getBody()->jsonSerialize();
 }