{
  "info": {
    "_postman_id": "7f8b9a1c-3d4e-4f5a-8b9c-0d1e2f3a4b5c",
    "name": "PingoLine REST API",
    "description": "Official Postman Collection for PingoLine - Cloud PBX, Automated IVR Order Confirmation Calls, and SMS Gateway in Bangladesh.\n\nWebsite: https://pingoline.com\nDocumentation: https://docs.pingoline.com",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{PINGOLINE_API_KEY}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://pingoline.com/api/v1",
      "type": "string"
    },
    {
      "key": "PINGOLINE_API_KEY",
      "value": "YOUR_API_TOKEN_HERE",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "System & Diagnostics",
      "item": [
        {
          "name": "Ping Health Check",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/ping",
              "host": ["{{baseUrl}}"],
              "path": ["ping"]
            },
            "description": "Verify API connectivity, site name, and token authentication."
          }
        },
        {
          "name": "Account & Wallet Balance",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/balance",
              "host": ["{{baseUrl}}"],
              "path": ["balance"]
            },
            "description": "Get current account wallet balance and assigned IP phone numbers."
          }
        }
      ]
    },
    {
      "name": "Automated Order Calls",
      "item": [
        {
          "name": "Create Order Confirmation Call",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"phone\": \"01712345678\",\n  \"order_id\": \"ORD-98421\",\n  \"customer_name\": \"Rahim Ahmed\",\n  \"amount\": 1450.00,\n  \"currency\": \"BDT\",\n  \"language\": \"bn\",\n  \"send_sms\": true,\n  \"sms_message\": \"Your order ORD-98421 is confirmed at our store.\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/order-calls",
              "host": ["{{baseUrl}}"],
              "path": ["order-calls"]
            },
            "description": "Trigger an automated phone call to customer asking to press 1 to confirm or 2 to cancel."
          }
        },
        {
          "name": "Get Order Call Details",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/order-calls/:id",
              "host": ["{{baseUrl}}"],
              "path": ["order-calls", ":id"],
              "variable": [
                {
                  "key": "id",
                  "value": "oc_test123",
                  "description": "Public ID of the order call"
                }
              ]
            },
            "description": "Retrieve status, DTMF answer, and call duration."
          }
        },
        {
          "name": "List Order Calls",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/order-calls?order_id=&status=&per_page=25",
              "host": ["{{baseUrl}}"],
              "path": ["order-calls"],
              "query": [
                {
                  "key": "order_id",
                  "value": ""
                },
                {
                  "key": "status",
                  "value": ""
                },
                {
                  "key": "per_page",
                  "value": "25"
                }
              ]
            },
            "description": "Query historical order verification calls with pagination."
          }
        }
      ]
    },
    {
      "name": "SMS Gateway",
      "item": [
        {
          "name": "Send Single / OTP SMS",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"phone\": \"01700000000\",\n  \"message\": \"Your verification code is 492104. Valid for 5 minutes.\",\n  \"type\": \"otp\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/sms/send",
              "host": ["{{baseUrl}}"],
              "path": ["sms", "send"]
            },
            "description": "Send high-priority OTP or single transactional SMS."
          }
        },
        {
          "name": "Send Bulk SMS",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"recipients\": [\n    \"01700000000\",\n    \"01800000000\"\n  ],\n  \"message\": \"Special discount! 20% off on all products this weekend.\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/sms/bulk",
              "host": ["{{baseUrl}}"],
              "path": ["sms", "bulk"]
            },
            "description": "Broadcast SMS to multiple numbers simultaneously."
          }
        },
        {
          "name": "Get SMS Balance",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/sms/balance",
              "host": ["{{baseUrl}}"],
              "path": ["sms", "balance"]
            },
            "description": "Check current SMS credit balance."
          }
        },
        {
          "name": "Get SMS Logs",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/sms/logs",
              "host": ["{{baseUrl}}"],
              "path": ["sms", "logs"]
            },
            "description": "Fetch delivery reports and status of sent SMS."
          }
        }
      ]
    },
    {
      "name": "Cloud PBX & Telephony",
      "item": [
        {
          "name": "Originate Call (Click-to-Call)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"extension\": \"101\",\n  \"phone\": \"01712345678\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/calls/originate",
              "host": ["{{baseUrl}}"],
              "path": ["calls", "originate"]
            },
            "description": "Bridge an agent extension with an external customer number."
          }
        },
        {
          "name": "List Call History (CDR)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/calls",
              "host": ["{{baseUrl}}"],
              "path": ["calls"]
            },
            "description": "Query call detail records (CDR)."
          }
        }
      ]
    }
  ]
}
