{
  "info": {
    "name": "Wise Network - EDUCATIONAL messaging API example",
    "description": "EDUCATIONAL EXAMPLE. Wise Network does not operate a messaging API. api.wisenetwork.co and every request here are placeholders that will not work. Guide: https://wisenetwork.co/developers/postman/\n\nShows the structure explained in the guide: token, send, status and a sample delivery report to your own server. Replace the placeholders only for a provider whose API is live.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{accessToken}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.wisenetwork.co/v1",
      "description": "Placeholder. No API is served at this address."
    },
    {
      "key": "clientId",
      "value": "<client-id>",
      "description": "Issued by a provider. Keep secret."
    },
    {
      "key": "clientSecret",
      "value": "<client-secret>",
      "description": "Issued by a provider. Keep secret; set as a current value only."
    },
    {
      "key": "accessToken",
      "value": "",
      "description": "Set by the token request."
    },
    {
      "key": "sender",
      "value": "ExampleCo"
    },
    {
      "key": "testNumber",
      "value": "+12025550143",
      "description": "Fictional number."
    },
    {
      "key": "messageId",
      "value": "",
      "description": "Set by the send request."
    },
    {
      "key": "webhookUrl",
      "value": "https://your-app.example.com/hooks/sms",
      "description": "Your own HTTPS endpoint."
    }
  ],
  "item": [
    {
      "name": "1. Get access token (proposed)",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/x-www-form-urlencoded"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/oauth/token",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "oauth",
            "token"
          ]
        },
        "description": "Exchanges client credentials for a short-lived token.\n\nEDUCATIONAL EXAMPLE. Wise Network does not operate a messaging API. api.wisenetwork.co and every request here are placeholders that will not work. Guide: https://wisenetwork.co/developers/postman/",
        "auth": {
          "type": "noauth"
        },
        "body": {
          "mode": "urlencoded",
          "urlencoded": [
            {
              "key": "grant_type",
              "value": "client_credentials"
            },
            {
              "key": "client_id",
              "value": "{{clientId}}"
            },
            {
              "key": "client_secret",
              "value": "{{clientSecret}}"
            }
          ]
        }
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "const body = pm.response.json();",
              "pm.test(\"token issued\", () => pm.expect(body.access_token).to.be.a(\"string\"));",
              "pm.collectionVariables.set(\"accessToken\", body.access_token);"
            ]
          }
        }
      ]
    },
    {
      "name": "2. Send a message (proposed)",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Idempotency-Key",
            "value": "{{$guid}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"from\": \"{{sender}}\",\n  \"to\": [\n    \"{{testNumber}}\"\n  ],\n  \"text\": \"Test message from Postman\",\n  \"dlr_url\": \"{{webhookUrl}}\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/messages",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "messages"
          ]
        },
        "description": "Submits one message and asks for a delivery report.\n\nEDUCATIONAL EXAMPLE. Wise Network does not operate a messaging API. api.wisenetwork.co and every request here are placeholders that will not work. Guide: https://wisenetwork.co/developers/postman/"
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"accepted\", () => pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]));",
              "const id = pm.response.json().messages?.[0]?.id;",
              "pm.collectionVariables.set(\"messageId\", id);"
            ]
          }
        }
      ]
    },
    {
      "name": "3. Check message status (proposed)",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/messages/{{messageId}}",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "messages",
            "{{messageId}}"
          ]
        },
        "description": "Returns the current state of the message.\n\nEDUCATIONAL EXAMPLE. Wise Network does not operate a messaging API. api.wisenetwork.co and every request here are placeholders that will not work. Guide: https://wisenetwork.co/developers/postman/"
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"status returned\", () => pm.expect(pm.response.json()).to.have.property(\"status\"));"
            ]
          }
        }
      ]
    },
    {
      "name": "4. Send a sample delivery report to YOUR server",
      "request": {
        "method": "POST",
        "auth": {
          "type": "noauth"
        },
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "X-Signature",
            "value": "t=1793197860,v1=<hex-hmac>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"id\": \"{{messageId}}\",\n  \"status\": \"delivered\",\n  \"done_at\": \"2026-10-28T14:31:00Z\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{webhookUrl}}",
          "host": [
            "{{webhookUrl}}"
          ]
        },
        "description": "Tests your own webhook receiver with a sample receipt. Signature format is illustrative.\n\nEDUCATIONAL EXAMPLE. Wise Network does not operate a messaging API. api.wisenetwork.co and every request here are placeholders that will not work. Guide: https://wisenetwork.co/developers/postman/"
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"receiver answered 2xx\", () => pm.expect(pm.response.code).to.be.within(200, 299));"
            ]
          }
        }
      ]
    }
  ]
}
