function attach_file($file_path) { try { $base64 = HelperFunctions::convert_to_base64($file_path); $payload = array('doc' => array('attachment' => $base64)); $path = $this->create_user_path($this->client->user_id); $response = $this->client->patch($path, $payload); } catch (Exception $e) { $response = array('success' => false, 'error' => array('en' => $e->getMessage())); } return $response; }