You are here

public function AcquiaLiftAPI::getAgent in Acquia Lift Connector 7.2

Same name and namespace in other branches
  1. 7 includes/acquia_lift.classes.inc \AcquiaLiftAPI::getAgent()

Returns the campaign with the provided name if it exists, FALSE otherwise.

File

includes/AcquiaLiftAPI.inc, line 311

Class

AcquiaLiftAPI

Code

public function getAgent($agent_name) {
  $url = $this
    ->generateEndpoint("campaigns/{$agent_name}");
  $fail_msg = 'Could not retrieve the specified agent from Lift';
  $response = $this
    ->makeGetRequest($url, array(), $fail_msg);
  if (!empty($response)) {
    return $response;
  }
  return FALSE;
}