Example #1
0
 private function getWufooEntries(Application $app, $formId, $entryId)
 {
     $wufooApiEndpoint = "https://%s.wufoo.com/api/v3/forms/%s/entries.json";
     $url = sprintf($wufooApiEndpoint, $app["config"]["wufoo"]["subdomain"], $formId);
     $params = array("sort" => "EntryId", "sortDirection" => "DESC", "Filter1" => "EntryId Is_equal_to " . $entryId);
     $urlJob = new UrlQuery($url, $params);
     // Wufoo doesn't use a password, so let's use bacon
     $urlJob->setAuthentication($app["config"]["wufoo"]["apikey"], "bacon");
     return $urlJob->sendGet();
 }
Example #2
0
 /**
  * Send the appropriate URL request
  *
  * @param  string $type
  * @param  string $url
  * @param  array  $postParams
  * @param  array  $getParams
  *
  * @since  0.1.0
  *
  * @return mixed
  */
 private static function sendRequest($type, $url, $postParams, $getParams)
 {
     $getParams["api_key"] = self::$apiKey;
     $urlQuery = new UrlQuery($url, $getParams);
     switch ($type) {
         case "POST":
             return $urlQuery->sendPost($postParams);
         case "PUT":
             return $urlQuery->sendPut($postParams);
         case "DELETE":
             return $urlQuery->sendDelete();
         default:
             throw new \InvalidArgumentException();
     }
 }