Send Session Message

Sample Response

Send a message in a session

post

Sends a message to a specified contact number within a session. You can send a file along with text, but ensure that the message contains at least one of the following: text, file, file URL, or sticker.

Query parameters
sessionstringRequired

The session key generated by your admin to control which channel can send messages via the API.

identitystringRequired

The target contact number (e.g., 85256872847).

textstringOptional

The text message to send. At least one of text, file, file_url, or sticker_id must be provided.

filestringOptional

The file to send. At least one of text, file, file_url, or sticker_id must be provided. If you want to use this field with File please use the "multipart/form-data" content type and file format (binary file).

file_urlstringOptional

The URL of a file to send. At least one of text, file, file_url, or sticker_id must be provided.

sticker_idstringOptional

The ID of a sticker to send. At least one of text, file, file_url, or sticker_id must be provided.

Header parameters
X-USER-TOKENstringRequired

The secret key provided by iSlash for accessing the iSlash API platform.

Body
filestring · binaryOptional

The file to upload as part of the message.

Responses
200

Success

application/json
post
POST /api/public/send-session-message HTTP/1.1
Host: {islash_api_endpoint}
X-USER-TOKEN: text
Content-Type: multipart/form-data
Accept: */*
Content-Length: 17

{
  "file": "binary"
}
200

Success

{
  "meta": {
    "code": "text",
    "message": "text"
  },
  "data": {
    "message": {
      "id": 1,
      "conversation_id": 1,
      "status": "pending",
      "body": "text",
      "color": "text",
      "media_type": "text",
      "media_url": "text",
      "sid": "text",
      "direction": "text",
      "is_auto_message": true,
      "is_forwarded": true,
      "is_template_message": true,
      "is_sticker": true,
      "is_cloned": true,
      "quote_message": "text",
      "media_thumbnail": "text",
      "media_filename": "text",
      "media_status": "text",
      "media_resolution_x": 1,
      "media_resolution_y": 1,
      "sent_at": 1,
      "delivered_at": "text",
      "received_at": "text",
      "read_at": "text",
      "read_by": "text",
      "read_by_user": "text",
      "revoked_at": "text"
    }
  }
}
{
    "meta": {
        "code": "RESP_OKAY",
        "message": "Success"
    },
    "data": {
        "message": {
            "id": 9126,
            "conversation_id": 246,
            "user": null,
            "user_id": null,
            "contact": null,
            "status": "sent",
            "body": "Hello Testing",
            "media_type": null,
            "media_url": null,
            "sid": "gBGGhSlIRoQvAgn-vsCRNiIMutE",
            "direction": "outbound",
            "is_auto_message": true,
            "is_forwarded": false,
            "is_template_message": false,
            "is_sticker": false,
            "is_cloned": false,
            "quoted_message": null,
            "media_thumbnail": null,
            "media_filename": null,
            "media_status": null,
            "media_resolution_x": null,
            "media_resolution_y": null,
            "message_at": 1649755452,
            "sent_at": 1649755452,
            "delivered_at": null,
            "received_at": null,
            "read_at": null,
            "read_by": null,
            "read_by_user": null,
            "revoked_at": null
        }
    }
}

Last updated