Guides & Resources
How to use the dialer
Make WhatsApp calls straight from the browser — in the Hasos dashboard to test, or embedded in your product via iframe.
When testing, call someone else's WhatsApp (a third-party number). Calling your own number or another number connected to Hasos rings but has no audio— WhatsApp doesn't establish media on a call to yourself. It's not a bug: use a different destination number.
From the dashboard (fastest way to test)
- Connect a number under Devices and wait for the status to show Connected.
- Open the device and click Dialer.
- Allow the microphone when the browser asks — without it there's no audio.
- Enter the destination number with country code + area code (e.g. 5511999999999) and click call.
Embedded in your product (iframe)
- Issue a device token via the API (the token authenticates that number in the browser — treat it as a credential).
- Paste the iframe below into your app. The allow="microphone" attribute is required.
- The page must be served over HTTPS — browsers only grant microphone access in a secure context.
- Generate a new token per session/user and never expose it publicly.
html
<!-- 1) issue a token (on your server) -->
<!-- curl -X POST https://api.hasos.com.br/v1/instances/INSTANCE_ID/tokens \
-H "x-api-key: hs_live_your_key" -->
<!-- 2) embed the dialer -->
<iframe
src="https://phone.hasos.com.br?token=YOUR_TOKEN"
allow="microphone"
style="width:420px;height:640px;border:0;border-radius:8px"
></iframe>Making a call
- Number format: country code + area code + number, digits only (e.g. 5511999999999). Brazilian numbers are normalized automatically.
- States you'll see: “Calling” (ringing) → “Connected” (the person answered and audio is flowing).
- During the call you can mute the microphone and hang up using the dialer buttons.
- Every call generates webhook events (ringing/answered/ended) and a recording, like any API call.
Requirements and limitations
- An allowed microphone + a page served over HTTPS are required for audio.
- Call someone else's number (your customer). Calling your own number — or another number connected to Hasos — won't establish audio (WhatsApp doesn't complete a call “to yourself”).
- Receiving calls in the dialer is available — when someone calls the number, the dialer rings and you can answer.
- One number per device: to dial from several numbers, issue a token for each one.
