newbie help for php api, sandbox
I'm a newbie at both api and sandbox usage, but am now in a position where the CMS and other PHP scripts we've written require me to know how to work with these things.
Since I'm a newbie, the API documentation isn't very helpful (I've learned more from osmosis and sample code over the years), and likewise working with the sandbox would create some of the same challenges.
For the sandbox, do you have to sign up for a separate account? Is it a separate paid account, or can I siphon the bandwidth off my regular vzaar account? the only sandbox I've worked in is PayPal's and suffice it to say it makes my head spin.
For the API, I was wondering first if there is anyone in the vzaar community that could help me develop some basic CMS functionality (on a fee basis of course) so my CMS has the ability to upload videos to vzaar. I'm also not sure if there's a way to organize the videos that are uploaded for playlist purposes across several websites (or is this done in my own database?).
I'm sure 90% of this stuff is easy once you get the hang of it, but like I said I'm a 'sample code' type person & there's no such thing that I can find right now, so anything anybody can do to help me would be much appreciated.
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Evi on 23 Mar, 2010 08:41 PM
Hello Shovi,
I will be assisting you with everything related to API on Vzzar side so you can address your questions to me.
Fro the sandbox you need to have a separate account on http://sandbox.vzaar.com/ Basically it's only difference, the API will work as it is, you can see samples posted for PHP at http://code.google.com/p/vzaar/ there are few tests made for sandbox as well.
With playlists, yes, you need t have it implemented in your own CMS.
Using API is very simple, you will find it once you will browse through it's PHP implementation, also have a look at samples provided there, each one of them represents dedicated APPI feature.
In any case, if you have questions, please let me know.
Cheers,
Evi
3 Posted by shovi on 23 Mar, 2010 08:47 PM
Hi Evi,
I've been reading through things as the day's gone by, and am starting to get the hang of it.
I'm using my live account, since at the moment I only have a couple of videos that nobody views so I'm not concerned with using up my bandwidth.
So I noticed where I have to input my account name & API token that I generated from my account, but am stuck here (and I changed $useSandbox to false).
I get an empty array when I try to run this script on a web page: var_dump(Vzaar::getVideoList('shovi', true)); All my videos are private, I noticed that the "true" parameter will force the private videos to list too. What am I doing wrong? If I make a video public and then leave out the 'true' parameter I can get that video to return in the array.
Also, what am I supposed to put for my endpoint settings on my vzaar account?
thanks for your help!
Support Staff 4 Posted by Evi on 23 Mar, 2010 08:56 PM
There is no need to put anything for end-point field, for API you don't need it.
Let me ask you what PHP API version you have there? Is that the one from SVN? SVN and zip file v.1.5 are fine, those are the recent ones.
Another thing, please make sure your PHP can do json_encode/json_decode, i can't tell you exactly the version of PHP, but i recall there was some issue with json absence. Also i seen some had no CURL available within PHP, so jus tmake sure that json and curl are on board.
Easiest way to check if your API connectivity is fine is to execute whoAmI method which will return your username.
Please let me know if it works.
5 Posted by shovi on 23 Mar, 2010 09:03 PM
yes, v1.5. I downloaded it this morning.
yes on cURL.
not sure on json_encode/decode, I'll check, but whoAmI() returns a blank page. thoughts?
6 Posted by shovi on 23 Mar, 2010 09:06 PM
quick update: json support is enabled (based on output from phpinfo(); )
Support Staff 7 Posted by Evi on 23 Mar, 2010 09:39 PM
Did you tried it like this?:
Vzaar::$token = 'GETUGkPFNC84JlzXkOMSYQFTOCAixOIiroh7oUj3kk';
Vzaar::$secret = 'skitsanos';
Vzaar::$useSandbox = false;
8 Posted by shovi on 23 Mar, 2010 09:48 PM
<> this token/secret thing is annoying, I had them reversed.
thanks. so now I can see my user name when I do whoAmI() but am continuing to see this one error when trying to run
var_dump(Vzaar::getVideoList('shovi', true));
Fatal error: Cannot access empty property in /[xxxxx]/video/VideoList.php on line 46
funny; I was at this point before, then switched the token/secret and got an empty array, which I saw on another thread so I thought that's where the problem was.
thanks again for your help.
Support Staff 9 Posted by Evi on 23 Mar, 2010 09:53 PM
so you still have some error there at this moment?
10 Posted by shovi on 23 Mar, 2010 09:59 PM
yes, that Fatal error won't go away for getVideoList() or searchVideoList().
I made one of my videos public and got the same error when I removed the 'true' parameter, so it didn't have anything to do with the privacy part.
I WAS able to run getVideoDetails() on one of my videos to return an array, so I suspect there's a bug in the VideoList.php file?
Support Staff 11 Posted by Evi on 23 Mar, 2010 10:03 PM
not the bug, but i guess something got changed. i will review it and get back to you.
12 Posted by shovi on 23 Mar, 2010 10:05 PM
thank you; for what it's worth, the test api_videos-list.php throws the same error, but other test files seem to work. Something's amuck :)
ianjsnead resolved this discussion on 31 Mar, 2010 07:18 AM.
Evi re-opened this discussion on 31 Mar, 2010 07:23 AM
Support Staff 13 Posted by Evi on 31 Mar, 2010 09:22 AM
Shovi, could you please refresh your files from SVN and rerun your test to see if there are any changes that solves your problem?
Thanks,
Evi
14 Posted by shovi on 02 Apr, 2010 12:56 PM
awesome, it returns the array of videos now. I don't know if I'll actually use the videoList function since several people's videos are stored on the same account, but now I can start to test out the upload/manage functionality.
thank you again, we can close this.