{"id":5898,"library":"delighted","title":"Delighted API Python Client","description":"The Delighted API Python Client (version 4.2.0) is the official Python library for interacting with the Delighted customer experience platform. It enables programmatic access to send surveys, retrieve responses, manage people, and obtain various engagement metrics. The library is currently in a deprecated state, with the Delighted service itself scheduled for sunset on June 30, 2026. Consequently, this package will no longer receive maintenance or updates after this date.","status":"deprecated","version":"4.2.0","language":"en","source_language":"en","source_url":"https://github.com/delighted/delighted-python","tags":["API client","survey","NPS","customer feedback","deprecated"],"install":[{"cmd":"pip install --upgrade delighted","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"symbol":"delighted","correct":"import delighted"},{"note":"Used for creating new survey responses.","symbol":"SurveyResponse","correct":"delighted.SurveyResponse.create(...)"},{"note":"Used for retrieving account metrics.","symbol":"Metrics","correct":"delighted.Metrics.retrieve()"},{"note":"Used for retrieving Autopilot configurations.","symbol":"AutopilotConfiguration","correct":"delighted.AutopilotConfiguration.retrieve('email')"},{"note":"Specific exception for handling API rate limits.","symbol":"TooManyRequestsError","correct":"from delighted.errors import TooManyRequestsError"}],"quickstart":{"code":"import os\nimport delighted\n\ndelighted.api_key = os.environ.get('DELIGHTED_API_KEY', 'YOUR_API_KEY')\n\ntry:\n    # Create a person\n    person = delighted.Person.create(email='test@example.com', name='Test User')\n    print(f\"Created person: {person.id} - {person.email}\")\n\n    # Add a survey response for the person\n    survey_response = delighted.SurveyResponse.create(person=person.id, score=10, comment='Very satisfied!')\n    print(f\"Added survey response: {survey_response.id} with score {survey_response.score}\")\n\n    # Retrieve metrics\n    metrics = delighted.Metrics.retrieve()\n    print(f\"Retrieved metrics: {metrics}\")\n\nexcept delighted.errors.TooManyRequestsError as err:\n    print(f\"Rate limit exceeded. Please wait {err.retry_after} seconds before retrying.\")\nexcept delighted.errors.APIError as err:\n    print(f\"An API error occurred: {err.message}\")\nexcept Exception as e:\n    print(f\"An unexpected error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to configure the Delighted client with an API key, create a new person, add a survey response for that person, and retrieve account metrics. It also includes basic error handling for rate limits and general API errors. Ensure you replace 'YOUR_API_KEY' or set the DELIGHTED_API_KEY environment variable."},"warnings":[{"fix":"Migrate to an alternative customer feedback platform before June 30, 2026.","message":"The Delighted service itself is being sunset on June 30, 2026. After this date, the API and this client library will cease to function.","severity":"breaking","affected_versions":"All versions"},{"fix":"No new features or bug fixes will be provided. Consider alternatives or freeze your current working version.","message":"This Python client package is officially deprecated and will no longer be maintained or receive updates.","severity":"deprecated","affected_versions":"All versions (effective immediately)"},{"fix":"Ensure your API key is correctly passed as the username, and the password is an empty string if using custom HTTP clients, or rely on the library's `delighted.api_key` configuration.","message":"API authentication uses HTTP Basic Auth where your API key is the username and the password field must be left blank.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Implement an exponential backoff or retry strategy, respecting the `retry_after` header/attribute. The official libraries include support for handling these errors.","message":"Requests are subject to rate limits. Exceeding them will raise a `delighted.errors.TooManyRequestsError` exception with a `retry_after` attribute.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Set `delighted.api_key = 'YOUR_API_KEY'` at the beginning of your application or explicitly pass a configured `Client` instance to each API call if managing multiple keys or environments.","message":"The `delighted` module must be configured with your API key, either globally via `delighted.api_key` or by passing a `Client` instance to resource actions.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}