JWT PHP Sample Code
AnsweredLooking for some PHP sample code to do the following:
- JWT Auth
- Directory listing
- Uploading file/folder
I've got so far as generated the RSA keypair and downloaded the JSON file.
Thanks!
-
Hi ,
Thanks for posting to our forums! Box doesn't have an officially supported PHP SDK, but you might be able to find good examples on our community supported projects page:
https://developer.box.com/docs/community-supported-projects
Looks like there's a few PHP projects there! Hope that helps!
Thanks,
Jason
-
Yes, you can find them in
https://github.com/maengkom/boxapi
It has JWT PHP functions in BoxAppUser.php
composer require maengkom/boxapi
$config = array(
'au_client_id' => 'client_id',
'au_client_secret' => 'client_secret',
'redirect_uri' => '',
'enterprise_id' => 'enterprise_id',
'app_user_name' => 'app_user_name',
'app_user_id' => 'app_user_name',
'public_key_id' => 'public_key_id',
'passphrase' => 'passphrase',
'expiration' => 60,
'private_key_file' => 'private.pem',
); $box = new BoxAppUser($config); //print_r($box); $info = $box->getFolderInfo('0'); // Get TOP folder information print_r($info);I hope this info helps someone.
Please sign in to leave a comment.
Comments
5 comments