PHP API Vezzi Doc



Gathering Information

Other "Official" Sources

Different Sources

Count  Source man/doc/quest/ex Date Title Test Program My Comments
1 www.php.net manual 99/99/99 $_GET v01test01processform - used for URLs like this: http://example.com/?name=Hannes
- Veezi uses HTTP Record Headers, not the Question Mark displayed in the URL of a browser.
 
2 tutorialsPoint documentation Date PHP - GET & POST Methods   Uses Question Mark, not good enough for Veezi
 
3 www.php.net manual Date getallheaders   I think this sees headers on the local server, "GoDaddy's prupis.info", not "api.us.veezi.com"
 
4 www.php.net manual Date $_REQUEST   This works for the local server, not the Veezi server.
 
5 www.php.net manual Date curl_setopt v01test02processform and    
v01test03processform
This seems to add the "v01test01processform.php?name=" to the URL on the browser as:
   http://www.prupis.info/classphp/php2022/ch08/v01test01processform.php?name=
 
6 reqbin.com question Date How do I get an XML from the server? [PHP Code]   Instant Sample, may help in adding the header "Action" and value "application/xml".
WYSWIG on left and result panel on the right, I can't see what the URL displays.
 
7 AllPHPTricks tutorial Date Create and Consume Simple REST API in PHP   Simple REST means using the Question Mark.
Not good enough for Veezi APIs.
 
8 codeGrepper example Date "php api call with headers" Code Answer   Example displays the Question Mark,
But I'll still look at it.
 
9 www.php.net manual Date http_get v01test04processform Example displays the Question Mark in the URL on the browser,
But I'll still look at it.
 
10 www.simlilearn.net software development 07/17/21 Header in PHP: The Ultimate Guide to Header Function   I have to read more before I can comment.
 
11 reqbin.net Example 08/31/21 How do I send an HTTP GET request? [PHP Code] v01test07processform
link to written program
In Headers place the following:
VeeziAccessToken: 19m3sgh48vcax1p9mmhp4dd87w
Accept: application/xml
When done within REQBIN i get back Status: 200 (OK)
This is close, but no cigar. I can't get it to work in my php program.
12 w3schools Try It Editor Current the w3schools "Try It Editor"   Copy and Paste PHP code from Notepad to the left panel,
Click the "Run" button, the results are displayed in the right panel
When I copy and paste "v01test07processform.php" code into the left panel
The right panel displays: bool(false)
I need to figure why, and what variable or method is displaying that.

Google Searches

Count  Google Search: Title My Comments
1 Google Search: php get HTTP request header parameters comment
2 Google Search: php get HTTP Action header parameters comment
3 Google Search: php get HTTP Action application/xml examples comment
4 Google Search: php GET xml application/xml comment
5 Google Search: REST API GET Example PHP comment
6 Google Search: rest api in php w3schools comment
7 Google Search: how to use an existing api in php comment
8 Google Search: how to use an existing api in php with Action set to application/xml comment
9 Google Search: get url parameter in php comment
10 Google Search: php get url redirect comment

YouTube Videos

YouTube Search

YouTube Videos

Count Length Date Title My Comments
1 09:20 01/19/15 Using REST APIs in a web application | Quick PHP Tutorial using Simple REST GET/POST Requests, Simple means using the Question Mark in the URL.
2 19:21 01/25/21 PHP: How to Get Data from a Request | PHP get and post form methods Using XAMPP, meaning localhost, not Veezi's URL, it's an example of a Simple REST GET/POST Requests

HTTP Header Parameters

HTTP Header Parameters
Count Header Value
 1  VeeziAccessToken 19m3sgh48vcax1p9mmhp4dd87w
 2  Accept application/xml

Veezi Endpoint Information

  1. https://api.us.veezi.com/v1/session
  2. https://api.us.veezi.com/v1/session{id}
  3. https://api.us.veezi.com/v1/websession
  4. https://api.us.veezi.com/v1/film
  5. https://api.us.veezi.com/v1/film/{id}
  6. https://api.us.veezi.com/v1/filmpackage
  7. https://api.us.veezi.com/v1/filmpackage{id}
  8. https://api.us.veezi.com/v1/screen
  9. https://api.us.veezi.com/v1/screen{id}
  10. https://api.us.veezi.com/v1/site
  11. https://api.us.veezi.com/v1/attribute
  12. https://api.us.veezi.com/v1/attribute{id}

Testing Programs

Count Form Program ProcessForm Program View Written Program Reserve
1 v01test01.php v01test01processform.php View Written Program Reserve
2 v01test02.php v01test02processform.php View Written Program Reserve
3 v01test03.php v01test03processform.php View Written Program Reserve
4 v01test04.php v01test04processform.php View Written Program Reserve
5 v01test05.php v01test05processform.php View Written Program Reserve
6 v01test06.php v01test06processform.php View Written Program Reserve
7 v01test07.php v01test07processform.php View Written Program Reserve

