POST
/
api
/
send
/
media
curl --request POST \
  --url https://swiftchats.axis96.xyz/api/send/media \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "phone": "+254720055819",
  "media_type": "image",
  "media_url": "https://images.pexels.com/photos/276267/pexels-photo-276267.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2",
  "caption": "your caption for image or video media types",
  "file_name": "testFile"
}'
{
  "statusCode": 200,
  "data": {
    "success": true,
    "data": {
      "messaging_product": "whatsapp",
      "contacts": [
        {
          "input": "+254720055819",
          "wa_id": "254720055819"
        }
      ],
      "messages": [
        {
          "id": "wamid.HBgMMjU0NzIwMDU1ODE5FQIAERgSMzJEODk0QjY5MDdENDk1RTNCAA=="
        }
      ],
      "chat": {
        "id": 13,
        "uuid": "d3479935-7aac-43de-8dc3-8568d04b0104",
        "organization_id": 3,
        "wam_id": "wamid.HBgMMjU0NzIwMDU1ODE5FQIAERgSMzJEODk0QjY5MDdENDk1RTNCAA==",
        "contact_id": 1,
        "user_id": null,
        "type": "outbound",
        "metadata": "{\"id\":\"wamid.HBgMMjU0NzIwMDU1ODE5FQIAERgSMzJEODk0QjY5MDdENDk1RTNCAA==\",\"type\":\"image\",\"image\":{\"mime_type\":\"image\\/jpeg\"}}",
        "media_id": 2,
        "status": "sent",
        "deleted_by": null,
        "deleted_at": null,
        "created_at": "2024-06-28 16:44:34",
        "contact": {
          "id": 1,
          "uuid": "3d3f9de5-52eb-412c-93aa-1e66a6a86489",
          "organization_id": 3,
          "first_name": "John",
          "last_name": "Doe",
          "phone": "+254720055819",
          "email": null,
          "avatar": "/media/public/9ZiTT2SWyPoIj5TdHQl2VF7Xgy9JoaBNjH19vEWh.jpg",
          "address": "{\"street\":null,\"city\":null,\"state\":null,\"zip\":null,\"country\":null}",
          "metadata": "null",
          "contact_group_id": null,
          "is_favorite": 0,
          "created_by": 6,
          "created_at": "2024-06-07 19:58:35",
          "updated_at": "2024-06-07 19:58:35",
          "deleted_at": null,
          "full_name": "John Doe",
          "formatted_phone_number": "+254 720 055819"
        },
        "media": {
          "id": 2,
          "name": "testFile",
          "path": "https://images.pexels.com/photos/276267/pexels-photo-276267.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2",
          "location": "amazon",
          "type": "image/jpeg",
          "size": "517102",
          "created_at": "2024-06-28 16:44:34"
        }
      }
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json · object

Response

200 - application/json
OK

The response is of type object.