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

无法调用ServiceNow API创建事件工单,Postman报用户未认证错误

Troubleshooting "User Not Authenticated" Error with ServiceNow Incident API

Let’s walk through the most practical fixes for this issue, since you’ve already tried setting up Basic Auth and sending a JSON request body:

  • Double-check your Basic Auth configuration in Postman
    First, confirm you’ve selected Basic Auth in the Auth tab (not any other auth type). ServiceNow usually expects usernames without a domain prefix—for example, use admin instead of CORP\admin. If your password has special characters, Postman’s auto-encoding might cause issues; try manually encoding your username:password string to Base64 and adding it directly to the request header like this: Authorization: Basic <your-base64-string>. This bypasses any auto-encoding quirks in Postman.

  • Verify your request headers are correctly set
    ServiceNow’s REST API requires the Content-Type: application/json header to process your request body. If this header is missing or set to something else (like application/x-www-form-urlencoded), even valid JSON will cause problems. Also, check for conflicting auth headers—sometimes Postman retains old Bearer Tokens or other auth settings from previous requests. Stick to these essential headers:

    • Authorization: Basic <your-encoded-creds>
    • Content-Type: application/json
    • Accept: application/json (optional but ensures you get consistent JSON responses)
  • Confirm your user account has the right permissions
    Even if your username and password are correct, ServiceNow might return an auth error if the account doesn’t have permission to create incidents. Log into your ServiceNow instance and check that the user has at least the itil role (or a custom role with incident_write access). Also, make sure the account isn’t locked, expired, or restricted to specific IP addresses.

  • Validate your API endpoint and test with a GET request
    Double-check that your endpoint https://xxxx.service-now.com/api/now/v1/table/incident uses the correct instance prefix (xxxx). To isolate the issue, try sending a GET request to the same endpoint (to fetch incident records)—if you get the same auth error, the problem is with your credentials/account, not the create action itself.

  • Rule out Postman environment/global variable interference
    Postman’s global or environment variables can override your request-specific auth settings. Click the "Clear Cookies" button in Postman, then in the Auth tab, select "Current Request" to ensure your Basic Auth is only applied to this call. You can also temporarily disable any global variables to see if they’re causing conflicts.

Here’s a sample working request you can test in Postman (replace placeholder values with your own):

POST https://xxxx.service-now.com/api/now/v1/table/incident
Authorization: Basic dXNlcjE6cGFzc3dvcmQ=
Content-Type: application/json

{
  "short_description": "Test incident from Postman",
  "description": "Troubleshooting auth error",
  "caller_id": "admin"
}

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.19 09:35:43