Lookup's Call Forwarding package allows you to get the unconditional call forwarding status of a mobile phone number.
Call Forwarding Lookups are billed per Lookup, even if data may not be available. Currently, requesting Call Forwarding Lookups for unsupported carriers will return null
values, but will not be billed.
To make a Call Forwarding request, add call_forwarding
to the optional query parameter Fields
when making a standard Lookup request.
1curl -X GET "https://lookups.twilio.com/v2/PhoneNumbers/{PhoneNumber}?Fields=call_forwarding" \ -u2$TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
Coverage and Limitations: Only numbers owned by major carriers in the United Kingdom are supported.
Release Stage and Access: Private Beta, please submit this form to contact sales. Requires carrier approvals.
The following additional properties are returned for a Call Forwarding request.
Property | Description |
---|---|
CallForwardingStatus | A Boolean value indicating unconditional call forwarding is currently enabled for the requested mobile phone number (true ) or is not (false ). |
ErrorCode | The error code, if any, associated with your request. |
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchPhoneNumber() {11const phoneNumber = await client.lookups.v212.phoneNumbers("+447772000001")13.fetch({ fields: "call_forwarding" });1415console.log(phoneNumber.callForwarding);16}1718fetchPhoneNumber();
1{2"calling_country_code": "44",3"country_code": "GB",4"phone_number": "+447772000001",5"national_format": "07772 000001",6"valid": true,7"validation_errors": null,8"caller_name": null,9"sim_swap": null,10"call_forwarding": {11"call_forwarding_status": true,12"error_code": null13},14"line_status": null,15"line_type_intelligence": null,16"identity_match": null,17"reassigned_number": null,18"sms_pumping_risk": null,19"phone_number_quality_score": null,20"pre_fill": null,21"url": "https://lookups.twilio.com/v2/PhoneNumbers/+447772000001"22}