One of the most recurring questions we get from developers is: How can I test the Network APIs if they are unavailable in my country? Say no more. We are excited to announce the availability of the Virtual Operator.
The Virtual Operator provides predefined and deterministic API responses when using the Vonage Playground. It works like a regular mobile operator but only accepts API requests with phone numbers that use the +990
prefix.
Let’s take a look at how it works!
How Can I Enable the Virtual Operator?
Using the Virtual Operator is straightforward. Just create an application in the dashboard (or use an existing one) and select “Playground” under the Network API capabilities box. That’s it. No extra configuration is required. From now on, all API requests using the credentials linked to this application and phone numbers with the +990
prefix will be directed to the Virtual Operator.
Once the application is ready, go to the Playground page to check the available operators supported within the Playground. The first entry corresponds to the Virtual Operator:
Dashboard Playground Operators list
Note that It is not necessary to add +990
numbers to your Playground's allowlist. Simply make an API call to any of the supported Network APIs.
Call Network APIs with the Virtual Operator
The Virtual Operator provides deterministic responses for API requests using phone numbers starting with +990
. The behavior is defined by the input parameters in the API request, including different ranges in some parameters or specific phone number endings. The documentation contains all possible API response combinations for the supported Network APIs.
For example, the /check
endpoint of the SIM Swap API will always return true if the parameter maxAge
is larger than 500:
curl --url https://api-eu.vonage.com/camara/sim-swap/v040/check \
--header 'Authorization: Bearer $TOKEN' \
--header 'Content-Type: application/json' \
--data '{"phoneNumber": "+990123456", "maxAge": "500"}'
In case we want to test the scenario where the API returns an error, we could send an API request using a phone number ending in 99
:
curl --url https://api-eu.vonage.com/camara/sim-swap/v040/check \
--header 'Authorization: Bearer $TOKEN' \
--header 'Content-Type: application/json' \
--data '{"phoneNumber": "+990123499, "maxAge": "500"}'
Remember that authentication must be implemented in the same way as with a regular mobile operator.
Get in Touch
Have you already used the new Virtual Operator? We’d love to hear your feedback! Join us on the Vonage Community Slack or message us on X, and we will get back to you.
Thanks for reading!
![](https://a.storyblok.com/f/270183/405x400/2b811a162d/alvaro-navarro.jpg/m/filters:grayscale())
Alvaro is a developer advocate at Vonage, focusing on Network APIs. Passionate about Developer Experience, APIs, and Open Source. Outside work, you can often find him exploring comic shops, attending sci-fi and horror festivals or crafting stuff with those renowned tiny plastic building blocks.
![](https://a.storyblok.com/f/270183/261x229/3a2f6c8091/developer.png/m/)