Sidebar Menu

GetMessageStatusByReferenceID

This method returns all messages with a predefined user ReferenceID set in AdvancedSMSSend method.

Request

Parameter Name Data Type Sample Input
ReferenceID: Input unique ID that can be set with the AdvancedSMSSend method. String CDYNE Test

Response

Parameter Name Data Type Sample Output
Cancelled: Returns true or false if the SMS message has been cancelled. Boolean False
MessageID: Returns unique Guid ID for every SMS message sent. Guid B01d89fd-5155-5455-5585-e84ab8de8591
Queued: Returns true or false if the SMS message has been queued. Boolean True
ReferenceID: Returns a unique ID that is assigned during request input. (Not a required Input) String CDYNE Test
SMSError: Returns a string indicating if there was an error sending the SMS message.
  • NoError
  • STOPfromPhoneNumber
  • LicenseKeyInvalid
  • PhoneNumberInvalid
  • MessageInvalid
  • ScheduledDateTimeIsNotUTC
  • InvalidAssignedDID
  • NotFound (Occurs for Invalid MessageID)
  • InternalError
  • ContactCdyneAccountSuspended
String NoError
SMSIncomingMessages: Returns an array of type SMSIncomingMessage SMSIncomingMessage[] See Table Below
Sent: Returns true or false if the SMS message has been sent to the carrier. Boolean False
SentDateTime: Returns the UTC Date and Time of when the message was sent. Datetime 0001-01-01T00:00:00

Code Samples



  <SMSResponse>
    <Cancelled>true</Cancelled>
    <MessageID>1627aea5-8e0a-4371-9022-9b504344e724</MessageID>
    <Queued>true</Queued>
    <ReferenceID>String content</ReferenceID>
    <SMSError>NoError</SMSError>
    <SMSIncomingMessages>
      <SMSIncomingMessage>
        <FromPhoneNumber>String content</FromPhoneNumber>
        <IncomingMessageID>1627aea5-8e0a-4371-9022-9b504344e724</IncomingMessageID>
        <MatchedMessageID>1627aea5-8e0a-4371-9022-9b504344e724</MatchedMessageID>
        <Message>String content</Message>
        <ResponseReceiveDate>1999-05-31T11:20:00</ResponseReceiveDate>
        <ToPhoneNumber>String content</ToPhoneNumber>
      </SMSIncomingMessage>
      <SMSIncomingMessage>
        <FromPhoneNumber>String content</FromPhoneNumber>
        <IncomingMessageID>1627aea5-8e0a-4371-9022-9b504344e724</IncomingMessageID>
        <MatchedMessageID>1627aea5-8e0a-4371-9022-9b504344e724</MatchedMessageID>
        <Message>String content</Message>
        <ResponseReceiveDate>1999-05-31T11:20:00</ResponseReceiveDate>
        <ToPhoneNumber>String content</ToPhoneNumber>
      </SMSIncomingMessage>
    </SMSIncomingMessages>
    <Sent>true</Sent>
    <SentDateTime>1999-05-31T11:20:00</SentDateTime>
  </SMSResponse>
  
GetMessageStatusByReferenceID.WSDL.IsmsClient client = new GetMessageStatusByReferenceID.WSDL.IsmsClient("sms2wsHttpBinding");
GetMessageStatusByReferenceID.WSDL.SMSResponse[] resp = client.GetMessageStatusByReferenceID("123456", new Guid("YOUR LICENSE KEY"));
foreach (var item in resp)
{
Console.WriteLine(item.MessageID+" " + item.SentDateTime + " " + item.SMSError);
}
Console.ReadLine(); 
Client.Close();
require 'net/http'
require 'URI' 
puts URI.methods 
url = URI.parse('http://sms2.cdyne.com/sms.svc/GetMessageStatusByReferenceID?ReferenceID=123456&LicenseKey=YOUR LICENSE KEY')
res = Net::HTTP.get_response(url) 
data = res.body 
puts data
gets data
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL; 
import java.util.Properties;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;

public final class GetMessageStatusByReferenceID{     
    public static void main(String[] args) { 	
	
    try{		
    URL url = new URL("http://sms2.cdyne.com/sms.svc/GetMessageStatus?"
                       + "ReferenceID=12346"
                       + "&LicenseKey=YOUR LICENSE KEY");		
    try{			
    InputStream in = url.openStream(); 
    StreamSource source = new StreamSource(in); 			
    printResult(source);	
    }catch(java.io.IOException e){			
        e.printStackTrace();		
    }		
    }catch (MalformedURLException e){		
        e.printStackTrace();	
                }     
            }     
            private static void printResult(Source source) {        
                try {            
                ByteArrayOutputStream bos = new ByteArrayOutputStream();
                StreamResult sr = new StreamResult(bos);
                Transformer trans = TransformerFactory.newInstance().newTransformer();
                Properties oprops = new Properties();
                oprops.put(OutputKeys.OMIT_XML_DECLARATION, "yes");
                trans.setOutputProperties(oprops);
                trans.transform(source, sr);            
                System.out.println("**** Response ******"); 
                System.out.println(bos.toString());
                                
               bos.close();
               System.out.println();        
        } catch (Exception e) {            
                }    
        }
}