endpoint = 'https://api.srgssr.ch/videometadata/v2/'; parent::__construct(); } public function mediaComposition(string $videoId) { $response = Http::withHeaders($this->headers)->withQueryParameters([ 'bu' => 'srf', ])->get($this->endpoint.$videoId.'/mediaComposition'); if($response->successful()){ return $response->json(); } return false; } public function savemediaComposition(string $videoId) { $mediaComposition = $this->mediaComposition($videoId); if($mediaComposition){ $episode = new EpisodeModel; $episode->urn = $mediaComposition['episode']['id']; } } }