{"id":220,"library":"plivo","title":"Plivo","description":"Python SDK for Plivo communications API — SMS, voice calls, WhatsApp, and Plivo XML generation. Current version is 4.59.6. Legacy version 0.11.3 has a completely different API (plivo.RestAPI vs plivo.RestClient). pip install --upgrade plivo may NOT cleanly upgrade from legacy — manual uninstall required.","status":"active","version":"4.59.6","language":"python","source_language":"en","source_url":"https://github.com/plivo/plivo-python","tags":["sms","voice","telephony","communications","whatsapp","cpaas"],"install":[{"cmd":"pip install plivo","lang":"bash","label":"Standard (current 4.x API)"},{"cmd":"pip uninstall plivo && pip install plivo","lang":"bash","label":"If upgrading from legacy 0.11.3 — upgrade alone may fail"}],"dependencies":[{"reason":"Required. Installed automatically.","package":"requests","optional":false},{"reason":"Required. Installed automatically.","package":"pytz","optional":false},{"reason":"Required for JWT token creation. Installed automatically.","package":"PyJWT","optional":false}],"imports":[{"wrong":"import plivo","symbol":"RestClient","correct":"from plivo import RestClient"}],"quickstart":{"code":"import plivo\nimport os\n\n# Use env vars: PLIVO_AUTH_ID and PLIVO_AUTH_TOKEN\nclient = plivo.RestClient()\n\n# Send SMS\nsms = client.messages.create(\n    src='+12025551234',   # Your Plivo number in E.164 format\n    dst='+14155551234',   # Destination in E.164 format\n    text='Hello from Plivo!'\n)\nprint('SMS sent:', sms)\n\n# Make a call\ncall = client.calls.create(\n    from_='+12025551234',\n    to_='+14155551234',\n    answer_url='https://yourapp.com/answer_url'  # Returns Plivo XML\n)\nprint('Call made:', call)\n\n# Generate Plivo XML (for answer_url endpoint)\nfrom plivo import plivoxml\nxml = plivoxml.ResponseElement()\nxml.add(plivoxml.SpeakElement('Hello! This call is powered by Plivo.'))\nprint(xml.to_string())","lang":"python","description":"Send SMS, make a call, generate Plivo XML. Store credentials in env vars."},"warnings":[{"fix":"Uninstall first: pip uninstall plivo, then pip install plivo. Rewrite all code from plivo.RestAPI pattern to plivo.RestClient pattern — they are not compatible.","message":"Legacy 0.11.3 (plivo.RestAPI) and current 4.x (plivo.RestClient) are completely different APIs. pip install --upgrade plivo from 0.11.3 may fail silently or leave a broken installation. All old code using RestAPI, send_message(), dict-based params will raise AttributeError on 4.x.","severity":"breaking","affected_versions":">= 4.0"},{"fix":"Always use E.164 format: '+' + country_code + local_number. Example: +12025551234 for a US number, +919876543210 for an Indian number.","message":"Phone numbers must be in E.164 format (+country_code + number). Passing numbers without the + prefix causes API errors. Common mistake: passing '12025551234' instead of '+12025551234'.","severity":"breaking","affected_versions":"all"},{"fix":"The answer_url endpoint must return Plivo XML with Content-Type: application/xml. Use plivoxml.ResponseElement() to generate the response.","message":"calls.create() requires an answer_url that returns valid Plivo XML (ResponseElement). Passing an answer_url that returns JSON or empty response causes the call to fail silently after connecting.","severity":"gotcha","affected_versions":"all"},{"fix":"Purchase a Plivo number at console.plivo.com. The src parameter must match a number in your Plivo account.","message":"The src number for SMS must be a Plivo-owned number in your account, not your personal number. Sending from an unverified or unowned number returns a 400 error.","severity":"gotcha","affected_versions":"all"},{"fix":"Use offset parameter: client.messages.list(limit=20, offset=20) for page 2. Or iterate manually while response has results.","message":"client.messages.list() returns max 20 results by default. For pagination, use limit and offset parameters explicitly. There is no automatic pagination built into list().","severity":"gotcha","affected_versions":"all"},{"fix":"Set the PLIVO_AUTH_ID and PLIVO_AUTH_TOKEN environment variables before running your script. Alternatively, pass auth_id and auth_token directly to the Plivo.RestClient() constructor: client = plivo.RestClient(auth_id='YOUR_AUTH_ID', auth_token='YOUR_AUTH_TOKEN').","message":"The Plivo Python SDK requires authentication credentials (PLIVO_AUTH_ID and PLIVO_AUTH_TOKEN) to be set. These are typically read from environment variables or passed directly to the Plivo.RestClient() constructor. Failure to provide them will result in an AuthenticationError.","severity":"breaking","affected_versions":"all"},{"fix":"Ensure PLIVO_AUTH_ID and PLIVO_AUTH_TOKEN environment variables are set before running the application, or initialize the client with `client = plivo.RestClient(auth_id='YOUR_AUTH_ID', auth_token='YOUR_AUTH_TOKEN')`.","message":"The Plivo Python SDK failed to find authentication credentials. It attempts to read PLIVO_AUTH_ID and PLIVO_AUTH_TOKEN from environment variables by default, or they must be passed explicitly to plivo.RestClient(). Failure to provide these results in plivo.exceptions.AuthenticationError and `KeyError: 'PLIVO_AUTH_ID'` or `'PLIVO_AUTH_TOKEN'`.","severity":"breaking","affected_versions":"all"}],"env_vars":null,"search_vec":"'0.11.3':22 '4.59.6':19 'api':7,27 'call':10 'clean':37 'communic':6,47 'complet':25 'cpaa':49 'current':16 'differ':26 'generat':15 'instal':32 'legaci':20,40 'manual':41 'may':35 'pip':31 'plivo':1,5,13,34 'plivo.restapi':28 'plivo.restclient':30 'python':2 'requir':43 'sdk':3 'sms':8,44 'telephoni':46 'uninstal':42 'upgrad':33,38 'version':17,21 'voic':9,45 'vs':29 'whatsapp':11,48 'xml':14","created_at":"2026-03-27T04:36:13.154244+00:00","updated_at":"2026-04-16T18:03:49.837765+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":100,"quickstart_score":80,"quickstart_tag":"verified","pypi_latest":"4.60.2","cli_name":"","cli_version":null,"type":"library","homepage":"https://www.plivo.com","github":"https://github.com/plivo/plivo-python","docs":null,"changelog":null,"pypi":"https://pypi.org/project/plivo/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["communication"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-06-30","next_check":"2026-07-30","install_tag":"verified"}}