# Welcome to iSlash API Docs

Server REST API Guide

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>Template Message</td><td></td><td></td><td><a href="/pages/byibCHgyMMwVfR0b5gxJ">/pages/byibCHgyMMwVfR0b5gxJ</a></td></tr><tr><td>Session Message</td><td></td><td></td><td><a href="/pages/QCBIgNn4hXwxTIb8mM88">/pages/QCBIgNn4hXwxTIb8mM88</a></td></tr><tr><td>Sticker List</td><td></td><td></td><td><a href="/pages/AbvYaAQ4SotjPRFPZ58P">/pages/AbvYaAQ4SotjPRFPZ58P</a></td></tr><tr><td>Message Status</td><td></td><td></td><td><a href="/pages/WCzzekP7lbM2UPD8IuUP">/pages/WCzzekP7lbM2UPD8IuUP</a></td></tr><tr><td>Broadcast Message</td><td></td><td></td><td><a href="/pages/YX1DdVUilkuF2VKJw8y6">/pages/YX1DdVUilkuF2VKJw8y6</a></td></tr><tr><td>Labels</td><td></td><td></td><td><a href="/pages/WjuZj14BSCV0R3hMnd3L">/pages/WjuZj14BSCV0R3hMnd3L</a></td></tr><tr><td>Schedule Message</td><td></td><td></td><td><a href="/pages/SbxnIx5BN7WHigKg5WzN">/pages/SbxnIx5BN7WHigKg5WzN</a></td></tr></tbody></table>


# Welcome

version 1.0

Other resources available

{% embed url="<https://learn.islash.io/>" %}


# Send Template Message

Sends template messages to your contacts

