{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":1073,"path":"api-reference/server-api-reference/c_NotifyPhoneNumberAPI.md","title":"NotifyPhoneNumber - Global","bundle":null,"doc_type":null,"release":"australia","body":"\n# NotifyPhoneNumber- Global\n\nThe NotifyPhoneNumber API allows you to query information about a Notify phone number.\n\nAccess the global NotifyPhoneNumber class and its associated methods in the `SNC` namespace.\n\n**Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md)\n\n## NotifyPhoneNumber - getDialCode\\(\\)\n\nReturns the international dialing code for a Notify phone number.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|String|International phone code for a country.|\n\nThis example shows how to obtain the dial code for a phone number.\n\n```\nvar numbers = SNC.Notify.getPhoneNumbers();\n \n// Here numbers is of type List\nif (numbers.size() > 0) {\n   var number = numbers.get(0);\n \n   // Here number is of type NotifyPhoneNumber\n  gs.info(number.getDialCode());\n}\n```\n\n### Scoped equivalent\n\nTo use the getDialCode\\(\\) method in a scoped application, use the corresponding scoped method: [Scoped NotifyPhoneNumber - getDialCode\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/NPNScopedAPI.md).\n\n## NotifyPhoneNumber - getID\\(\\)\n\nReturns the ID of this phone number as defined by the telephony provider.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|String|Identifier of the number within the telephony provider.|\n\nThis example shows how to obtain the unique identifier for a phone number.\n\n```\nvar numbers = SNC.NotifyScoped.getPhoneNumbers();\n \n// Here numbers is of type List\nif (numbers.size() > 0) {\n   var number = numbers.get(0);\n \n   // Here number is of type NotifyPhoneNumber\n  gs.info(number.getID());\n}\n```\n\n### Scoped equivalent\n\nTo use the getID\\(\\) method in a scoped application, use the corresponding scoped method: [Scoped NotifyPhoneNumber - getID\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/NPNScopedAPI.md).\n\n## NotifyPhoneNumber - getNumber\\(\\)\n\nReturns the numerical phone number for the current Notify caller.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|String|E.164-compliant phone number.|\n\nThis example shows how to obtain a Notify caller's phone number.\n\n```\nvar numbers = SNC.Notify.getPhoneNumbers();\n \n// Here numbers is of type List\nif (numbers.size() > 0) {\n   var number = numbers.get(0);\n \n   // Here number is of type NotifyPhoneNumber\n  gs.info(number.getNumber());\n}\n```\n\n### Scoped equivalent\n\nTo use the getNumber\\(\\) method in a scoped application, use the corresponding scoped method: [Scoped NotifyPhoneNumber - getNumber\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/NPNScopedAPI.md).\n\n## NotifyPhoneNumber - getOwner\\(\\)\n\nReturns the telephony provider associated with this phone number.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|String|Telephony provider associated with the number: Twilio.|\n\nThis example shows how to obtain the telephony provide that owns the specified phone number.\n\n```\nvar numbers = SNC.Notify.getPhoneNumbers();\n \n// Here numbers is of type List\nif (numbers.size() > 0) {\n   var number = numbers.get(0);\n \n   // Here number is of type NotifyPhoneNumber\n  gs.info(number.getOwner());\n}\n```\n\n### Scoped equivalent\n\nTo use the getOwner\\(\\) method in a scoped application, use the corresponding scoped method: [Scoped NotifyPhoneNumber - getOwner\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/NPNScopedAPI.md).\n\n## NotifyPhoneNumber - getTerritory\\(\\)\n\nReturns the country associated with the phone number.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|String|Name of the country to which the phone number belongs.|\n\nThis example shows how to obtain the country of a Notify caller.\n\n```\nvar numbers = SNC.Notify.getPhoneNumbers();\n \n// Here numbers is of type List\nif (numbers.size() > 0) {\n   var number = numbers.get(0);\n \n   // Here number is of type NotifyPhoneNumber\n  gs.info(number.getTerritory());\n}\n```\n\n### Scoped equivalent\n\nTo use the getTerritory\\(\\) method in a scoped application, use the corresponding scoped method: [Scoped NotifyPhoneNumber - getTerritory\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/NPNScopedAPI.md).\n\n## NotifyPhoneNumber - isShortCode\\(\\)\n\nDetermines whether the current Notify phone number is a short code.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n<table id=\"table_mgj_csx_zfb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the current Notify phone number is a short code.-   true: phone number is a short code.\n-   false: phone number is not a short code.\n\n</td></tr></tbody>\n</table>This example shows how to check if the current Notify phone number is a short code.\n\n```\nGlideRecord notifyNumber = new GlideRecord(TABLE_NOTIFY_NUMBER);\nnotifyNumber.query(COL_NUMBER, notifyPhoneNumber.getNumber());\n\nif (!notifyNumber.next()) {\n  notifyNumber.initialize();\n  notifyNumber.setValue(COL_OWNER, notifyPhoneNumber.getOwner());\n  if (notifyPhoneNumber.isShortCode()) {\n    notifyNumber.setValue(COL_SHORT_CODE, notifyPhoneNumber.getNumber());\n  } else {\n    notifyNumber.setValue(COL_PHONE_NUMBER, notifyPhoneNumber.getNumber());\n  }\n```\n\n## NotifyPhoneNumber - supportsConferenceCall\\(\\)\n\nDetermines if the Notify phone number supports conference calling.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n<table id=\"table_dcj_qp4_wr\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nBoolean\n\n</td><td>\n\nValue that indicates whether the Notify phone number supports conference calling.-   true: phone number does support conference calling\n-   false: phone number does not support conference calling\n\n</td></tr></tbody>\n</table>This example shows how to determine if a Notify caller supports conference calls.\n\n```\nvar numbers = SNC.Notify.getPhoneNumbers();\n \n// Here numbers is of type List\nif (numbers.size() > 0) {\n   var number = numbers.get(0);\n \n   // Here number is of type NotifyPhoneNumber\n  gs.info(number.supportsConferenceCall());\n}\n```\n\n### Scoped equivalent\n\nTo use the supportsConferenceCall\\(\\) method in a scoped application, use the corresponding scoped method: [Scoped NotifyPhoneNumber - supportsConferenceCall\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/NPNScopedAPI.md).\n\n## NotifyPhoneNumber - supportsIncomingPhoneCall\\(\\)\n\nDetermines if the Notify phone number supports receiving phone calls.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n<table id=\"table_ull_np4_wr\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nBoolean\n\n</td><td>\n\nValue that indicates whether the Notify phone number supports incoming phone calls.-   true: phone number does support incoming phone calls\n-   false: phone number does not support incoming phone calls\n\n</td></tr></tbody>\n</table>This example shows how to determine if a Notify caller can receive incoming phone calls.\n\n```\nvar numbers = SNC.Notify.getPhoneNumbers();\n \n// Here numbers is of type List\nif (numbers.size() > 0) {\n   var number = numbers.get(0);\n \n   // Here number is of type NotifyPhoneNumber\n  gs.info(number.supportsIncomingPhoneCall());\n}\n```\n\n### Scoped equivalent\n\nTo use the supportsIncomingPhoneCall\\(\\) method in a scoped application, use the corresponding scoped method: [Scoped NotifyPhoneNumber - supportsIncomingPhoneCall\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/NPNScopedAPI.md).\n\n## NotifyPhoneNumber - supportsIncomingSMS\\(\\)\n\nDetermines if the Notify phone number supports receiving SMS messages.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n<table id=\"table_x1k_rp4_wr\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nBoolean\n\n</td><td>\n\nValue that indicates whether the Notify phone number supports receiving incoming MMS messages. -   true: phone number does support receiving incoming MMS messages\n-   false: phone number does not support receiving incoming MMS messages\n\n</td></tr></tbody>\n</table>This example shows how to determine if a Notify caller can receive incoming SMS messages.\n\n```\nvar numbers = SNC.Notify.getPhoneNumbers();\n \n// Here numbers is of type List\nif (numbers.size() > 0) {\n   var number = numbers.get(0);\n \n   // Here number is of type NotifyPhoneNumber\n  gs.info(number.supportsIncomingSMS());\n}\n```\n\n### Scoped equivalent\n\nTo use the supportsIncomingSMS\\(\\) method in a scoped application, use the corresponding scoped method: [Scoped NotifyPhoneNumber - supportsIncomingSMS\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/NPNScopedAPI.md).\n\n## NotifyPhoneNumber - supportsOutgoingPhoneCall\\(\\)\n\nDetermines if the Notify phone number supports initiating phone calls.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n<table id=\"table_n5l_4p4_wr\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nBoolean\n\n</td><td>\n\nValue that indicates whether the Notify phone number supports initiating outgoing phone calls.-   true: phone number does support initiating outgoing phone calls\n-   false: phone number does not support initiating outgoing phone calls\n\n</td></tr></tbody>\n</table>This example shows how to determine if a Notify caller can make outgoing phone calls.\n\n```\nvar numbers = SNC.Notify.getPhoneNumbers();\n \n// Here numbers is of type List\nif (numbers.size() > 0) {\n   var number = numbers.get(0);\n \n   // Here number is of type NotifyPhoneNumber\n  gs.info(number.supportsOutgoingPhoneCall());\n}\n```\n\n### Scoped equivalent\n\nTo use the supportsOutgoingPhoneCall\\(\\) method in a scoped application, use the corresponding scoped method: [Scoped NotifyPhoneNumber - supportsOutgoingPhoneCall\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/NPNScopedAPI.md).\n\n## NotifyPhoneNumber - supportsOutgoingSMS\\(\\)\n\nDetermines if the Notify phone number supports sending SMS messages.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n<table id=\"table_hv1_tp4_wr\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nBoolean\n\n</td><td>\n\nValue that indicates whether the Notify phone number supports sending SMS messages.-   true: phone number does support sending SMS messages\n-   false: phone number does not support sending SMS messages\n\n</td></tr></tbody>\n</table>This example shows how to determine if a Notify caller can initiate outgoing SMS messages.\n\n```\nvar numbers = SNC.Notify.getPhoneNumbers();\n \n// Here numbers is of type List\nif (numbers.size() > 0) {\n   var number = numbers.get(0);\n \n   // Here number is of type NotifyPhoneNumber\n  gs.info(number.supportsOutgoingSMS());\n}\n```\n\n### Scoped equivalent\n\nTo use the supportsOutgoingSMS\\(\\) method in a scoped application, use the corresponding scoped method: [Scoped NotifyPhoneNumber - supportsOutgoingSMS\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/NPNScopedAPI.md).\n\n## NotifyPhoneNumber - supportsRecording\\(\\)\n\nDetermines if the Notify phone number supports recording phone calls.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n<table id=\"table_gzm_wp4_wr\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nBoolean\n\n</td><td>\n\nValue that indicates whether the Notify phone number supports recording phone calls.-   true: phone number does support recording phone calls\n-   false: phone number does not support recording phone calls\n\n</td></tr></tbody>\n</table>This example shows how to determine if a Notify caller can record calls.\n\n```\nvar numbers = SNC.Notify.getPhoneNumbers();\n \n// Here numbers is of type List\nif (numbers.size() > 0) {\n   var number = numbers.get(0);\n \n   // Here number is of type NotifyPhoneNumber\n  gs.info(number.supportsRecording());\n}\n```\n\n### Scoped equivalent\n\nTo use the supportsRecording\\(\\) method in a scoped application, use the corresponding scoped method: [Scoped NotifyPhoneNumber - supportsRecording\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/NPNScopedAPI.md).\n\n## NotifyPhoneNumber - supportsWebRTC\\(\\)\n\nDetermines if the Notify phone number supports calls to a browser, such as in a WebRTC implementation.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n<table id=\"table_lfq_vp4_wr\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nBoolean\n\n</td><td>\n\nValue that indicates whether the Notify phone number supports calls to a browser.-   true: phone number does support calls to a browser\n-   false: phone number does not support calls to a browser\n\n</td></tr></tbody>\n</table>This example shows how to determine if a Notify caller can initiate/accept browser-to-browser calls.\n\n```\nvar numbers = SNC.Notify.getPhoneNumbers();\n \n// Here numbers is of type List\nif (numbers.size() > 0) {\n   var number = numbers.get(0);\n \n   // Here number is of type NotifyPhoneNumber\n  gs.info(number.supportsWebRTC());\n}\n```\n\n### Scoped equivalent\n\nTo use the supportsWebRTC\\(\\) method in a scoped application, use the corresponding scoped method: [Scoped NotifyPhoneNumber - supportsWebRTC\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/NPNScopedAPI.md).\n\n"}}