{
  "info": {
    "name": "WiPoint Entegrasyon API v1",
    "description": "WiPoint hotspot entegrasyon API'si.\n\nKULLANIM: client_id / client_secret değişkenlerini doldurun, '0 · Token al' isteğini çalıştırın; token otomatik saklanır ve diğer isteklerde kullanılır.\n\nAnahtar üretimi: portal.wipoint.tr → Hotspot Yönetimi → API & Entegrasyon.\nKaynak IP tanımı ZORUNLUDUR — isteği atacağınız sunucunun çıkış IP'sini tanımlayın.\n\nSözleşme: https://wipoint.tr/gelistirici",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://api.wipoint.tr"
    },
    {
      "key": "client_id",
      "value": ""
    },
    {
      "key": "client_secret",
      "value": ""
    },
    {
      "key": "access_token",
      "value": ""
    },
    {
      "key": "node_id",
      "value": ""
    },
    {
      "key": "user_id",
      "value": ""
    },
    {
      "key": "session_id",
      "value": ""
    },
    {
      "key": "webhook_id",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "0 · Token al (client_credentials)",
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// Token'ı koleksiyon değişkenine yazar; sonraki istekler otomatik kullanır.",
              "if (pm.response.code === 200) {",
              "  pm.collectionVariables.set('access_token', pm.response.json().access_token);",
              "}"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/x-www-form-urlencoded"
          }
        ],
        "body": {
          "mode": "urlencoded",
          "urlencoded": [
            {
              "key": "grant_type",
              "value": "client_credentials"
            },
            {
              "key": "client_id",
              "value": "{{client_id}}"
            },
            {
              "key": "client_secret",
              "value": "{{client_secret}}"
            }
          ]
        },
        "url": {
          "raw": "{{base_url}}/v1/oauth/token",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "v1",
            "oauth",
            "token"
          ]
        },
        "description": "Gizli anahtarı 900 saniyelik opak erişim token'ına çevirir. Kaynak IP hem burada hem her istekte doğrulanır."
      }
    },
    {
      "name": "1 · Noktalar",
      "item": [
        {
          "name": "GET /v1/nodes",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/v1/nodes",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "nodes"
              ]
            },
            "description": "Anahtarın yetkili olduğu noktalar (durum + doluluk)"
          }
        },
        {
          "name": "GET /v1/nodes/{nodeId}",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/v1/nodes/{{node_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "nodes",
                "{{node_id}}"
              ]
            },
            "description": "Tek nokta detayı"
          }
        }
      ]
    },
    {
      "name": "2 · Kullanıcılar",
      "item": [
        {
          "name": "GET /v1/nodes/{nodeId}/profiles",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/v1/nodes/{{node_id}}/profiles",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "nodes",
                "{{node_id}}",
                "profiles"
              ]
            },
            "description": "Erişim profilleri (hız / oturum süresi)"
          }
        },
        {
          "name": "GET /v1/nodes/{nodeId}/users",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/v1/nodes/{{node_id}}/users",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "nodes",
                "{{node_id}}",
                "users"
              ]
            },
            "description": "Hotspot kullanıcılarını listele"
          }
        },
        {
          "name": "POST /v1/nodes/{nodeId}/users",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/v1/nodes/{{node_id}}/users",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "nodes",
                "{{node_id}}",
                "users"
              ]
            },
            "description": "Hotspot kullanıcısı oluştur",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"username\": \"oda-214\",\n  \"password\": \"G3cici!Parola\",\n  \"full_name\": \"Ayşe Yılmaz\",\n  \"type\": \"guest\",\n  \"phone\": \"5551234567\",\n  \"expires_in_minutes\": 1440\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "GET /v1/nodes/{nodeId}/users/{userId}",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/v1/nodes/{{node_id}}/users/{{user_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "nodes",
                "{{node_id}}",
                "users",
                "{{user_id}}"
              ]
            },
            "description": "Kullanıcı detayı"
          }
        },
        {
          "name": "PATCH /v1/nodes/{nodeId}/users/{userId}",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/v1/nodes/{{node_id}}/users/{{user_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "nodes",
                "{{node_id}}",
                "users",
                "{{user_id}}"
              ]
            },
            "description": "Kullanıcıyı güncelle",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"status\": \"suspended\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "DELETE /v1/nodes/{nodeId}/users/{userId}",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/v1/nodes/{{node_id}}/users/{{user_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "nodes",
                "{{node_id}}",
                "users",
                "{{user_id}}"
              ]
            },
            "description": "Kullanıcıyı pasife al (açık oturumları düşer)"
          }
        }
      ]
    },
    {
      "name": "3 · Oturumlar",
      "item": [
        {
          "name": "GET /v1/nodes/{nodeId}/sessions",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/v1/nodes/{{node_id}}/sessions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "nodes",
                "{{node_id}}",
                "sessions"
              ]
            },
            "description": "Aktif oturumlar"
          }
        },
        {
          "name": "POST /v1/nodes/{nodeId}/sessions/{sessionId}/disconnect",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/v1/nodes/{{node_id}}/sessions/{{session_id}}/disconnect",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "nodes",
                "{{node_id}}",
                "sessions",
                "{{session_id}}",
                "disconnect"
              ]
            },
            "description": "Oturumu sonlandır"
          }
        }
      ]
    },
    {
      "name": "4 · Webhook",
      "item": [
        {
          "name": "GET /v1/webhooks",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/v1/webhooks",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "webhooks"
              ]
            },
            "description": "Webhook tanımları"
          }
        },
        {
          "name": "POST /v1/webhooks",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/v1/webhooks",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "webhooks"
              ]
            },
            "description": "Webhook tanımla",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://sizin-sisteminiz.com/wipoint-webhook\",\n  \"events\": [\n    \"user.created\",\n    \"session.started\",\n    \"session.ended\",\n    \"node.offline\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "DELETE /v1/webhooks/{webhookId}",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/v1/webhooks/{{webhook_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "webhooks",
                "{{webhook_id}}"
              ]
            },
            "description": "Webhook sil"
          }
        },
        {
          "name": "GET /v1/webhooks/{webhookId}/deliveries",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/v1/webhooks/{{webhook_id}}/deliveries",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "webhooks",
                "{{webhook_id}}",
                "deliveries"
              ]
            },
            "description": "Son teslimatlar (teşhis)"
          }
        },
        {
          "name": "GET /v1/webhooks/events",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/v1/webhooks/events",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "webhooks",
                "events"
              ]
            },
            "description": "Dinlenebilecek olayların listesi"
          }
        },
        {
          "name": "POST /v1/webhooks/{webhookId}/test",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/v1/webhooks/{{webhook_id}}/test",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "webhooks",
                "{{webhook_id}}",
                "test"
              ]
            },
            "description": "Test olayı gönder"
          }
        }
      ]
    }
  ]
}