Wordpress & Rest API

Is it possible to use the REST API inside if wordpress. I’ve installed the plugin and got it working with that, but I want to be able to send more customised push notifications; ive tried to use the -

webpushr(‘fetch_id’,function (sid) {

        //save id to database

        console.log('webpushr subscriber id: ' + sid);

    });

-function but this dosent work and just says that the function dosnt exist

Hi,

This function must call after

webpushr(‘setup’,{‘key’:YOUR-KEY });

function. Alternatively you can use this function inside _webpushrScriptReady function like below

<script>
  function _webpushrScriptReady(){
    webpushr('fetch_id',function (sid) { 
        //save id to database
        console.log('webpushr subscriber id: ' + sid)
    });
}</script>