Make contextual search results appear on a public facing record producer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 10:32 PM
I have a record producer that creates a Complaint Case. When logged in to the CSP portal the contextual search results work. However, for unauthenticated users the search results do not show.
I have made the record producer available to public (unauthenticated users) and allowed the Consumer knowledge base to be viewed by the public too.
The browser console reports the following error.
Anyone know how to allow public access to contextual search?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 11:16 PM
hello,
Jut to be sure have you made everything public right?
The Page on which the widget is?
The widget itself?
Source of the knowledge?
Also you can check the below article from the Hi support team
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0551300
Please mark answer correct/helpful based on Impact.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2022 04:49 PM
The page, catalog item and knowledge base are all publicly available. I can confirm that by navigating to the Consumer Service Portal `/csp` . From there I can search and view the KB Articles via the Knowledgebase page `/csp?id=kb_search` and I can navigate to the Record producer.
I can also confirm that when I navigate to this URL (when authenticated) I see the Consumer knowledge base listed as publicly available. https://xxx.service-now.com/get_public_knowledge_bases
Only when I begin to enter text into the Summary field the contextual search result API is called; `POST /api/now/cxs/search` and I see 'unauthorised' in the browser's console.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2023 07:55 AM
This is a relatively straight forward fix. You need to modify the Scripted REST API for the "api/now/cxs" URL mentioned in the 401 error.
Go to System Web Service > Scripted Web Services > Scripted REST APIs
Search under "Base API Path" for "*cxs"
Open the Contextual Search (Internal API) record
In the Resources related list, open the "search" record with POST as HTTP method
Uncheck Requires Authentication under the security section of the form
This will remove need for authentication for that API call the contextual search does and returns records as expected for your record producer's contextual search.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2024 01:49 PM
Any resolution to this? I am also facing the same issue. I attempted to update the access on the contextual search endpoint and it did not work.