Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hashemsh/b76d84652375e1f43de49d9b75d08fe0 to your computer and use it in GitHub Desktop.
Save hashemsh/b76d84652375e1f43de49d9b75d08fe0 to your computer and use it in GitHub Desktop.
function main() {
// Create a phone number builder.
var phoneNumberBuilder = AdsApp.extensions().newPhoneNumberBuilder();
// Create a phone number operation.
var phoneNumberOperation = phoneNumberBuilder
.withCountry("IR") // required
.withPhoneNumber("02188888888") // required
.withMobilePreferred(true) // optional
.build();
// Optional: examine the outcome. The call to isSuccessful()
// will block until the operation completes.
if (phoneNumberOperation.isSuccessful()) {
// Get the result.
var phoneNumber = phoneNumberOperation.getResult();
} else {
// Handle the errors.
var errors = phoneNumberOperation.getErrors();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment