Short answer
wait_for_code waits up to 55 seconds for a one-time code to arrive by SMS or email, then returns it. Agentline NZ scans every inbound SMS and email for a one-time code and hands back the newest code that hasn't already been returned, so your agent doesn't have to poll.
Steps
- Give the service your Agentline NZ details. Your agent enters your Agentline NZ 028 number or @agentline.nz email address in the sign-up or sign-in form.
- Call wait_for_code. Straight after submitting the form, the agent calls wait_for_code. Set channel to sms, email or any.
- Narrow it down if needed. If several codes might arrive at once, pass from_contains with part of the sender, for example Google or noreply@github.com.
- Use the code. wait_for_code returns the code, the channel, the sender and when it arrived. The agent types it in to finish.
REST API example
curl -X POST https://agentline.nz/api/v1/wait-for-code \
-H "Authorization: Bearer $AGENTLINE_KEY" -H "Content-Type: application/json" \
-d '{"channel":"any","timeout_seconds":45}'
Good to know
- We can't guarantee that every third-party service will accept an Agentline NZ number for verification.
- Each code is only handed out once, so two agents waiting on the same account won't both get it.
FAQ
Will every service send codes to my number?
No. Some services won't send codes to business messaging numbers. We can't guarantee that every third-party service will accept an Agentline NZ number for verification. See Can an AI agent receive SMS verification codes in New Zealand?.
Related
- Can an AI agent receive SMS verification codes in New Zealand?
- How to give Claude a phone number, text and email in New Zealand
- How to give ChatGPT and Dots a phone number, text and email in New Zealand
Start free · Start free with an email inbox (no card), or take a 7-day trial of Starter or Pro to get a number.