{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":900,"path":"api-reference/server-api-reference/SMSPreferenceHandlerAPI.md","title":"SMSPreferenceHandlerSNC - Scoped, Global","bundle":null,"doc_type":null,"release":"australia","body":"\n# SMSPreferenceHandlerSNC - Scoped, Global\n\nThe SMSPreferenceHandler script include provides methods to manage short message service \\(SMS\\) configurations.\n\nThis script include is implemented as the script include SMSPreferenceHandlerSNC and resides in the `sn_sms_pref` namespace. To use this API you must install the Notify plugin \\(com.snc.notify\\) which requires a separate subscription. You can activate this plugin if you have the admin role.\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## SMSPreferenceHandlerSNC - SMSPreferenceHandler\\(String provider\\)\n\nInstantiates the SMSPreferenceHandler script include object.\n\n|Name|Type|Description|\n|----|----|-----------|\n|provider|String|Name of the telephony service provider.|\n\n```\nvar handler = new sn_sms_pref.SMSPreferenceHandler('TwilioDirect'); // Pass the provider name\nvar config = handler.getConfig();\n```\n\n## SMSPreferenceHandlerSNC - getConfig\\(\\)\n\nReturns the preferences configuration record for the current telephony service provider.\n\nThe method queries all preference configuration records from the SMS Preference Configuration \\[sn\\_sms\\_pref\\_configuration\\] table for the current telephony service provider, sorts the results by the Order field \\(lowest to highest\\), and then returns the first record.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|GlideRecord|Preference configuration record for the current telephony service provider. If no record exists, then null.|\n\n```\nvar handler = new sn_sms_pref.SMSPreferenceHandler('TwilioDirect'); // Pass the provider name\nvar config = handler.getConfig();\n```\n\n"}}