{"id":5467,"library":"salesforce-fuelsdk-sans","title":"Salesforce Marketing Cloud Fuel SDK for Python (salesforce-fuelsdk-sans)","description":"The `salesforce-fuelsdk-sans` library is a community-maintained fork of the original Salesforce Marketing Cloud Fuel SDK for Python. It provides easy programmatic access to Salesforce Marketing Cloud's Fuel API Family services, encompassing both REST and SOAP APIs. The SDK streamlines common tasks such as acquiring and refreshing access tokens, managing token state, and determining appropriate API endpoints. The latest stable version, 1.3.1, was released in June 2022.","status":"active","version":"1.3.1","language":"en","source_language":"en","source_url":"https://github.com/seahawks8/FuelSDK-Python","tags":["Salesforce","Marketing Cloud","API","SDK","SOAP","REST"],"install":[{"cmd":"pip install salesforce-fuelsdk-sans","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Required for JWT-based authentication.","package":"PyJWT","optional":false},{"reason":"Used for making HTTP requests to REST APIs.","package":"requests","optional":false},{"reason":"Used for interacting with SOAP APIs. Replaced 'suds-jurko' in v1.3.1.","package":"suds-community","optional":false}],"imports":[{"note":"The primary client class is exposed directly under the `FuelSDK` namespace, mimicking the original SDK's import path.","wrong":"from salesforce_fuelsdk_sans import ET_Client","symbol":"ET_Client","correct":"from FuelSDK import ET_Client"}],"quickstart":{"code":"import os\nfrom FuelSDK import ET_Client\n\n# Configure environment variables (recommended for production)\n# export FUELSDK_CLIENT_ID='YOUR_CLIENT_ID'\n# export FUELSDK_CLIENT_SECRET='YOUR_CLIENT_SECRET'\n# export FUELSDK_AUTH_URL='YOUR_AUTH_TENANT_SPECIFIC_ENDPOINT'\n# export FUELSDK_BASE_API_URL='YOUR_REST_TENANT_SPECIFIC_ENDPOINT'\n# export FUELSDK_SOAP_ENDPOINT='YOUR_SOAP_TENANT_SPECIFIC_ENDPOINT'\n\ntry:\n    # Initialize ET_Client. Pass False for debug, False for account_id (unless using multi-org)\n    # Configuration can be passed as a dictionary, read from ~/.fuelsdk/config.python,\n    # or via environment variables (as shown below).\n    myClient = ET_Client(False, False)\n\n    # Example: Retrieve a list of lists\n    etList = myClient.create_object('List')\n    etList.props = {'Name': 'My New List', 'Description': 'Created via FuelSDK-Sans'}\n    results = etList.post()\n\n    if results.status:\n        print(f\"Successfully created list: {results.results[0]['NewID']}\")\n    else:\n        print(f\"Error creating list: {results.results[0]['ErrorMessage']}\")\n        print(f\"Full response: {results.results}\")\n\n    # Example: Get all lists\n    # etList = myClient.create_object('List')\n    # results = etList.get()\n    # if results.status:\n    #     print(f\"Found {len(results.results)} lists.\")\n    #     for lst in results.results:\n    #         print(f\"  List Name: {lst['ListName']}, ID: {lst['ID']}\")\n    # else:\n    #     print(f\"Error retrieving lists: {results.results[0]['ErrorMessage']}\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Ensure environment variables or config file are correctly set.\")\n","lang":"python","description":"This quickstart demonstrates how to initialize the `ET_Client` and perform a basic API call, such as creating a new list. It relies on environment variables for authentication credentials, which is a recommended practice. The `ET_Client` manages access token acquisition and refresh automatically."},"warnings":[{"fix":"Ensure `suds-jurko` is uninstalled and `suds-community` is installed (e.g., `pip install suds-community`). Update your `requirements.txt` to reflect `suds-community>=0.7` and remove `suds-jurko`.","message":"Version 1.3.1 replaced `suds-jurko` with `suds-community` as a dependency due to `setuptools>=58.0.0` no longer supporting `2to3`. If you are upgrading from an older version of the original FuelSDK-Python or salesforce-fuelsdk-sans and explicitly relied on `suds-jurko`, you might encounter dependency resolution issues.","severity":"breaking","affected_versions":"<1.3.1"},{"fix":"Verify all authentication parameters against your Marketing Cloud Installed Package details. Utilize environment variables (e.g., `FUELSDK_CLIENT_ID`, `FUELSDK_CLIENT_SECRET`) or a `config.python` file, or pass them directly to the `ET_Client` constructor.","message":"Authentication is a common source of errors. Incorrectly configured Client ID, Client Secret, or tenant-specific endpoints (`authenticationurl`, `baseapiurl`, `soapendpoint`) can lead to 'Unable to validate App Keys' or 'unsupported_grant_type' errors. Ensure these values are correct for your Marketing Cloud instance and application type.","severity":"gotcha","affected_versions":"All"},{"fix":"Treat the `ET_Client` instance as a singleton within your application's session, reusing the same object for all API interactions.","message":"The `ET_Client` object should be instantiated once and reused for the entire session. Creating a new `ET_Client` object for each API request can lead to performance overhead and potential issues with token management and endpoint determination.","severity":"gotcha","affected_versions":"All"},{"fix":"Ensure you are using `salesforce-fuelsdk-sans` (version 1.3.1 or newer) for compatibility with modern Python versions.","message":"The original `FuelSDK-Python` (before this fork) was reported to have compatibility issues with Python 3.10 and newer versions. While `salesforce-fuelsdk-sans` aims to address this, users migrating from the original SDK should be aware of potential runtime errors if they haven't upgraded to this maintained fork.","severity":"gotcha","affected_versions":"Original FuelSDK-Python on Python >=3.10"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}