Skip to main content
:sf_voice — built on Req. All functions return {:ok, result} or {:error, %SfVoiceMedia.Error{}}. Use this SDK in Phoenix or Oban code where pattern matching on {:ok, _} / {:error, _} fits the rest of the app.

Install

Add to your mix.exs:
Then fetch:

Create a client

new/2 accepts http_opts as a keyword list. These are passed directly to Req — use them for custom timeouts, proxies, or retry configuration.

Ingest

Request keys are atoms. Response keys come back as strings (JSON convention).

Poll until ready

poll_task! raises %SfVoiceMedia.Error{} if the task fails, or a timeout error if it doesn’t complete within timeout_ms. If you prefer pattern matching over exceptions:

Assets

Errors

%SfVoiceMedia.Error{} has three fields: code, message, status.