/** * Returns the version header for the rest calls * @return string */ public static function getVersionHeader() { return 'x-ctct-request-source: sdk.php.' . CtctConfig::get('settings.version'); }
/** * Update an individual contact * @param string $accessToken - Valid access token * @param stdClass $contact - Contact to update * @param boolean $actionByVisitor - is the action being taken by the visitor, default is false * @return stdClass object representing contact */ public function updateContact($accessToken, stdClass $contact, $actionByVisitor = false) { $params = array(); if ($actionByVisitor == true) { $params['action_by'] = "ACTION_BY_VISITOR"; } $baseUrl = CtctConfig::get('endpoints.base_url') . sprintf(CtctConfig::get('endpoints.contact'), $contact->id); $url = $this->buildUrl($baseUrl, $params); $response = $this->restClient->put($url, self::getHeaders($accessToken), json_encode($contact)); return json_decode($response->body, true); }