{% openapi src="/files/SaH2ppEcnLt4qWqHgDf3" path="https\://{ISLASH\_API\_ENDPOINT}/api/public/send-message" method="post" %}
[1.1.send\_template\_message.json](https://3840158533-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPYMAy98rfabp765nSz03%2Fuploads%2Fp3ZUaerBYZxHVPn7smW4%2F1.1.send_template_message.json?alt=media\&token=0fd342eb-1693-4e10-a6cb-9a8ead7c88dd)
{% endopenapi %}


# Get Template Message

{% openapi src="/files/0QhfSpL3gJThhEKRTG6J" path="https\://{ISLASH\_API\_ENDPOINT}/api/public/template-message" method="post" %}
[1.2.get\_template\_message\_v13.json](https://3840158533-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPYMAy98rfabp765nSz03%2Fuploads%2FeGjK03gBlXwYT5VV3WvT%2F1.2.get_template_message_v13.json?alt=media\&token=309e2da2-3dea-4975-98e3-4dfa1381e14f)
{% endopenapi %}

{% code title="Response Example" overflow="wrap" lineNumbers="true" %}

```json
{
    "meta": {
        "code": "RESP_OKAY",
        "message": "Success"
    },
    "data": {
        "templates": [
            {
                "id": 19,
                "emma_template_id": "1457356487940772",
                "namespace": "e0c33801_c325_469b_bdb0_dfd2915b75ea",
                "name": "payment_update_en",
                "components": [
                    {
                        "type": "HEADER",
                        "format": "TEXT",
                        "text": "Payment Update"
                    },
                    {
                        "type": "BODY",
                        "text": "Hello {{1}}, the payment of your order {{2}} has been received"
                    },
                    {
                        "type": "FOOTER",
                        "text": "iSlash"
                    },
                    {
                        "type": "BUTTONS",
                        "buttons": [
                            {
                                "type": "URL",
                                "text": "Order Detail",
                                "url": "https://islash.io/order"
                            },
                            {
                                "type": "PHONE_NUMBER",
                                "text": "Contact Us",
                                "phone_number": "+85298297833"
                            }
                        ]
                    }
                ],
                "language": "en_US",
                "status": "APPROVED",
                "category": "PAYMENT_UPDATE",
                "created_at": 1644220818,
                "updated_at": 1644220818
            }
        ]
    }
}
```

{% endcode %}


# Send Session Message

Sample Response

## Send a message in a session

> 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.

```json
{"openapi":"3.0.0","info":{"title":"iSlash API","version":"1.0.1"},"servers":[{"url":"https://{ISLASH_API_ENDPOINT}/api/public","variables":{"ISLASH_API_ENDPOINT":{"default":"{ISLASH_API_ENDPOINT}","description":"The base hostname for the iSlash API platform."}}}],"paths":{"/send-session-message":{"post":{"summary":"Send a message in a session","description":"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.","parameters":[{"in":"header","name":"X-USER-TOKEN","schema":{"type":"string"},"required":true,"description":"The secret key provided by iSlash for accessing the iSlash API platform."}],"requestBody":{"description":"Message data to send. At least one of text, file, file_url, or sticker_id must be provided.","required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["session","identity"],"properties":{"session":{"type":"string","description":"The session key generated by your admin to control which channel can send messages via the API."},"identity":{"type":"string","description":"The target contact number (e.g., 85256872847)."},"text":{"type":"string","description":"The text message to send. At least one of text, file, file_url, or sticker_id must be provided."},"file":{"type":"string","format":"binary","description":"The file to upload as part of the message. At least one of text, file, file_url, or sticker_id must be provided."},"file_url":{"type":"string","description":"The URL of a file to send. At least one of text, file, file_url, or sticker_id must be provided."},"sticker_id":{"type":"string","description":"The ID of a sticker to send. At least one of text, file, file_url, or sticker_id must be provided."},"quoted_message_id":{"type":"integer","description":"The ID of the message to quote/reply to."}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["meta","data"],"properties":{"meta":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"The response status code."},"message":{"type":"string","description":"A message describing the response status."}}},"data":{"type":"object","required":["message"],"properties":{"message":{"type":"object","required":["id","conversation_id","status","body","direction","is_auto_message","is_forwarded","is_template_message","is_sticker","is_cloned"],"properties":{"id":{"type":"integer","description":"The label ID in the iSlash system."},"conversation_id":{"type":"integer","description":"The conversation ID in iSlash."},"status":{"type":"string","enum":["pending","sent","delivered","received","read","revoked"],"description":"The status of the message."},"body":{"type":"string","description":"The body of the message."},"color":{"type":"string","description":"The color of the label.","nullable":true},"media_type":{"type":"string","description":"The media type of the file, if a file or sticker is sent.","nullable":true},"media_url":{"type":"string","description":"The URL of the media, if a file or sticker is sent.","nullable":true},"sid":{"type":"string","description":"The message ID from WhatsApp.","nullable":true},"direction":{"type":"string","description":"The direction of the message, always 'outbound' when sending."},"is_auto_message":{"type":"boolean","description":"Indicates if the message is automated. Always true."},"is_forwarded":{"type":"boolean","description":"Indicates if the message is forwarded. Always false."},"is_template_message":{"type":"boolean","description":"Indicates if the message is a template. Always false."},"is_sticker":{"type":"boolean","description":"Indicates if a sticker was sent."},"is_cloned":{"type":"boolean","description":"Indicates if the message is cloned. Always false."},"quote_message":{"type":"string","description":"The quoted message, always null.","nullable":true},"media_thumbnail":{"type":"string","description":"The thumbnail path for the media, if a file or sticker is sent.","nullable":true},"media_filename":{"type":"string","description":"The file name of the media, if a file or sticker is sent.","nullable":true},"media_status":{"type":"string","description":"The status of the media, if a file or sticker is sent.","nullable":true},"media_resolution_x":{"type":"integer","description":"The image width in pixels, if an image is sent.","nullable":true},"media_resolution_y":{"type":"integer","description":"The image height in pixels, if an image is sent.","nullable":true},"sent_at":{"type":"integer","description":"The timestamp when the message was sent."},"delivered_at":{"type":"string","description":"The timestamp when the message was delivered, always null.","nullable":true},"received_at":{"type":"string","description":"The timestamp when the message was received, always null.","nullable":true},"read_at":{"type":"string","description":"The timestamp when the message was read, always null.","nullable":true},"read_by":{"type":"string","description":"The user who read the message, always null.","nullable":true},"read_by_user":{"type":"string","description":"The user who read the message, always null.","nullable":true},"revoked_at":{"type":"string","description":"The timestamp when the message was revoked, always null.","nullable":true}}}}}}}}}}}}}}}
```

{% tabs %}
{% tab title="Sending Text" %}

```json
{
    "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
        }
    }
}
```

{% endtab %}

{% tab title="Sending image" %}

```json
{
    "meta": {
        "code": "RESP_OKAY",
        "message": "Success"
    },
    "data": {
        "message": {
            "id": 9127,
            "conversation_id": 246,
            "user": null,
            "user_id": null,
            "contact": null,
            "status": "sent",
            "body": null,
            "media_type": "image/jpeg",
            "media_url": "https://cms.islash.io/media/9127/1649755682845881.jpeg",
            "sid": "gBGGhSlIRoQvAgkCsO17FgACU_E",
            "direction": "outbound",
            "is_auto_message": true,
            "is_forwarded": false,
            "is_template_message": false,
            "is_sticker": false,
            "is_cloned": false,
            "quoted_message": null,
            "media_thumbnail": "https://cms.islash.io/media/9127/thumb/1649755682845881-thumb.jpg",
            "media_filename": "testing.jpg",
            "media_status": "ready",
            "media_resolution_x": 681,
            "media_resolution_y": 425,
            "message_at": 1649755682,
            "sent_at": 1649755682,
            "delivered_at": null,
            "received_at": null,
            "read_at": null,
            "read_by": null,
            "read_by_user": null,
            "revoked_at": null
        }
    }
}

```

{% endtab %}

{% tab title="Sending sticker" %}

```json
{
    "meta": {
        "code": "RESP_OKAY",
        "message": "Success"
    },
    "data": {
        "message": {
            "id": 9128,
            "conversation_id": 246,
            "user": null,
            "user_id": null,
            "contact": null,
            "status": "sent",
            "body": null,
            "media_type": "image/webp",
            "media_url": " https://cms.islash.io/media/9128/1649755748614211.webp",
            "sid": "gBGGhSlIRoQvAgkuFc1lWcIjD8Y",
            "direction": "outbound",
            "is_auto_message": true,
            "is_forwarded": false,
            "is_template_message": false,
            "is_sticker": true,
            "is_cloned": false,
            "quoted_message": null,
            "media_thumbnail": " https://cms.islash.io /media/9128/thumb/1649755748614211.webp",
            "media_filename": "sticker7.webp",
            "media_status": "ready",
            "media_resolution_x": 0,
            "media_resolution_y": 0,
            "message_at": 1649755748,
            "sent_at": 1649755748,
            "delivered_at": null,
            "received_at": null,
            "read_at": null,
            "read_by": null,
            "read_by_user": null,
            "revoked_at": null
        }
    }
}

```

{% endtab %}
{% endtabs %}


# Get Sticker List

{% openapi src="/files/9Toi3aQARo9nkoVg6W6F" path="https\://{ISLASH\_API\_ENDPOINT}/api/public/sticker" method="get" %}
[2.1.get\_sticker\_list.json](https://3840158533-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPYMAy98rfabp765nSz03%2Fuploads%2F5x6DHMavjEciaOakBDa8%2F2.1.get_sticker_list.json?alt=media\&token=69b807dc-aa51-4c35-a19d-334821940404)
{% endopenapi %}

{% code title="Sample Response" lineNumbers="true" %}

```json
{
    "meta": {
        "code": "RESP_OKAY",
        "message": "Success"
    },
    "data": {
        "stickers": [
            {
                "id": 66,
                "name": "sticker7",
                "type": "image/webp",
                "width": 512,
                "height": 512
            },
            {
                "id": 67,
                "name": "sticker5",
                "type": "image/webp",
                "width": 512,
                "height": 512
            }
        ]
    }
}
```

{% endcode %}


# Get Sticker Image

{% openapi src="/files/D3snzu4tKALpQBK6yqto" path="https\://{ISLASH\_API\_ENDPOINT}/api/public/sticker/{id}" method="get" %}
[2.2.get\_sticker\_image.json](https://3840158533-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPYMAy98rfabp765nSz03%2Fuploads%2F0DzI0JBlqLp9wjUm29K4%2F2.2.get_sticker_image.json?alt=media\&token=5702566c-3748-466f-be10-b19ccaae5cbf)
{% endopenapi %}

{% code title="Sample Response" %}

```json
{
    "meta": {
        "code": "RESP_OKAY",
        "message": "Success"
    },
    "data": {
        "stickers": [
            {
                "id": 66,
                "name": "sticker7",
                "type": "image/webp",
                "width": 512,
                "height": 512
            }
        ]
    }
}
```

{% endcode %}


# WhatsApp Channel

When there are new incoming messages, or message status is updated (e.g., sent, read), iSlash will post data to the Webhook URL.

## Incoming

The webhook format is very similar to the official API (<https://developers.facebook.com/docs/whatsapp/api/webhooks/inbound#text-message>), except the profile, wa\_id is not wrapped within contacts, and from, id, timestamp, text\\=, type is not wrapped in messages. If the incoming messages have the same timestamp, you may then use the sequence number to distinguish the sequence. Earlier incoming messages with same timestamp will have smaller sequence.

{% tabs %}
{% tab title="Incoming Text Message" %}

```json
{
    "messages": [
        {
            "profile": {
                "name": "iSlash"
            },
            "wa_id": "85256872847",
            "from": "85256872847",
            "id": "ABGGhSlIRoQvAgo-sL8KNOJ1WUnK",
            "text": {
                "body": "testing"
            },
            "type": "text",
            "sequence": "35500920",
            "timestamp": "1649756854"
        }
    ]
}

```

{% endtab %}

{% tab title="Incoming Image Message" %}

```json
{
    "messages": [
        {
            "image": {
                "sha256": "5b743dde51ec4e888f1b16e9773bafc2a36a4f0e729f2e6f60017623b9fb6069",
                "mime_type": "image/jpeg",
                "id": "5774c685-a393-42d9-a0d2-8e9c57690348"
            },
            "profile": {
                "name": "iSlash"
            },
            "wa_id": "85256872847",
            "from": "85256872847",
            "id": "ABGGhSlIRoQvAgo-sB6rm0wvh_fz",
            "type": "image",
            "sequence": "35546638",
            "timestamp": "1649834056"
        }
    ]
}


```

{% endtab %}
{% endtabs %}

## Other Message Status

Please refer to <https://developers.facebook.com/docs/whatsapp/api/webhooks/inbound> for other incoming message types.

{% tabs %}
{% tab title="Sent" %}

```json
{
    "statuses": [
        {
            "sequence": "35525319",
            "id": "gBGGhSlIRoQvAgkGNTcduk8W2CQ",
            "type": "message",
            "conversation": {
                "origin": {
                    "type": "user_initiated"
                },
                "id": "061ce662fd6f2580cee660e12d5db606"
            },
            "pricing": {
                "pricing_model": "CBP",
                "category": "user_initiated",
                "billable": true
            },
            "recipient_id": "85256872847",
            "status": "delivered",
            "timestamp": "1649812397"
        }
    ]
}

```

{% endtab %}

{% tab title="Delivered" %}

```json
{
    "statuses": [
        {
            "sequence": "35525319",
            "id": "gBGGhSlIRoQvAgkGNTcduk8W2CQ",
            "type": "message",
            "conversation": {
                "origin": {
                    "type": "user_initiated"
                },
                "id": "061ce662fd6f2580cee660e12d5db606"
            },
            "pricing": {
                "pricing_model": "CBP",
                "category": "user_initiated",
                "billable": true
            },
            "recipient_id": "85256872847",
            "status": "delivered",
            "timestamp": "1649812397"
        }
    ]
}

```

{% endtab %}

{% tab title="Read" %}

```json
{
    "statuses": [
        {
            "sequence": "35525462",
            "id": "gBGGhSlIRoQvAgkGNTcduk8W2CQ",
            "type": "message",
            "recipient_id": "85256872847",
            "status": "read",
            "timestamp": "1649812784"
        }
    ]
}

```

{% endtab %}

{% tab title="Failed to send message" %}

```json
{
    "statuses": [
        {
            "sequence": "35526170",
            "id": "gBGGhSlIRoQvAglgL8ey5qg79Q0",
            "type": "message",
            "errors": [
                {
                    "code": 1000,
                    "title": "Error message..."
                }
            ],
            "recipient_id": "85256872847",
            "status": "failed",
            "timestamp": "1649814170"
        }
    ]
}

```

{% endtab %}
{% endtabs %}


# Facebook Channel

When there are new incoming messages, or message status is updated (e.g., sent, read), iSlash will post data to the Webhook URL.

## Incoming

{% tabs %}
{% tab title="Incoming Text Message" %}

```json
{
  "object": "page",
  "entry": [
    {
      "id": "101577621799715",
      "time": 1692603667565,
      "messaging": [
        {
          "sender": {
            "id": "5696251489156017"
          },
          "recipient": {
            "id": "101577621799715"
          },
          "timestamp": 1692603667024,
          "message": {
            "mid": "m_P10R86QejqZGH_elIs8rtx-fllvb5gZ6gtMVyjR2CaW96qcItvaMPY0Os84-jit8H5cVZDdmzXFBRfN3eFqD7A",
            "text": "Hi"
          }
        }
      ]
    }
  ]
}
```

{% endtab %}

{% tab title="Incoming Image Message" %}

```json
{
  "object": "page",
  "entry": [
    {
      "id": "101577621799715",
      "time": 1692604042857,
      "messaging": [
        {
          "sender": {
            "id": "5696251489156017"
          },
          "recipient": {
            "id": "101577621799715"
          },
          "timestamp": 1692604042323,
          "message": {
            "mid": "m_G6TzKnYqb_RBaWeXRZ5EuB-fllvb5gZ6gtMVyjR2CaWyx-7bay6u57dV7nMZ3ZTuEU-vWRFgdhZMAoGA7qrMTA",
            "attachments": [
              {
                "type": "image",
                "payload": {
                  "url": "https://scontent.xx.fbcdn.net/v/t1.15752-9/368869888_252392991033601_1760216338335203218_n.jpg?_nc_cat=101&ccb=1-7&_nc_sid=58c789&_nc_ohc=JrZpInQnHvgAX80hQIK&_nc_ad=z-m&_nc_cid=0&_nc_ht=scontent.xx&oh=03_AdTHtMheWu5-6QJ0NOUj5uPb2w4FxaWCzAr4G_Te_RMHGg&oe=650A9302"
                }
              }
            ]
          }
        }
      ]
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Other Message Status

Please refer to <https://developers.facebook.com/docs/whatsapp/api/webhooks/inbound> for other incoming message types.

{% tabs %}
{% tab title="Delivered" %}

```json
{
    "object": "page",
    "entry": [
        {
            "time": 1692604786155,
            "id": "101577621799715",
            "messaging": [
                {
                    "sender": {
                        "id": "5696251489156017"
                    },
                    "recipient": {
                        "id": "101577621799715"
                    },
                    "timestamp": 1692604786005,
                    "delivery": {
                        "mids": [
                            "m_JiJWPqr36dPtP3qjT-1Bfh-fllvb5gZ6gtMVyjR2CaWeqI38tMhiZGv9vFVv78PsnStQ2O4G4p-dN6K0EgD_zw"
                        ],
                        "watermark": 1692604785165
                    }
                }
            ]
        }
    ]
}

```

{% endtab %}

{% tab title="Read" %}

```json
{
    "object": "page",
    "entry": [
        {
            "time": 1692605250846,
            "id": "101577621799715",
            "messaging": [
                {
                    "sender": {
                        "id": "5696251489156017"
                    },
                    "recipient": {
                        "id": "101577621799715"
                    },
                    "timestamp": 1692605250585,
                    "read": {
                        "watermark": 1692604785165
                    }
                }
            ]
        }
    ]
}
```

{% endtab %}
{% endtabs %}


# Send Broadcast Message

Broadcast template messages to your contacts

{% openapi src="/files/6mm83DGg3Vl6E9iman5M" path="https\://{ISLASH\_API\_ENDPOINT}/api/public/broadcast" method="post" %}
[6.1.send\_broadcast\_message.json](https://3840158533-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPYMAy98rfabp765nSz03%2Fuploads%2FonAtwBZx47Soonfz3jU3%2F6.1.send_broadcast_message.json?alt=media\&token=1f90964f-37e5-48a5-8398-aa4ef6ba5624)
{% endopenapi %}

{% code title="Sample Response" %}

```json
{
    "meta": {
        "code": "RESP_OKAY",
        "message": "Success",
        "trace_id": "040a6b96021b02e3"
    },
    "data": []
}
```

{% endcode %}


# Get Broadcast

Get the status of your broadcast message

{% openapi src="/files/99NrYZgl6vRu3GWZh8mH" path="https\://{ISLASH\_API\_ENDPOINT}/api/public/broadcast/{id}" method="get" %}
[6.2.get\_broadcast.json](https://3840158533-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPYMAy98rfabp765nSz03%2Fuploads%2F5qSVeqiKDNfoKffcSDRS%2F6.2.get_broadcast.json?alt=media\&token=4b600fa2-0915-46c1-902d-3e3ef35e2572)
{% endopenapi %}

{% code title="Sample Response" %}

```json
{
    "meta": {
        "code": "RESP_OKAY",
        "message": "Success",
        "trace_id": "a28d8bd80c5950ce"
    },
    "data": {
        "broadcast": {
            "id": 95,
            "name": "API Broadcast",
            "status": "pending",
            "attach_label": {
                "id": 2,
                "text": "Pending Payment",
                "color": "blue"
            },
            "total_recipients": 2,
            "progress": 0,
            "scheduled_at": 1667793600,
            "started_at": null,
            "ended_at": null,
            "reply_count": {
                "12_hours": 0,
                "24_hours": 0,
                "48_hours": 0
            }
        }
    }
}

```

{% endcode %}


# Get Labels

Get a list of available labels

## Retrieve a list of available labels

> Retrieves a list of available labels in the iSlash system.

```json
{"openapi":"3.0.0","info":{"title":"iSlash API","version":"1.0.1"},"servers":[{"url":"https://{ISLASH_API_ENDPOINT}/api/public","variables":{"ISLASH_API_ENDPOINT":{"default":"{ISLASH_API_ENDPOINT}","description":"The base hostname for the iSlash API platform."}}}],"paths":{"/label":{"get":{"summary":"Retrieve a list of available labels","description":"Retrieves a list of available labels in the iSlash system.","parameters":[{"in":"header","name":"X-USER-TOKEN","schema":{"type":"string"},"required":true,"description":"The secret key provided by iSlash for accessing the iSlash API platform."},{"in":"query","name":"session","schema":{"type":"string"},"required":true,"description":"The session key generated by your admin to control which channel can send messages via the API."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["meta","data"],"properties":{"meta":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"The response status code."},"message":{"type":"string","description":"A message describing the response status."}}},"data":{"type":"object","required":["labels"],"properties":{"labels":{"type":"object","required":["id","text","color"],"properties":{"id":{"type":"integer","description":"The label ID in the iSlash system."},"text":{"type":"string","description":"The name of the label."},"color":{"type":"string","description":"The color of the label.","nullable":true}}}}}}}}}}}}}}}
```

{% code title="Sample Response" %}

```json
{
    "meta": {
        "code": "RESP_OKAY",
        "message": "Success",
        "trace_id": "040a6b96021b42e3"
    },
    "data": {
        "labels": [
            {
                "id": 1,
                "text": "Unassigned",
                "color": "blue"
            },
            {
                "id": 2,
                "text": "Pending Payment",
                "color": "blue"
            },
            {
                "id": 3,
                "text": "Paid",
                "color": "blue"
            }
        ]
    }
}


