Suneth Kalhara
Suneth Kalhara

Reputation: 1221

Ning get all user informations

I am trying to get member list of my ning pro network with there details for my applications, but still I can't figure out what should I do for for this

I used this code for get photos from ning api

require_once('NingApi.php');

$ningApi = new NingApi('mychatterbook', 'xxxxx-e44f-47b5-ba0d-e99d98ba60be', 'xxxxx-436f-4ba0-9911-a2ac5b5a00bb','[email protected]','xxxxxx');


// Get the most recent photo
$result = $ningApi->photo->fetchNRecent();

Please help me anyone knows how to implement this using php..

Thank you

Upvotes: 0

Views: 231

Answers (1)

Suneth Kalhara
Suneth Kalhara

Reputation: 1221

i got it, it need to Login with admin account for get the users information, this returns 2 users.

require_once('NingApi.php');

    $ningApi = new NingApi('xxxbook', 'd1216884-e44f-47b5-xxx-xxxxe', 'xxx-xx-4ba0-9911-xxxxxxx','[email protected]','xxx');

    try {
      $result1 =  NingApi::instance()->user->fetchNRecent(2);

    } catch (Exception $e) {
      echo "Error: ".$e->getMessage()."\n".$e->getTraceAsString();
    }

        print_r($result1);

Upvotes: 0

Related Questions