client.test_helpers_events
Simulate calls and events in test mode. These methods are on client.test_helpers_events, where client is a MoreVoice client (see the Python SDK). On AsyncMoreVoice the same methods are awaited. Each one returns the response object and raises an exception when the API answers with an error.
create()
Section titled “create()”Send a sample event. Test mode only. Emits one sample event of type: it is stored and delivered to your test-mode webhook endpoints that subscribe to it, signed and retried like any event.
def create(self, body: _m.TestHelperEventCreateParamsInput | Mapping[str, Any], *, more_voice_version: str | Unset = UNSET, idempotency_key: str | Unset = UNSET) -> _m.TestHelperEventclient.test_helpers_events.create() · await async_client.test_helpers_events.create() · POST /test_helpers/events · API reference
Request body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
type |
string |
yes | An event type from the catalogue, e.g. call.ended. |
Returns
Section titled “Returns”TestHelperEvent:
| Field | Type | Description |
|---|---|---|
object |
"test_event" |
Always test_event. |
id |
string |
The event’s ID: it is stored and delivered like any event. |
type |
string |
— |
livemode |
boolean |
true in live mode, false in test mode. |
Example
Section titled “Example”from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
test_helper_event = client.test_helpers_events.create({ "type": "call.ended",})print(test_helper_event)