- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2024 02:22 AM
Hello!
I have 2 lab instances:
1. A learning lab instance:
Work fine to access tables through REST API resquests through Safari
Works fine through Safari.
ex: https://xxxxxxxxxservice-now.com/api/now/table/sys_hub_flow?sysparm_limit=1
If I do the request from my code it works fine to the learning lab instance. But if I do the same towards my dev environment i get the following error:
the request: https://devxxxxxx.service-now.com/api/now/table/sys_hub_flow?sysparm_limit=1
Status: 400 Headers: {'Content-Type': 'text/html;charset=utf-8', 'Content-Length': '571', 'Date': 'Sun, 18 Feb 2024 10:08:00 GMT', 'X-Cnection': 'close', 'Server': 'ServiceNow', 'Set-Cookie': 'BIGipServerpool_devxxxxx=176534794.56128.0000; path=/; Httponly; Secure; SameSite=None; Secure', 'Strict-Transport-Security': 'max-age=63072000; includeSubDomains'} Error Response: b'<html><head><title>ServiceNow - Error report</title><style><!--body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}--></style> </head><body><h1>HTTP Status 400 \xe2\x80\x93 </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception Report</p><p><b>Message</b> <u></u></p><p><b>Description</b> <u>http.400</u></p><HR size="1" noshade="noshade"><h3>ServiceNow</h3></body></html>'
Tried to find if there are security differences between the two lab instances.
I am using the same user in safari and in the code. basic authenication.
the learning instance is San Diego. The lab instance is Vancouver Patch 2 Hot Fix 1
Thanks for any help where to fix the problem!
Göran
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2024 01:11 AM
Hello Tony!
Thanks for the respond!
I spent 2 days try to understand the OAuth to solve the problem that way but I gave up.
I solved the problem after endless tries.
In my learning lab instance I had the request get to ServiceNow table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2024 06:11 PM
Hi, testing a PDI running glide-vancouver-07-06-2023__patch2-hotfix1-10-04-2023
I have no issues with a GET query using basic auth and this endpoint
/api/now/table/sys_hub_flow?sysparm_limit=1
Have you checked\confirmed that the account you are using to authenticate with has rights to access the table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2024 01:11 AM
Hello Tony!
Thanks for the respond!
I spent 2 days try to understand the OAuth to solve the problem that way but I gave up.
I solved the problem after endless tries.
In my learning lab instance I had the request get to ServiceNow table