/** * Export all information about devices in a CSV format for your application. * * Application auth key must be set. * * @return array */ public function csvExport() { return $this->api->request('POST', '/players/csv_export', ['headers' => ['Authorization' => 'Basic ' . $this->api->getConfig()->getApplicationAuthKey()], 'json' => ['app_id' => $this->api->getConfig()->getApplicationId()]]); }
/** * Increment the device's total session length. * * @param string $id Device ID * @param array $data Device data * * @return array */ public function onFocus($id, array $data) { $data = (new OptionsResolver())->setDefault('state', 'ping')->setRequired('active_time')->setAllowedTypes('active_time', 'int')->resolve($data); return $this->api->request('PUT', '/players/' . $id . '/on_focus', ['headers' => ['Content-Type' => 'application/json'], 'json' => $data]); }
/** * Cancel notification. * * Application authentication key and ID must be set. * * @param string $id Notification ID * * @return array */ public function cancel($id) { return $this->api->request('DELETE', '/notifications/' . $id, ['headers' => ['Authorization' => 'Basic ' . $this->api->getConfig()->getApplicationAuthKey()], 'json' => ['app_id' => $this->api->getConfig()->getApplicationId()]]); }
/** * Update application with provided data. * * User authentication key must be set. * * @param string $id ID of your application * @param array $data New application data * * @return \GuzzleHttp\Message\Response */ public function update($id, array $data) { $data = $this->resolve($data); return $this->api->request('PUT', '/apps/' . $id, ['headers' => ['Authorization' => 'Basic ' . $this->api->getConfig()->getUserAuthKey(), 'Content-Type' => 'application/json'], 'json' => $data]); }