Skip to main content

API Spec for LimeChat Outbound Messaging — Direct Messaging

If you own a store that is on some other platform than Shopify, you will have to follow the below-mentioned steps to send the outbound message.

  • We recommend using the Postman API tool for this. Since you will have to add some values and parameters in the API to get the proper response and trigger the outbound message.
  • For doing so, we need the API access token from the LimeChat Dashboard. The API access token can be found in the LimeChat dashboard. Follow the below steps:
  1. Login to the LimeChat dashboard.

  2. At the extreme bottom left, you will see 3 dots, please click on it.

    Image
  3. Click on Profile Settings.

    Image
  4. In this tab, scroll to the extreme bottom, and there you will find the Access Token.

    Image
  5. So now that you’ve found the API Access Token, the next step would be hitting the Endpoint in the Postman. Below is the Endpoint we need to hit for sending the Outbound message.

  • It would be the POST request.

Endpoint: POST https://app.limechat.ai/api/v1/accounts/125/store_notifications/create_notification_limekit/

  • Where 125 is the account-id, you can find it in the Limechat Dashboard, refer to the screenshot below.(Please make sure to change the account-id)

    Image
  1. Open Postman API. In the request Headers, add a new KEY VALUE pair as follows:

    • VALUE will consist of the API access token (from Step 4 above).
    KEYVALUE
    api_access_token
Image
  1. After you’re done adding the Headers, you need to add the Body content now. The Body content would be in the JSON format. Shown below is the Body content.

    • “phone”, “template_id”, & “template_attributes” are the mandatory fields.
    {
    "phone": "919123456789", // (Required) Standard format ("919123456789") no spaces and special characters
    "template_id": "112", // (Required) template id of the template which you want to send out. you can find this right beside the template name on the LC Dashboard in Settings > Templates
    "first_name": "Akshay", // (Optional). If provided, the conversation in the dashboard will store this for ease of use to agents.
    "email": "[abcxyz@](mailto:akshay.murkute@limechat.ai)gmail.com", // (Optional). If provided, the conversation in the dashboard will store this for ease of use to agents.
    "template_attributes": ["Akshay", "[https://app.limechat.ai/](https://app.limechat.ai/)"], // (Required)
    "status": "closed", // (Optional), this will define the status of the newly created conversation. It accepts following values: ["open", "closed", "resolved"]
    "additional_attributes": {}, // (Optional) accepts an JSON object to store additional attributes about the conversation in LC Database
    "contact_additional_attributes": {}, // (Optional) accepts an JSON object to store additional attributes about the contact created in LC Database
    "label": "" // Optional. This denotes the type of store notification: abandoned-checkout, re-order, etc. If provided, this label will be applied to the conversation in the dashboard. This would be helpful for analytics.
    }
    • What are “template_attributes” in the Body content?
      • These are the variables that your template consists of. Eg. The below given is your template & it has 2 variables.(Variables are denoted by {{1}}, {{2}},.....)

      • So in such cases, you will have to provide the values for the variables in front of them only. The number of variables present in the template should be directly proportional to the number of values provided for them. If not, then it will throw an error.

      • Example:. "template_attributes": ["Akshay", "https://app.limechat.ai/"],

        Hi {{1}} 🙋🏻🙋🏻‍♀️

        Greetings from Brand Name! Please let us know if you face any trouble checking out on our website 👀

        Click on the link below to checkout instantly 🚀 {{2}}

  2. Finally, now that you’re done adding the body content and the variable values to template_attributes, just click on Send button in the Postman. If everything you entered is correct, then it will give a response as Success and the message will be sent.

    Image

To fetch templates

Endpoint: GET https://app.limechat.ai/api/v1/accounts/{account_id}/templates

  • This will return all the templates that are approved and are available on the LimeChat Dashboard.

  • The Headers would be the same. Now the Body Content would remain empty since we are fetching the details and not sending anything.

    Image
Image

Note:

  • Make use of the new version of the API.
  • We do have the older version of the API as well.
  • New endpoint for Outbound internal api:

OLD

/api/v1/accounts/:account_id/store_notifications/create_notification_message

NEW

/api/v1/accounts/:account_id/store_notifications/create_notification_limekit

Checks on the new outbound endpoint:

  1. Case1: Success (All required params are correct)

    Image
  2. Case 2: Template Attribute with blank text

    Image
  3. Case 3: Invalid Number of Template Attributes

    Image
    Image
  4. Case 4: Invalid Template Id

    Image