{
  "info": {
    "name": "Botinx Public API",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "_postman_id": "dff0934a-c35d-41c6-af27-5ecadc4ec574"
  },
  "item": [
    {
      "name": "Health",
      "item": [
        {
          "name": "Public API health",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/public/v1/health",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "public",
                "v1",
                "health"
              ]
            },
            "description": ""
          }
        }
      ]
    },
    {
      "name": "Templates",
      "item": [
        {
          "name": "Create template",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/public/v1/templates",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "public",
                "v1",
                "templates"
              ]
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"channel_id\": \"{{channel_id}}\",\n  \"name\": \"api_order_update\",\n  \"language\": \"en_US\",\n  \"category\": \"UTILITY\",\n  \"template_type\": \"STANDARD\",\n  \"body\": \"Hello {{1}}, your order {{2}} is confirmed.\",\n  \"example_body_values\": [\n    \"Gajanand\",\n    \"ORD-1001\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Fetch / search templates",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/public/v1/templates?channel_id={{channel_id}}&status=APPROVED&search=",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "public",
                "v1",
                "templates?channel_id={{channel_id}}&status=APPROVED&search="
              ]
            },
            "description": ""
          }
        },
        {
          "name": "Retrieve template by id or name",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/public/v1/templates/{{template_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "public",
                "v1",
                "templates",
                "{{template_id}}"
              ]
            },
            "description": ""
          }
        },
        {
          "name": "Template analytics",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/public/v1/templates/analytics?template_name=send_otp",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "public",
                "v1",
                "templates",
                "analytics?template_name=send_otp"
              ]
            },
            "description": ""
          }
        }
      ]
    },
    {
      "name": "Send template messages",
      "item": [
        {
          "name": "Send simple text template",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/public/v1/messages/template",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "public",
                "v1",
                "messages",
                "template"
              ]
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"to\": \"{{to_phone}}\",\n  \"template_name\": \"test\",\n  \"language\": \"en_US\",\n  \"channel_id\": \"{{channel_id}}\",\n  \"template_params\": {},\n  \"contact\": {\n    \"name\": \"Gajanand\",\n    \"tags\": [\n      \"api\"\n    ]\n  },\n  \"client_reference_id\": \"text_{{$timestamp}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Send body params template",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/public/v1/messages/template",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "public",
                "v1",
                "messages",
                "template"
              ]
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"to\": \"{{to_phone}}\",\n  \"template_name\": \"meta_test\",\n  \"language\": \"en\",\n  \"channel_id\": \"{{channel_id}}\",\n  \"template_params\": {\n    \"body\": [\n      \"Gajanand\"\n    ]\n  },\n  \"contact\": {\n    \"name\": \"Gajanand\",\n    \"tags\": [\n      \"api\"\n    ]\n  },\n  \"client_reference_id\": \"body_{{$timestamp}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Send OTP copy-code template",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/public/v1/messages/template",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "public",
                "v1",
                "messages",
                "template"
              ]
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"to\": \"{{to_phone}}\",\n  \"template_name\": \"send_otp\",\n  \"language\": \"en_US\",\n  \"channel_id\": \"{{channel_id}}\",\n  \"template_params\": {\n    \"body\": [\n      \"123456\"\n    ]\n  },\n  \"contact\": {\n    \"name\": \"Gajanand\",\n    \"tags\": [\n      \"api\",\n      \"otp\"\n    ]\n  },\n  \"client_reference_id\": \"otp_{{$timestamp}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Send image header template",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/public/v1/messages/template",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "public",
                "v1",
                "messages",
                "template"
              ]
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"to\": \"{{to_phone}}\",\n  \"template_name\": \"send_new_enquiry_with_image\",\n  \"language\": \"en_US\",\n  \"channel_id\": \"{{channel_id}}\",\n  \"template_params\": {\n    \"header\": {\n      \"link\": \"https://example.com/sample.jpg\"\n    },\n    \"body\": [\n      \"Gajanand\",\n      \"Thanks for your enquiry\"\n    ]\n  },\n  \"contact\": {\n    \"name\": \"Gajanand\"\n  },\n  \"client_reference_id\": \"image_{{$timestamp}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Send document header template",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/public/v1/messages/template",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "public",
                "v1",
                "messages",
                "template"
              ]
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"to\": \"{{to_phone}}\",\n  \"template_name\": \"send_enquiry_with_pdf\",\n  \"language\": \"en_US\",\n  \"channel_id\": \"{{channel_id}}\",\n  \"template_params\": {\n    \"header\": {\n      \"link\": \"https://example.com/sample.pdf\",\n      \"filename\": \"proposal.pdf\"\n    },\n    \"body\": [\n      \"Gajanand\",\n      \"Please check attached proposal\"\n    ]\n  },\n  \"contact\": {\n    \"name\": \"Gajanand\"\n  },\n  \"client_reference_id\": \"doc_{{$timestamp}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Send dynamic URL / quick reply template",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/public/v1/messages/template",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "public",
                "v1",
                "messages",
                "template"
              ]
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"to\": \"{{to_phone}}\",\n  \"template_name\": \"send_new_enquiry\",\n  \"language\": \"en_US\",\n  \"channel_id\": \"{{channel_id}}\",\n  \"template_params\": {\n    \"body\": [\n      \"Gajanand\",\n      \"Message text\"\n    ],\n    \"buttons\": [\n      {\n        \"index\": 0,\n        \"sub_type\": \"quick_reply\",\n        \"param\": \"reply_payload\"\n      }\n    ]\n  },\n  \"contact\": {\n    \"name\": \"Gajanand\"\n  },\n  \"client_reference_id\": \"button_{{$timestamp}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Send carousel template",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/public/v1/messages/template",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "public",
                "v1",
                "messages",
                "template"
              ]
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"to\": \"{{to_phone}}\",\n  \"template_name\": \"crousel\",\n  \"language\": \"en_US\",\n  \"channel_id\": \"{{channel_id}}\",\n  \"template_params\": {\n    \"carousel\": [\n      {\n        \"card_index\": 0,\n        \"header\": {\n          \"link\": \"https://example.com/card1.jpg\"\n        },\n        \"buttons\": [\n          {\n            \"index\": 0,\n            \"sub_type\": \"quick_reply\",\n            \"param\": \"card_1\"\n          }\n        ]\n      },\n      {\n        \"card_index\": 1,\n        \"header\": {\n          \"link\": \"https://example.com/card2.jpg\"\n        },\n        \"buttons\": [\n          {\n            \"index\": 0,\n            \"sub_type\": \"quick_reply\",\n            \"param\": \"card_2\"\n          }\n        ]\n      }\n    ]\n  },\n  \"contact\": {\n    \"name\": \"Gajanand\"\n  },\n  \"client_reference_id\": \"carousel_{{$timestamp}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Messages",
      "item": [
        {
          "name": "Fetch all Public API messages",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/public/v1/messages?limit=50",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "public",
                "v1",
                "messages?limit=50"
              ]
            },
            "description": ""
          }
        },
        {
          "name": "Fetch message status",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/public/v1/messages/{{message_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "public",
                "v1",
                "messages",
                "{{message_id}}"
              ]
            },
            "description": ""
          }
        }
      ]
    },
    {
      "name": "Contacts",
      "item": [
        {
          "name": "Create / update contact",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/public/v1/contacts",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "public",
                "v1",
                "contacts"
              ]
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"phone\": \"{{to_phone}}\",\n  \"name\": \"Gajanand\",\n  \"tags\": [\n    \"api\"\n  ],\n  \"attributes\": {\n    \"city\": \"Nagpur\"\n  },\n  \"whatsapp_opt_in\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Fetch contacts",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/public/v1/contacts?limit=50&search=",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "public",
                "v1",
                "contacts?limit=50&search="
              ]
            },
            "description": ""
          }
        },
        {
          "name": "Retrieve contact",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/public/v1/contacts/{{contact_id_or_phone}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "public",
                "v1",
                "contacts",
                "{{contact_id_or_phone}}"
              ]
            },
            "description": ""
          }
        }
      ]
    }
  ],
  "variable": [
    {
      "key": "base_url",
      "value": "https://app.botinx.com/api/v1"
    },
    {
      "key": "api_key",
      "value": "btx_live_xxx"
    },
    {
      "key": "channel_id",
      "value": "6a04267fc759c4a70d2ae777"
    },
    {
      "key": "to_phone",
      "value": "918888999900"
    },
    {
      "key": "template_id",
      "value": ""
    },
    {
      "key": "message_id",
      "value": ""
    },
    {
      "key": "contact_id_or_phone",
      "value": "918888999900"
    }
  ]
}