Trying to push updated softphone preferences to about two hundred agents using the Python client. Docs say the endpoint takes a JSON body with the webRtc object, but the SDK keeps rejecting it. Console spits out a 400 immediately. Token refresh happens every fifty-five minutes, so that part isn’t the issue. Some posts claim the OAuth2 flow requires a separate refresh call for batch jobs, but that isn’t accurate. The platform client handles token rotation automatically. Japan org definitely uses pure.cloud for all v2 calls.
The script looks like this:
import purecloud_platform_client as pcc
from purecloud_platform_client.rest import ApiException
api_instance = pcc.UsersettingsApi()
body = {
"webRtc": {
"enabled": "true",
"defaultDevice": "headset"
}
}
try:
result = api_instance.post_user_settings_softphone(user_id, body)
except ApiException as e:
print(f"Status {e.status}, Reason: {e.reason}")
Running it gives Status 400, Reason: Bad Request. The response payload complains about the boolean type. Changed it to True in the dict, but the 400 persists. Maybe the SDK is stringifying it before the request? The script doesn’t throw a syntax error locally, but it can’t pass the API validation. Pagination loop for the user list works fine, but the update call dies on the first iteration. SDK version is 2.25.0. Python 3.11. Timezone is Asia/Tokyo, so maybe the server clock drift is messing with the JWT validation? Not sure. Apologies if this is a noob question. How should the boolean be formatted for this specific SDK method? Really just trying to get the WebRTC flags to stick without manual UI clicks. The logs are doing jack all to help.
{
"errorCode": "invalid_request",
"message": "Failed to parse request body. Expected boolean for field 'enabled'.",
"path": "/api/v2/users/1a2b3c/settings/softphone"
}