You are here

public function AcquiaLiftAPI::getDecisionsForPoint in Acquia Lift Connector 7

Gets a list of decisions for the specified agent and decision point.

Parameters

$agent_name: The name of the agent.

$point_name: The name of the decision point.

Return value

bool|mixed An array of decision names or FALSE if an error occurs.

File

includes/acquia_lift.classes.inc, line 837
Provides an agent type for Acquia Lift

Class

AcquiaLiftAPI
@file Provides an agent type for Acquia Lift

Code

public function getDecisionsForPoint($agent_name, $point_name) {
  $url = $this
    ->generateEndpoint("/agent-api/{$agent_name}/points/{$point_name}/decisions");
  $response = $this
    ->httpClient()
    ->get($url, array(
    'Accept' => 'application/json',
  ));
  if ($response->code == 200) {
    return json_decode($response->data, TRUE);
  }
  else {
    $this
      ->handleBadResponse($response->code, 'Could not retrieve decisions from Acquia Lift', array(), FALSE);
  }
  return FALSE;
}