Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Leff7's avatar
Level 4

PHP - making an api call to telestream with php

I would like to do an api call to telestream cloud api by using php. I am not sure how to do this, they only have examples for Python, Ruby and GO. Not sure how to set this up with PHP. I have tried to do this to get the videos from my factory that I have on their telestream cloud:

      $service_url = 'http://api-eu-west.cloud.telestream.net/videos.json';
      $curl = curl_init($service_url);
      $curl_post_data = [
              'access_key' => 'my-access-key',
              'secret_key' => 'my-secret-key',
              'api_host' => 'api.cloud.telestream.net',
              'api_port' => '443',
              'factory_id' => 'my_factory_id',
      ];
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($curl, CURLOPT_POST, true);
      curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data);
      $curl_response = curl_exec($curl);
      if ($curl_response === false) {
          $info = curl_getinfo($curl);
          curl_close($curl);
      }
      curl_close($curl);
      $decoded = json_decode($curl_response);

But, that doesn't work, if I do:

dd(curl_getinfo($curl));

I get the error:

curl_getinfo(): supplied resource is not a valid cURL handle resource

Is there any example of how can I make this call with PHP?

0 likes
0 replies

Please or to participate in this conversation.