```

{% endcode %}


# Attach Label

{% openapi src="/files/52yuedXppTYj0FjTXOVQ" path="https\://{ISLASH\_API\_ENDPOINT}/api/public/chat-label" method="post" %}
[7.2.attach label.json](https://3840158533-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPYMAy98rfabp765nSz03%2Fuploads%2Fv8ZxeGeHmYDSCLWspOHG%2F7.2.attach%20label.json?alt=media\&token=d1a8b918-da5a-4901-b921-0cf9072b1ac2)
{% endopenapi %}


# Detach Label

{% openapi src="/files/4Qrr1UXRlncAhOy4P2nO" path="https\://{ISLASH\_API\_ENDPOINT}/api/public/chat-label" method="delete" %}
[7.3.detach label.json](https://3840158533-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPYMAy98rfabp765nSz03%2Fuploads%2FqLn7lBnYrTefVE9I7WTp%2F7.3.detach%20label.json?alt=media\&token=8e730998-a69a-4534-90fb-40515bde6e90)
{% endopenapi %}


# Get Customers By Label IDs

{% openapi src="/files/ilbZLWfXqH5fJVaqKTQ1" path="https\://{ISLASH\_API\_ENDPOINT}/api/public/chat-label/customers" method="post" %}
[7.4.get\_customers\_by\_label.json](https://3840158533-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPYMAy98rfabp765nSz03%2Fuploads%2Ff9y3IoJCvtTseWumxMwO%2F7.4.get_customers_by_label.json?alt=media\&token=44e0edbb-1151-4801-9bac-2cff415acf91)
{% endopenapi %}

{% code title="Response" %}

```json
{
    "meta": {
        "code": "RESP_OKAY",
        "message": "Success"
    },
    "data": {
        "contacts": [
            {
                "id": 5,
                "first_name": "Tom",
                "last_name": "Chan",
                "identity": "85298765432",
                "labels": "Paid,Pending Payment",
                "assigned_to": "User 01"
            }
        ],
        "pagination": {
            "has-more-page": false,
            "per-page": 30
        }
    }
}
```

{% endcode %}


# Get Message By WAMID

## Retrieve a message by WhatsApp Message ID

> Retrieves a specific message from the iSlash system using its WhatsApp Message ID (wamid).

```json
{"openapi":"3.0.0","info":{"title":"iSlash API","version":"1.0.1"},"servers":[{"url":"https://{ISLASH_API_ENDPOINT}/api/public","variables":{"ISLASH_API_ENDPOINT":{"default":"{ISLASH_API_ENDPOINT}","description":"The base hostname for the iSlash API platform."}}}],"paths":{"/message":{"get":{"summary":"Retrieve a message by WhatsApp Message ID","description":"Retrieves a specific message from the iSlash system using its WhatsApp Message ID (wamid).","parameters":[{"in":"header","name":"X-USER-TOKEN","schema":{"type":"string"},"required":true,"description":"The secret key provided by iSlash for accessing the iSlash API platform."},{"in":"query","name":"session","schema":{"type":"string"},"required":true,"description":"The session key generated by your admin to control which channel can access messages via the API."},{"in":"query","name":"wamid","schema":{"type":"string"},"required":true,"description":"The WhatsApp Message ID of the message to retrieve."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["meta","data"],"properties":{"meta":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"The response status code."},"message":{"type":"string","description":"A message describing the response status."}}},"data":{"type":"object","required":["message"],"properties":{"message":{"type":"object","required":["id","conversation_id","status","body","direction"],"properties":{"id":{"type":"integer","description":"The message ID in the iSlash system."},"conversation_id":{"type":"integer","description":"The conversation ID in iSlash."},"status":{"type":"string","enum":["pending","sent","delivered","read","error"],"description":"The status of the message."},"body":{"type":"string","description":"The body of the message."},"media_type":{"type":"string","description":"The media type of the message, if applicable.","nullable":true},"media_url":{"type":"string","description":"The URL of the media, if applicable.","nullable":true},"sid":{"type":"string","description":"The WAMID from WhatsApp.","nullable":true},"direction":{"type":"string","enum":["inbound","outbound","system"],"description":"The direction of the message (inbound, outbound, system)."},"sent_at":{"type":"integer","description":"The timestamp when the message was sent.","nullable":true},"delivered_at":{"type":"integer","description":"The timestamp when the message was delivered.","nullable":true},"received_at":{"type":"integer","description":"The timestamp when the message was received.","nullable":true},"read_at":{"type":"integer","description":"The timestamp when the message was read.","nullable":true}}}}}}}}}}}}}}}
```


# Send Schedule Message

Sends schedule messages to your contacts

{% openapi src="/files/ZNK3l8posErDJBNqrmgv" path="https\://{ISLASH\_API\_ENDPOINT}/api/public/schedule-message" method="post" %}
[8.1.send\_schedule\_message.json](https://3840158533-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPYMAy98rfabp765nSz03%2Fuploads%2FyrYFvKJG7SZrT112shyR%2F8.1.send_schedule_message.json?alt=media\&token=80652c27-32fd-4885-8ee1-ab23343a21b9)
{% endopenapi %}

{% code title="Sample Response" %}

```json
{
    "meta": {
        "code": "RESP_OKAY",
        "message": "Success",
        "trace_id": "040a6b96021b42e3"
    },
    "data": []
}
```

{% endcode %}


# Assign Conversation To User

{% openapi src="/files/x9tWUwXMrNoRnJfPXfmQ" path="https\://{ISLASH\_API\_ENDPOINT}/api/public/chat/assign" method="put" %}
[Assign to user.json](https://3840158533-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPYMAy98rfabp765nSz03%2Fuploads%2FLcINZlpEipZkDexdW6vS%2FAssign%20to%20user.json?alt=media\&token=f26cb7b5-9088-447b-84f2-b703d4d2c8a3)
{% endopenapi %}


# Unassign Conversation From User

{% openapi src="/files/EhL3sDr6wZoFhZ0OMLNk" path="https\://{ISLASH\_API\_ENDPOINT}/api/public/chat/assign" method="put" %}
[Unassign to user.json](https://3840158533-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPYMAy98rfabp765nSz03%2Fuploads%2FJw9GfKl6VroTuUeBCWqz%2FUnassign%20to%20user.json?alt=media\&token=34c645de-cd0b-4875-a69c-df9a68532066)
{% endopenapi %}


# Update Ticket Status

## PUT /chat/ticket-status

>

```json
{"openapi":"3.0.0","info":{"title":"iSlash API","version":"1.0.1"},"servers":[{"url":"https://{ISLASH_API_ENDPOINT}/api/public","variables":{"ISLASH_API_ENDPOINT":{"default":"{ISLASH_API_ENDPOINT}","description":"The base hostname for the iSlash API platform."}}}],"paths":{"/chat/ticket-status":{"put":{"summary":"","parameters":[{"in":"header","name":"X-USER-TOKEN","schema":{"type":"string"},"required":true,"description":"The secret key provided by iSlash for accessing the iSlash API platform"},{"in":"query","name":"session","schema":{"type":"string"},"required":true,"description":"The session key generated by your admin for controlling which channel is allowed to send message across API"},{"in":"query","name":"hash","schema":{"type":"string"},"required":false,"description":"If no identity, this is a must"},{"in":"query","name":"identity","schema":{"type":"string"},"required":false,"description":"If no hash, this is a must"},{"in":"query","name":"type","schema":{"type":"string","enum":["whatsapp","facebook","instagram"]},"required":true,"description":"Chat type"},{"in":"query","name":"status","schema":{"type":"string","enum":["open","closed"]},"required":true,"description":"To update the chat ticket status"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}},"data":{"type":"object","properties":{}}}}}}}}}}}}
```


# Get Users

{% openapi src="/files/UlLVfxGkaks1J2m42tgB" path="https\://{ISLASH\_API\_ENDPOINT}/api/public/user/all" method="get" %}
[Get Users.json](https://3840158533-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPYMAy98rfabp765nSz03%2Fuploads%2FyM1zwEh8te79ByCxHQq4%2FGet%20Users.json?alt=media\&token=83ecf60d-8f77-43c9-9d10-727fb4fe883e)
{% endopenapi %}


