public function syncUser($userId)
 {
     $data = array("lftoken" => $this->buildLivefyreToken());
     $url = sprintf("%s/api/v3_0/user/%s/refresh", Domain::quill($this), $userId);
     $response = Client::POST($url, array(), $data);
     return $response->status_code == 200;
 }
 private function invokeCollectionApi($method)
 {
     $uri = sprintf("%s/api/v3.0/site/%s/collection/%s/", Domain::quill($this), $this->getSite()->getData()->getId(), $method);
     $data = json_encode(array("articleId" => $this->getData()->getArticleId(), "collectionMeta" => $this->buildCollectionMetaToken(), "checksum" => $this->buildChecksum()));
     $headers = array("Content-Type" => "application/json", "Accepts" => "application/json");
     return Client::POST($uri . "?sync=1", $headers, $data);
 }
 public static function getTimelineStream(TimelineCursor $cursor, $isNext)
 {
     $url = self::getTimelineUrl($cursor->getCore()) . "?resource=" . $cursor->getData()->getResource() . "&limit=" . $cursor->getData()->getLimit();
     if ($isNext) {
         $url .= "&since=" . $cursor->getData()->getCursorTime();
     } else {
         $url .= "&until=" . $cursor->getData()->getCursorTime();
     }
     $response = Client::GET($url, self::getHeaders($cursor->getCore()));
     return json_decode($response);
 }
 public static function getTimelineStream($core, $resource, $limit = 50, $until = null, $since = null)
 {
     $url = self::getTimelineUrl($core) . "?resource=" . $resource . "&limit=" . $limit;
     if (isset($until)) {
         $url .= "&until=" . $until;
     } elseif (isset($since)) {
         $url .= "&since=" . $since;
     }
     $response = Client::GET($url, self::getHeaders($core));
     return json_decode($response->body);
 }
 public function getCollectionContent($articleId)
 {
     $url = sprintf("%s/bs3/%s/%s/%s/init", Domain::bootstrap($this), $this->_network->getName(), $this->_id, base64_encode($articleId));
     $response = Client::GET($url);
     return json_decode($response->body);
 }