Title: Developer API: Hooks vs. JWT
Last modified: March 18, 2021

---

# Developer API: Hooks vs. JWT

 *  Resolved [neueweide](https://wordpress.org/support/users/neueweide/)
 * (@neueweide)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/developer-api-hooks-vs-jwt/)
 * Hi i want to write a PHP code wich can produce zip files from folders and save
   them to the upload folder…
    my final thought is to create a automatic process
   in wich a admin can define a filebird folder wich than will be zipped automatically
   and where a generated URL will be automatically postet on the website…
 * I only found this site for API purposes: [https://ninjateam.gitbook.io/filebird/api](https://ninjateam.gitbook.io/filebird/api)
   
   Are there any easy to use PHP-Hooks for such requests? Or are you only offering
   the JWT-API mentioned above? There is no explanation on your API Site how to 
   implement this in a code eviroment… What do you mean by Bearer Token?

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Thread Starter [neueweide](https://wordpress.org/support/users/neueweide/)
 * (@neueweide)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/developer-api-hooks-vs-jwt/#post-14203351)
 * I found this here: [https://stackoverflow.com/questions/45409522/file-get-contents-not-working-with-bearer](https://stackoverflow.com/questions/45409522/file-get-contents-not-working-with-bearer)
 * But where do i get the Bearer Token?
    And do you know if this way does work?
 *  Thread Starter [neueweide](https://wordpress.org/support/users/neueweide/)
 * (@neueweide)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/developer-api-hooks-vs-jwt/#post-14203436)
 * Ah ok i found a code for the api, here for everyone who may also want to proceed
   similiar stuff like me 🙂
 * With the PHP library cURL (this is installed as standard in many PHP installs)!
 * in the above code there are three variables you have to change yourself:
    DOMAIN
   = Your Domain the WordPress website is running NUMBER = Folder number by filebird
   TOKEN = You can create one in the Admin (Settings/FileBird/API)
 *     ```
       $url = "DOMAIN/wp-json/filebird/public/v1/attachment-id/?folder_id=NUMBER";
       $token = "TOKEN";
   
       //setup the request, you can also use CURLOPT_URL
       $ch = curl_init($url);
   
       // Returns the data/output as a string instead of raw data
       curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
   
       //Set your auth headers
       curl_setopt($ch, CURLOPT_HTTPHEADER, array(
       	'Content-Type: application/json',
       	'Authorization: Bearer ' . $token
       ));
   
       // get stringified data/output. See CURLOPT_RETURNTRANSFER
       $data = curl_exec($ch);
   
       // get info about the request
       $info = curl_getinfo($ch);
       // close curl resource to free up system resources
       curl_close($ch);
   
       echo $data;
       ```
   
 * But you could answer on my first question anywhere 🙂
    Are there a view Hooks
   in PHP?
    -  This reply was modified 5 years, 2 months ago by [neueweide](https://wordpress.org/support/users/neueweide/).
 *  Plugin Support [Bruce](https://wordpress.org/support/users/ninjateamwp/)
 * (@ninjateamwp)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/developer-api-hooks-vs-jwt/#post-14203789)
 * Hi [@neueweide](https://wordpress.org/support/users/neueweide/) ,
 * I am glad to know you figured some of these queries out now, may I know which
   specific question is there that you need an answer to right now, please?
 * Kind regards,
    -Bruce-
 *  Plugin Support [Bruce](https://wordpress.org/support/users/ninjateamwp/)
 * (@ninjateamwp)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/developer-api-hooks-vs-jwt/#post-14205157)
 * Hi [@neueweide](https://wordpress.org/support/users/neueweide/) ,
 * Can you explain your request better, please. What do you mean by this hook?
    
   [https://drive.google.com/file/d/1IeTucUWcjYsoIV86hWEtKv9pNezHMQ0g/view?usp=drivesdk](https://drive.google.com/file/d/1IeTucUWcjYsoIV86hWEtKv9pNezHMQ0g/view?usp=drivesdk)
 * Thank you!
 * Kind regards,
    -Bruce-
 *  Thread Starter [neueweide](https://wordpress.org/support/users/neueweide/)
 * (@neueweide)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/developer-api-hooks-vs-jwt/#post-14219112)
 * I mean,
 * my solution queries your JSON-Api (=URL-Request) with PHP techniques.
 * But in general WordPress has a System for embedding shared functionality by Plugin
   Developer through so called “Hooks”. You can get information about this concept
   here:
    [https://developer.wordpress.org/plugins/hooks/](https://developer.wordpress.org/plugins/hooks/)
 * In your case it would be the “Custom Hooks” wich could give programatically access
   for other developer like me to your Plugin:
    [https://developer.wordpress.org/plugins/hooks/custom-hooks/](https://developer.wordpress.org/plugins/hooks/custom-hooks/)
 * best regards
    robert
 *  Plugin Support [Bruce](https://wordpress.org/support/users/ninjateamwp/)
 * (@ninjateamwp)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/developer-api-hooks-vs-jwt/#post-14224635)
 * Hi [@neueweide](https://wordpress.org/support/users/neueweide/) ,
 * Maybe what you are describing is possible! But we do not understand your processing
   flow properly.
 * Can you give us access to the UI you have made?
 * Also, since this is not a bug support but a custom work discussion, you could
   continue this case with our team at:
    [ninjateam.wp@gmail.com](https://wordpress.org/support/topic/developer-api-hooks-vs-jwt/ninjateam.wp@gmail.com?output_format=md)
 * Thank you!
 * Kind regards,
    -Bruce-
 *  Thread Starter [neueweide](https://wordpress.org/support/users/neueweide/)
 * (@neueweide)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/developer-api-hooks-vs-jwt/#post-14229436)
 * Hi Bruce,
 * i said i plan to do and there is no code yet i could show you… i’m still in concept
   thoughts haha 🙂
 * you can close this topic 🙂
    best robert

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Developer API: Hooks vs. JWT’ is closed to new replies.

 * ![](https://ps.w.org/filebird/assets/icon-128x128.gif?rev=2299145)
 * [FileBird - WordPress Media Library Folders & File Manager](https://wordpress.org/plugins/filebird/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/filebird/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/filebird/)
 * [Active Topics](https://wordpress.org/support/plugin/filebird/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/filebird/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/filebird/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [neueweide](https://wordpress.org/support/users/neueweide/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/developer-api-hooks-vs-jwt/#post-14229436)
 * Status: resolved