Question: I'm creating a custom plugin for WordPress and I'm trying to execute `javascript` file only once right after plugin activations. 

I'm using `register_activation_hook()` and `wp_enqueue_script()` to enqueue file only once when the plugin is activated. 

There are no errors in the code since the `javascript` code works well if it is called outside the `register_activation_hook()`.

This is what I've tried so far:

```
register_activation_hook( __FILE__, 'full_install' );
function full_install() {
    function rest_api() {
        wp_enqueue_script('activation_data_api', plugins_url('assets/js/activation_data_api.js', __FILE__));
    }
    add_action( 'admin_enqueue_scripts', 'rest_api' );
}

```

In the end, the plugin needs to execute `javascript` file only once right after activation.

Answer: 
Depending upon the type of sharepoint api (Object model/csom/jsom) you are using you would form an appropriate caml query and pass it to sharepoint to get the results.
You did not mention a SharePoint version, so I'll assume it is not SharePoint Online using the Modern UI.

I won't do your homework for you... but here's a hint: Web part page and Filter web parts.