getUser(); $email = $user->getEmail(); $password = $this->crypt->decrypt($user->getPassword()); try { $data = $this->apiClient->getCrmAttributes($email, $password); if ($data instanceof Notification) { return new JsonResponse(['message' => $data->message, 'code' => $data->code], Response::HTTP_BAD_REQUEST); } return $this->json($data); } catch (ApiClientException $e) { return new JsonResponse(['message' => $e->getMessage()], Response::HTTP_BAD_REQUEST); } } }