使用SQL Server发送批量语音

使用SQL Server向一组座机或手机发送语音消息


例子中 SQL Server:

sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Ole Automation Procedures', 1;
GO
RECONFIGURE;
GO
DECLARE @class varchar(500) = 'voice';
DECLARE @method varchar(500) = 'sendvoicetogroup';
DECLARE @user varchar(500) = 'user';
DECLARE @password varchar(500) = 'password';
DECLARE @from varchar(500) = '34900000000';
DECLARE @countrycode varchar(500) = '34';
DECLARE @idgroup varchar(500) = '1';
DECLARE @message varchar(500) = 'sms+test';
DECLARE @scheduledatetime varchar(500) = '';
DECLARE @output varchar(500) = '';
DECLARE @url varchar(255) = 'https://www.afilnet.com/api/http/?class='+@class+'&method='+@method+'&user='+@user+'&password='+@password+'&from='+@from+'&countrycode='+@countrycode+'&idgroup='+@idgroup+'&message='+@message+'&scheduledatetime='+@scheduledatetime+'&output='+@output;
DECLARE @win int
DECLARE @hr  int
DECLARE @text varchar(8000)

EXEC @hr=sp_OACreate 'WinHttp.WinHttpRequest.5.1',@win OUT
IF @hr <> 0 EXEC sp_OAGetErrorInfo @win

EXEC @hr=sp_OAMethod @win, 'Open',NULL,'GET',@url,'false'
IF @hr <> 0 EXEC sp_OAGetErrorInfo @win

EXEC @hr=sp_OAMethod @win,'Send'
IF @hr <> 0 EXEC sp_OAGetErrorInfo @win

EXEC @hr=sp_OAGetProperty @win,'ResponseText',@text OUTPUT
IF @hr <> 0 EXEC sp_OAGetErrorInfo @win

EXEC @hr=sp_OADestroy @win
IF @hr <> 0 EXEC sp_OAGetErrorInfo @win



请参阅以下示例:

PHP Java C sharp Unix Ruby on Rails Python Android Objective C / iPhone SQL Server Oracle Node JS Go Scala Swift


将文本语音转换发送给一组收件人


参数描述必修/可选
class=voice要求的课程:要求的课程必修
method=sendvoicetogroup请求的类方法:发出请求的类的方法必修
user您的Afilnet帐户的用户和电子邮件必修
password您的Afilnet帐户的密码必修
fromvoice.sendvoicetogroup_from必修
countrycodevoice.sendvoicetogroup_countrycode必修
idgroupvoice.sendvoicetogroup_idgroup必修
messagevoice.sendvoicetogroup_message必修
scheduledatetimevoice.sendvoicetogroup_scheduledatetime可选的
output结果的输出格式可选的

发出请求时,您将收到以下字段:

  •  status
  •  结果(如果status = success),您将在此处收到以下值:
    • id
    • count
    • credits
    • destinations
      • messageid
      • destination
  •  错误(如果status = error),在这里您将收到错误代码

下面列出了可能的错误代码

描述
MISSING_USER不包括用户或电子邮件
MISSING_PASSWORD不包含密码
MISSING_CLASS不包括课程
MISSING_METHOD不包括方法
MISSING_COMPULSORY_PARAM不包括强制参数
INCORRECT_USER_PASSWORD用户或密码错误
INCORRECT_CLASS班级不正确
INCORRECT_METHOD方法不正确
NOT_ACCESS_TO_GROUP不允许您进入指定的组
NO_CREDITS您的余额不足
参数:
  • class: voice
  • method: sendvoicetogroup
  • user: user
  • password: password
  • from: 34900000000
  • countrycode: 34
  • idgroup: 1
  • message: sms+test
  • scheduledatetime:
  • output:
请求:
https://www.afilnet.com/api/http/?class=voice&method=sendvoicetogroup&user=user&password=password&from=34900000000&countrycode=34&idgroup=1&message=sms+test&scheduledatetime=&output=
有关Cookie的重要信息:如果您继续使用本网站,我们将假定您接受使用条款。您可以在我们的Cookies政策中找到更多信息. 继续