Configure Environment Settings
Use upsertEnvironmentSettings() to save the connection details that every downstream SDK API depends on.
Why this API matters
This is the foundational setup step after deployment. Without valid environment settings, the SDK cannot:
- send SMS
- send MMS
- fetch account balance
- fetch plan details
- retrieve message status
Method signature
Inputs
Input example
What the API does
This API behaves as an upsert:
- creates the configuration if it does not exist
- updates the configuration if it already exists
It stores:
- environment name
- API key
- endpoint URL
Response type
Response fields
Example
Example response behavior
Success
Error
Documented failure behavior
The Confluence page documents generic failure behavior for this API rather than parameter-specific validation errors.
Documented error outcome
response = 'ERROR'responseMessageexplains the reason for failure- until the issue is fixed, the SDK may not be able to communicate with the platform
Likely operational causes to investigate
These are the main troubleshooting areas implied by the guide:
- wrong API key
- wrong endpoint for the environment
- production credentials used with a QA endpoint
- QA credentials used with a production endpoint
- stale credentials after a key rotation
The guide does not document exact field-level validation messages for this API beyond the generic error pattern above. The safest implementation is to validate all three inputs in your own Apex before calling the method.
Environment guidance
Production
Use the production API key and production base URL assigned to the production account.
Sandbox or QA
Use the QA or sandbox API key and the corresponding non-production base URL.
Best practices
- run this API immediately after deployment
- keep the primary messaging environment name as
Default - verify the connection with balance or plan APIs after saving settings
- avoid mixing credentials across environments
- rerun this API whenever credentials change
