📌
Netcore - WhatsApp Business API
  • Introduction
  • Getting Started for business
  • Whatsapp use cases (Templates)
    • Ecommerce
    • Travel
    • Broking /Securities
    • Banks
    • Mutual Funds
    • Insurance
    • Automobile
    • Media/Events
    • Education
  • Error Codes
  • API for developers
    • Consent API
      • Manage Opt IN /Opt OUT
    • Message API
      • Send Text message
      • Send Media message
        • Send Media message using Media ID
        • Send Media message using URL
      • Send Location message
    • Template Message API
      • Template Message API
    • Media API
      • Upload Media
      • Get Media
      • Delete Media
  • Webhooks
    • Delivery Message
    • Incoming Message
      • Incoming message-media
      • Incoming message location
      • Incoming message-text
  • Button Feature
  • Encryption
  • Reports
    • Delivery reports
    • Conversation Logs
  • FAQs
    • Getting started
    • Accepting Netcore WA request
    • Getting Business manager verified
    • Getting Opt ins
    • Message Templates
    • Allowed Notification types
    • Registration
    • Whatsapp language settings
    • Disallowed notification types
    • Quality rating and message limits
    • Message templates
    • Media in whatsapp
    • Miscellaneous queries
  • Contact Us
Powered by GitBook
On this page
  • Parameters:
  • Request Body
  • Responses for message API

Was this helpful?

  1. API for developers
  2. Message API
  3. Send Media message

Send Media message using URL

PreviousSend Media message using Media IDNextSend Location message

Last updated 4 years ago

Was this helpful?

This endpoint sends a media message to a phone number on WhatsApp.

Please note: We can only send a media message if the recipient has initiated the conversation.

URL:​ ​

Method: POST

Parameters:

Parameter

Description

Data Type

Required

recipient_whatsapp

Recipient’s phone number. Must be a valid number. Phone number must include a country code otherwise message might not get delivered.

String

Yes

recipient_type

Indicate whether the recipient is an individualor a group.

Specifying recipient_type in the request is optional when the value is individual. However, recipient_type is required when using group.

String

No

message_type

Pass media as the type of the message.

String

Yes

source

Source id of the origin. Source id must be valid and obtained from source creation API.

String

No

attachment_url

The URL where the media is hosted

String

Yes​

attachment_type

Indicate the type of media being shown to the recipient.

Allowed values : image video audio document sticker

String

Yes

caption

The caption to be given for attachment

String

No

x-apiheader

Any custom data which user needs to send. ​ X-apiheader can be used instead of message id for mapping messages.

String

No

Request Body

{ 
  "message": [
  { 
    "recipient_whatsapp": "919833078369", 
    "message_type": "media", 
    "recipient_type": "individual", 
    "source": "fa9d647a-c8d7-423e-bd27-7d2ca2875dc1",
    "x-apiheader": "Your_unique_identifier", 
    "type_media": [
      { 
      "attachments": [
          { 
          "attachment_url": "https://img.freepik.com/free-vector/triangular-dark-polygonal-background_23-2148261453.jpg", 
          "attachment_type": "image",
          "caption": "yourdocumentcaption" 
          }
      ] 
      }
    ] 
  }
  ] 
} 
  

Responses for message API

In case of success

{ 
   "status": "success", 
   "message": "Request received successfully.", 
   "data": { 
       "id": "6929d4af-490d-454a-8cf3-0502a3506f09" 
   } 
} 

This id in response is message id for future response. All the message status updates on webhook will be mapped to this id. So store this message id at your side.

In case of failure

{ 
   "status": "failure", 
   "error": { 
       "code": "8006", 
       "message": " type is required." 
   } 
} 

According to error code and message will change.

https://waapi.pepipost.com/api/v2/message/