v01test01processform.php

$url = "https://api.us.veezi.com/v1/film";
header("Location: $url");
header("VeeziAccessToken: 19m3sgh48vcax1p9mmhp4dd87w");
header("Accept: application/xml");

  echo "(html)
        (head)(title)Customer Address(/title)(/head)
        (body)(h4)v01test01processform.php(/h4)";

  foreach ($_GET as $field => $value)
  {
     echo "$field = $value(br)";
  }

echo "End of v01test01processform program";

v01test02processform.php

$url = "https://api.us.veezi.com/v1/film";

$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$headers = array(
   "VeeziAccessToken: 19m3sgh48vcax1p9mmhp4dd87w",
   "Accept: application/xml",
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
//for debug only!
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);

$resp = curl_exec($curl);
curl_close($curl);
var_dump($resp);

echo "End v01test02processform program";

v01test03processform.php

$url = 'https://api.us.veezi.com';
$collection_name = '/v1/film';
$request_url = $url . '/' . $collection_name;
$curl = curl_init($request_url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
  'X-RapidAPI-Host: VeeziAccessToken',
  'X-RapidAPI-Key: 19m3sgh48vcax1p9mmhp4dd87w',
  'Content-Type: application/json'
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response . PHP_EOL;

echo "End v01test02processform program";

v01test04processform.php

$response = http_get("https://api.us.veezi.com/v1/film", array("timeout"=>1), $info);
print_r($info);

echo "End v01test04processform program";

v01test05processform.php

$options = array(
  'http'=>array(
    'method'=>"GET",
    'header'=>"VeeziAccessToken: 19m3sgh48vcax1p9mmhp4dd87w" .
              "Accept: application/xml"
  )
);
$context=stream_context_create($options);
$data=file_get_contents('https://api.us.veezi.com/v1/film',false,$context);

v01test06processform.php

$opts = array(
  'http'=>array(
    'method'=>"GET",
    'header'=>"VeeziAccessToken: 19m3sgh48vcax1p9mmhp4dd87w" .
              "Accept: application/xml"
  )
);
$context=stream_context_create($opts);

/* Sends an http request to www.example.com
   with additional headers shown above */
$fp=file_get_contents('https://api.us.veezi.com/v1/film', '19m3sgh48vcax1p9mmhp4dd87w', false, $context);
fpassthru($fp);
fclose($fp);

v01test07processform.php

$url = "https://api.us.veezi.com/v1/film";

$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$headers = array(
   "VeeziAccessToken: 19m3sgh48vcax1p9mmhp4dd87w",
   "Accept: application/xml",
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
//for debug only!
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);

$resp = curl_exec($curl);
curl_close($curl);
var_dump($resp);


PHP Methods

PHP Methods
Count PHP Method For Simple ? Description W3Schools php.net My Comments
1 $_GET Yes A "Superglobal" PHP Variable which is used to collect form data
after submitting an HTML form with method="get".
$_GET can also collect data sent in the URL.
W3Schools php.net my comments
2 $_POST Yes A "Superglobal" PHP Variable which is used to collect form data
after submitting an HTML form with method="post".
$_POST is also widely used to pass variables.
W3Schools php.net my comments
3 $_REQUEST Yes This is a 'superglobal', or automatic global, variable.
This simply means that it is available in all scopes throughout a script.
The variables in $_REQUEST are provided to the script via the GET, POST, and COOKIE input mechanisms.
W3Schools php.net my comments
4 curl_init()
curl_setopt()
curl_exec()
curl_close()
Yes
Yes
Yes
Yes
Initializes a new session and return a cURL handle for use with the curl_setopt(), curl_exec(), and curl_close() functions.
Set an option for a cURL transfer
Perform a cURL session
Close a cURL session
W3Schools
W3Schools
W3Schools
W3Schools
php.net
php.net
php.net
php.net
my comments
5 header() Yes ? header() function is used to send a raw HTTP header.
header() must be called before any actual output is sent,
either by normal HTML tags, blank lines in a file, or from PHP.
Note: using this setup still places a ? at the end of my server's url in the browser.
W3Schools php.net my comments
6 getallheaders() Yes ? Fetch all HTTP request headers
This function is an alias for apache_request_headers().
Please read the apache_request_headers() documentation for more information on how this function works.
    Fetches all HTTP request headers from the current request. Works in the Apache, FastCGI, CLI, and FPM webservers.
See also apache_response_headers() - Fetch all HTTP response headers.
W3Schools php.net my comments
7 stream_context_create() ? Creates and returns a stream context with any options supplied in options preset.
Return Values: A stream context resource.
W3Schools php.net my comments
8 SimpleXMLElement() works Represents an element in an XML document.
Google Search: php simplexmlelement
PHP SimpleXML Functions The SimpleXMLElement class
Basic SimpleXML usage
my comments


Reserve