You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

调用Direct Line API生成令牌时出现"Site Missing"错误求助

Fixing "Site Missing" Error When Generating Direct Line API Token via Postman

Hey there, let's work through that "Site Missing" error you're seeing when trying to generate a Direct Line token with Postman. I've dealt with this exact issue before, so here are the key things to check:

  • Double-check your request URL
    The correct endpoint for generating Direct Line tokens is https://directline.botframework.com/v3/directline/tokens/generate. It's easy to mistype the path or use an outdated version of the API—make sure there are no typos, extra slashes, or wrong domain names here.

  • Verify your Authorization header format
    You mentioned using a Bearer Token, which is right, but let's confirm the syntax. The header value should be exactly Bearer YOUR_DIRECT_LINE_SECRET, where YOUR_DIRECT_LINE_SECRET is the full key you got from Azure Bot Service's Direct Line channel. Avoid adding extra quotes, spaces, or special characters—even a tiny typo in the secret will trigger this error.

  • Check your request body (if you're using one)
    If you're including a user ID in your request, the body needs to be valid JSON. For example:

    {
      "user": {
        "id": "unique-user-id-123"
      }
    }
    

    Also, make sure Postman is set to send the body as raw > JSON (not form-data, x-www-form-urlencoded, etc.). Even an invalid JSON format can lead to a "BadArgument" error like this.

  • Validate your Direct Line secret's validity
    Sometimes the secret itself might be expired or not properly linked to your bot. Head over to the Azure Portal, find your bot resource, go to Channels > Direct Line, and confirm the secret is active. If you're unsure, generate a new secret and test with that—old secrets can stop working if they're rotated or revoked.

Here's a quick example of a correctly configured Postman request for reference:

  • Method: POST
  • URL: https://directline.botframework.com/v3/directline/tokens/generate
  • Headers:
    • Authorization: Bearer your-direct-line-secret-here
    • Content-Type: application/json (only needed if sending a request body)
  • Body (optional):
    {
      "user": {
        "id": "my-test-user"
      }
    }
    

Start with the URL and header checks first—those are the most common culprits for this error. Let me know if any of these steps resolve it!

内容的提问来源于stack exchange,提问作者rujabbar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.08 16:07:40