Method: SMSSend#queryDeliveryStatus

Defined in:
lib/sms/SMSSend.rb

#queryDeliveryStatus(senderAddress, requestId) ⇒ Object



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/sms/SMSSend.rb', line 87

def queryDeliveryStatus(senderAddress,requestId)
  baseurl=@endpoints.getQuerySMSDeliveryEndpoint()
  requestProcessor=JSONRequest.new()
  if baseurl.index('{senderAddress}')!=nil then
    baseurl=baseurl.gsub('{senderAddress}',CGI::escape(senderAddress.to_s))
  end
  if baseurl.index('{requestId}')!=nil then
    baseurl=baseurl.gsub('{requestId}',CGI::escape(requestId.to_s))
  end
  rawresponse=requestProcessor.get(baseurl,'application/json', @username, @password)
  response=SMSSendDeliveryStatusResponse.new()
  if (rawresponse!=nil) && (rawresponse.getContent()!=nil)
    jsondata=JSON.parse(rawresponse.getContent())
    if (jsondata!=nil) && (jsondata['deliveryInfoList']!=nil) then
      response.setDeliveryInfoListJSON(jsondata['deliveryInfoList'])
    end
  end
  if rawresponse.getCode()!=nil then
    response.setHTTPResponseCode(rawresponse.getCode())
  end
  if rawresponse.getLocation()!=nil then
    response.setLocation(rawresponse.getLocation())
  end
  if rawresponse.getContentType()!=nil then
    response.setContentType(rawresponse.getContentType())
  end
  return response
end