Quantcast
Channel: Ignite Realtime : All Content - Openfire Plugins
Viewing all articles
Browse latest Browse all 488

REST Api Create user and modify roster example needed please

$
0
0
I found the following code online which works great but it is only retrieving information on the user. RedEyes, or anyone else, can you show me what the code would look like by doing the following 2 things: 1) Create a user.  2) Add or change a roster item for this user such as adding a friend, etc.
<?php

 

 

$secret= 'xxxxxxxxxxxxxxx';

$url= "http://devchat.example.com:9090/plugins/restapi/v1/users/jsmith/roster";

 

$headers  = array(

   'http'=> array(

       'method'=> "GET",

       'header'=> "Authorization: ". $secret. "\r\n"

    )

);

 

$context= stream_context_create($headers);

$response= file_get_contents($url, false, $context);

 

echo$response;

 

?>


Viewing all articles
Browse latest Browse all 488

Trending Articles