/** * Gets the response from the api in string format * * @param int $articleId Id of the article from which to get the video player * @param Players $playerName Name of the player to display embed code for * @param Version $playerVersion Version of the player to display embed code for * @param Players $fallbackPlayerName Name of the fallback player to display embed code for if the primary player isn't supported by the browser * @param Version $fallbackPlayerVersion Version of the fallback player to display embed code for if the primary player isn't supported by the browser * @param array $properties array of properties to add to querystring * @param array $fields array of fields to add to querystring * @param string $format can be either "xml" or "json" * @return string * @throws InvalidArgumentException */ private function GetVideoPlayerRaw($articleId, $playerName, $playerVersion, $fallbackPlayerName, $fallbackPlayerVersion, $properties, $fields, $format) { switch ($format) { case "xml": $uri = $this->GetUri($articleId, $playerName, $playerVersion, $fallbackPlayerName, $fallbackPlayerVersion, "xml", $properties, $fields); break; case "json": $uri = $this->GetUri($articleId, $playerName, $playerVersion, $fallbackPlayerName, $fallbackPlayerVersion, "json", $properties, $fields); break; default: throw new \InvalidArgumentException($format . 'format not supported'); break; } $uri = "http://" . $this->credentials->getPublicKey() . ":" . $this->credentials->getSecretKey() . "@" . str_replace("http://", "", $uri); return AdferoHelpers::GetRawResponse($uri); }
/** * Gets the response from the api in string format * * @param int $feedId * @param int $offset offset to skip * @param int $limit The limit to apply to the list (maximum 100) * @param array $properties array of properties to add to querystring * @param array $fields array of fields to add to querystring * @param string $format either "xml" or "json" * @return string * @throws InvalidArgumentException */ private function ListBriefsForFeedRaw($feedId, $offset, $limit, $properties, $fields, $format) { switch ($format) { case "xml": $uri = $this->GetUri($feedId, "feedId", "xml", $properties, $fields, $offset, $limit); break; case "json": $uri = $this->GetUri($feedId, "feedId", "json", $properties, $fields, $offset, $limit); break; default: throw new InvalidArgumentException($format . 'format not supported'); break; } $uri = "http://" . $this->credentials->getPublicKey() . ":" . $this->credentials->getSecretKey() . "@" . str_replace("http://", "", $uri); return AdferoHelpers::GetRawResponse($uri); }
/** * Gets the response from the api in string format * * @param int $id * @param array $properties array of properties to add to querystring * @param array $fields array of fields to add to querystring * @param string $format either "xml" or "json" * @return string * @throws InvalidArgumentException */ private function GetArticlePhotoRaw($id, $properties, $fields, $format) { switch ($format) { case "xml": $uri = $this->GetUri($id, null, "xml", $properties, $fields, null, null); break; case "json": $uri = $this->GetUri($id, null, "json", $properties, $fields, null, null); break; default: throw new InvalidArgumentException($format . 'format not supported'); break; } $uri = "http://" . $this->credentials->getPublicKey() . ":" . $this->credentials->getSecretKey() . "@" . str_replace("http://", "", $uri); return AdferoHelpers::GetRawResponse($uri); }