Class MessageRepository

    • Constructor Summary

      Constructors 
      Constructor Description
      MessageRepository​(java.lang.String projectID, java.lang.String apiToken, java.lang.String spaceUrl)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      NewMessageResponse create​(java.lang.String to, java.lang.String from, java.lang.String body)
      Create a new phone number with the below parameters
      NewMessageResponse create​(java.lang.String to, java.lang.String from, java.lang.String body, java.lang.String mediaUrl, java.lang.String statusCallback, java.lang.String validityPeriod)
      Create a new message with the following params
      SuccessResponse delete​(java.lang.String sid)
      Delete a message from a space by SID
      Message get​(java.lang.String sid)
      Get the item of a particular message by SID
      Messages getMessages()
      Get all the messages for the projectId provided
      Messages getMessages​(java.lang.String dateSent, java.lang.String from, java.lang.String to, java.lang.String status, java.lang.String pageSize)
      Get all messages using the following parameters
      NewMessageResponse update​(java.lang.String sid, java.lang.String body)
      Update a message by SID
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MessageRepository

        public MessageRepository​(java.lang.String projectID,
                                 java.lang.String apiToken,
                                 java.lang.String spaceUrl)
    • Method Detail

      • getMessages

        public Messages getMessages​(java.lang.String dateSent,
                                    java.lang.String from,
                                    java.lang.String to,
                                    java.lang.String status,
                                    java.lang.String pageSize)
        Get all messages using the following parameters
        Specified by:
        getMessages in interface MessageInterface
        Parameters:
        dateSent - date message was sent
        from - Phone number sending the message (E164 format)
        to - Destination phone number
        status - Status of the phone number either failed, success or delivered
        pageSize - size of results queried
        Returns:
        Messages
      • create

        public NewMessageResponse create​(java.lang.String to,
                                         java.lang.String from,
                                         java.lang.String body)
        Create a new phone number with the below parameters
        Specified by:
        create in interface MessageInterface
        Parameters:
        to - Destination phone number (E164 format)
        from - Phone number sending the message (E164 format)
        body - body of the message
        Returns:
        NewMessageResponse
      • create

        public NewMessageResponse create​(java.lang.String to,
                                         java.lang.String from,
                                         java.lang.String body,
                                         java.lang.String mediaUrl,
                                         java.lang.String statusCallback,
                                         java.lang.String validityPeriod)
        Create a new message with the following params
        Specified by:
        create in interface MessageInterface
        Parameters:
        to - Destination phone number
        from - Phone number sending the message (E164 format)
        body - body of the message
        mediaUrl - media url if sending an MMS
        statusCallback - monitor status of the message sent
        validityPeriod - period of message validity
        Returns:
        NewMessageResponse
      • get

        public Message get​(java.lang.String sid)
        Get the item of a particular message by SID
        Specified by:
        get in interface MessageInterface
        Parameters:
        sid - unique SID for the phone call
        Returns:
        Message
      • update

        public NewMessageResponse update​(java.lang.String sid,
                                         java.lang.String body)
        Update a message by SID
        Specified by:
        update in interface MessageInterface
        Parameters:
        sid - unique SID for the phone call
        body - body of the message been sent
        Returns:
        NewMessageResponse
      • delete

        public SuccessResponse delete​(java.lang.String sid)
        Delete a message from a space by SID
        Specified by:
        delete in interface MessageInterface
        Parameters:
        sid - unique SID for the phone call
        Returns:
        SuccessResponse