Home / Selection / Random row
Getting random row from a selection
GET /api/selection/:selectionId/random
see Using authentication token
{
"valid": true,
"data": [
{
"table_name.email": "some@email.com",
"table_name.field": "value 1"
},
{
"table_name.email": "other@email.com",
"table_name.field": "value 2"
},
],
"extra": {
"email_field": {
"field_name": null
}
},
"pagination": {
"next_page" : 2,
"rows_per_page" : 2,
"total_rows" : 4,
"total_pages" : 2
}
}
<?php
require_once 'RestOpen.php';
$username = 'my_username';
$password = 'my_password';
$workspaceId = 999;
$selectionId = 999;
$rest = new RestOpen($username, $password, $workspaceId);
$result = $rest->getSelectionRandomRow($selectionId);
var_dump($result);