Class Referral

java.lang.Object
com.vonage.client.JsonableBaseObject
com.vonage.client.messages.whatsapp.Referral
All Implemented Interfaces:
Jsonable

public final class Referral extends JsonableBaseObject
This is only present for situations where a user has clicked on a 'WhatsApp' button embedded in an advertisement or post on Facebook. Clicking on the button directs the user to the WhatsApp app from where they can send a message. The inbound message will contain this object which includes details of the Facebook advertisement or post which contained the embedded button. This is used in InboundMessage.getWhatsappReferral().
Since:
8.1.0
  • Method Details

    • getBody

      public String getBody()
      Body text of the referring advertisement or post.
      Returns:
      The referral body.
    • getHeadline

      public String getHeadline()
      Headline text of the referring advertisement or post.
      Returns:
      The referral headline.
    • getClickId

      public String getClickId()
      The click ID of the advertisement or post.
      Returns:
      The ctwa_clid, or null if absent / unknown / not applicable.
      Since:
      8.11.0
    • getSourceId

      public String getSourceId()
      Meta/WhatsApp ID of the referring advertisement or post.
      Returns:
      The source referral ID as a String.
    • getSourceType

      The type of the referring advertisement or post.
      Returns:
      The source referral type as a String.
    • getMediaType

      The type of media shown in the advertisement or post. Either MessageType.IMAGE or MessageType.VIDEO.
      Returns:
      The media type as an enum, or null if absent / not applicable.
      Since:
      8.11.0
    • getSourceUrl

      public URI getSourceUrl()
      A URL referencing the content of the media shown in the advertisement when the user clicked to send a message.
      Returns:
      Link to the advertised content.
    • getImageUrl

      public URI getImageUrl()
      URL of the image shown in the advertisement or post.
      Returns:
      The image URL, or null if absent / not applicable.
      Since:
      8.11.0
    • getVideoUrl

      public URI getVideoUrl()
      URL of the video shown in the advertisement or post.
      Returns:
      The video URL, or null if absent / not applicable.
      Since:
      8.11.0
    • getThumbnailUrl

      public URI getThumbnailUrl()
      URL of the thumbnail image shown in the advertisement or post.
      Returns:
      The thumbnail URL, or null if absent / not applicable.
      Since:
      8.11.0