Thank you for the two examples. The Guzzel example verified I was on the right track.
I Needed to add some extra code to the .htaccess file to get the Header locations to work on apache.
Now when I make a GET request I get a response, but I don’t seem to get the correct response. For example, when I request the media of the library. I use the /api/library to return all of the media. I have, for testing, a single jpg file in the media library.
Code:
$client = new Client();
$request = $client->get('https://DOMAIN.com/xibo18alpha/web/api/library',
['Authorization'=>['access_token'=>'Bearer YbtJk476DgDHQ6TPBSfzIAon7NVmswNaXBUSHeIS']]
);
var_dump of response:
object(Guzzle\Http\Message\Response)[33]
protected 'body' =>
object(Guzzle\Http\EntityBody)[32]
protected 'contentEncoding' => boolean false
protected 'rewindFunction' => null
protected 'stream' => resource(60, stream)
protected 'size' => null
protected 'cache' =>
array (size=9)
'wrapper_type' => string 'PHP' (length=3)
'stream_type' => string 'TEMP' (length=4)
'mode' => string 'w+b' (length=3)
'unread_bytes' => int 0
'seekable' => boolean true
'uri' => string 'php://temp' (length=10)
'is_local' => boolean true
'is_readable' => boolean true
'is_writable' => boolean true
protected 'customData' =>
array (size=1)
'default' => boolean true
protected 'reasonPhrase' => string 'OK' (length=2)
protected 'statusCode' => int 200
protected 'info' =>
array (size=26)
'url' => string 'https://DOMAIN.com/xibo18alpha/web/api/library' (length=51)
'content_type' => string 'application/json' (length=16)
'http_code' => int 200
'header_size' => int 321
'request_size' => int 181
'filetime' => int -1
'ssl_verify_result' => int 0
'redirect_count' => int 0
'total_time' => float 0.578
'namelookup_time' => float 0
'connect_time' => float 0
'pretransfer_time' => float 0.063
'size_upload' => float 0
'size_download' => float 1031
'speed_download' => float 1783
'speed_upload' => float 0
'download_content_length' => float 1031
'upload_content_length' => float 0
'starttransfer_time' => float 0.578
'redirect_time' => float 0
'redirect_url' => string '' (length=0)
'primary_ip' => string '127.0.0.1' (length=9)
'certinfo' =>
array (size=0)
empty
'primary_port' => int 443
'local_ip' => string '127.0.0.1' (length=9)
'local_port' => int 57480
protected 'effectiveUrl' => string 'https://DOMAIN.com/xibo18alpha/web/api/library' (length=51)
protected 'headers' =>
object(Guzzle\Http\Message\Header\HeaderCollection)[36]
protected 'headers' =>
array (size=8)
'date' =>
object(Guzzle\Http\Message\Header)[37]
...
'server' =>
object(Guzzle\Http\Message\Header)[38]
...
'vary' =>
object(Guzzle\Http\Message\Header)[39]
...
'x-powered-by' =>
object(Guzzle\Http\Message\Header)[40]
...
'x-total-count' =>
object(Guzzle\Http\Message\Header)[41]
...
'link' =>
object(Guzzle\Http\Message\Header\Link)[42]
...
'content-length' =>
object(Guzzle\Http\Message\Header)[43]
...
'content-type' =>
object(Guzzle\Http\Message\Header)[44]
...
protected 'headerFactory' =>
object(Guzzle\Http\Message\Header\HeaderFactory)[35]
protected 'mapping' =>
array (size=2)
'cache-control' => string 'Guzzle\Http\Message\Header\CacheControl' (length=39)
'link' => string 'Guzzle\Http\Message\Header\Link' (length=31)
protected 'params' =>
object(Guzzle\Common\Collection)[34]
protected 'data' =>
array (size=0)
empty
protected 'protocol' => string 'HTTP' (length=4)
protected 'protocolVersion' => string '1.1' (length=3)
CMS Log:
logId,runNo,logDate,channel,page,function,message,display.display,type
49,29f83aa,"2015-09-23 22:06:34",API,/library,GET,"Loading 1. All Objects = 0",,DEBUG
50,e4b0b97,"2015-09-23 22:07:10",API,/library,GET,"Loading 1. All Objects = 0",,DEBUG
51,2471c8c,"2015-09-23 22:08:14",API,/library,GET,"Loading 1. All Objects = 0",,DEBUG
52,e99e694,"2015-09-23 22:09:27",API,/library,GET,"Loading 1. All Objects = 0",,DEBUG
53,720f2d9,"2015-09-23 22:10:13",API,/library,GET,"Loading 1. All Objects = 0",,DEBUG
54,a32fa60,"2015-09-23 22:11:08",API,/library,GET,"Loading 1. All Objects = 0",,DEBUG
55,0b54237,"2015-09-23 22:11:28",API,/library,GET,"Loading 1. All Objects = 0",,DEBUG
56,b9f5765,"2015-09-23 22:12:43",WEB,/log,GET,"Request to redirect to login. Ajax = 1",,DEBUG
57,511025e,"2015-09-23 22:12:50",WEB,/log,GET,"Request to redirect to login. Ajax = 1",,DEBUG
58,25c509c,"2015-09-23 22:12:53",WEB,/log/view,GET,"Request to redirect to login. Ajax = 0",,DEBUG
59,e6a0923,"2015-09-23 22:12:56",WEB,/login,POST,"Login with username xibo_admin",,DEBUG
60,e6a0923,"2015-09-23 22:12:56",WEB,/login,POST,"Password checked out OK",,DEBUG
61,e6a0923,"2015-09-23 22:12:56",WEB,/login,POST,"xibo_admin user logged in.",,INFO
62,e6a0923,"2015-09-23 22:12:56",WEB,/login,POST,"Redirect to /log/view",,DEBUG
63,2a8c5cb,"2015-09-23 22:13:00",WEB,/login,POST,"Login with username xibo_admin",,DEBUG
64,2a8c5cb,"2015-09-23 22:13:00",WEB,/login,POST,"Password checked out OK",,DEBUG
65,2a8c5cb,"2015-09-23 22:13:00",WEB,/login,POST,"xibo_admin user logged in.",,INFO
66,2a8c5cb,"2015-09-23 22:13:00",WEB,/login,POST,"Redirect to /xibo18alpha/web/",,DEBUG
67,5132cdc,"2015-09-23 22:13:01",WEB,/,GET,"Loading 1. All Objects = 0",,DEBUG
68,5132cdc,"2015-09-23 22:13:01",WEB,/,GET,"Showing the homepage: 29",,DEBUG
69,bf7e692,"2015-09-23 22:13:01",WEB,/dashboard/status,GET,"Loading 1. All Objects = 0",,DEBUG
70,c2794c5,"2015-09-23 22:13:06",WEB,/log/view,GET,"Loading 1. All Objects = 0",,DEBUG
71,6b70257,"2015-09-23 22:13:07",WEB,/log,GET,"Loading 1. All Objects = 0",,DEBUG
72,30026f5,"2015-09-23 22:13:41",API,/library,GET,"Loading 1. All Objects = 0",,DEBUG
73,9cbb881,"2015-09-23 22:13:44",WEB,/log/view,GET,"Loading 1. All Objects = 0",,DEBUG
74,6b6f55a,"2015-09-23 22:13:45",WEB,/log,GET,"Loading 1. All Objects = 0",,DEBUG
75,9e23dce,"2015-09-23 22:14:01",WEB,/log,GET,"Loading 1. All Objects = 0",,DEBUG
76,931b70e,"2015-09-23 22:14:43",WEB,/fault/view,GET,"Loading 1. All Objects = 0",,DEBUG
77,defbe0b,"2015-09-23 22:14:47",WEB,/fault/collect,GET,"Loading 1. All Objects = 0",,DEBUG
78,65b7725,"2015-09-23 22:15:16",WEB,/fault/collect,GET,"Loading 1. All Objects = 0",,DEBUG