Use API REST to display a dynamic html table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 12:00 PM
Hi,
I'm trying to display a dynamic table in my widget. I have two scripts for that, one HTML for the page and one client script to handle data. but when i try to get the data from my REST API table it does nothing. i checked on internet to find where is my mistake, they said that the header with my authentification informations (Username and password) is missing. But i don't want to put my information in the script. I wonder if anyone have ever been in the same situation and how can i sove it. here is the part of my client script where im trying to catch data's API REST table -->
and here is the part of my HTML script where i'm trying to display it -->
<!-- body -->
<div class="panel-body">
<div class="grid-container" ng-if="data.list.length">
<div class="grid-item" ng-repeat="item in data.list track by item.sys_id">
<span>{{item[field].display_value}}</span>
</div>
<div ng-if="options.show_breadcrumbs == true || data.enable_filter == true" class="filter-breadcrumbs">
<widget id="filter-breadcrumbs-restricted"></widget>
<sp-widget widget="data.filterBreadcrumbs"></sp-widget>
</div>
<div class="alert alert-info" ng-if="!data.list.length && !data.num_pages && !data.invalid_table && !loadingData">
${No records in {{data.table_label}} <span ng-if="data.filter">using that filter</span>}
</div>
<div class="alert alert-info" ng-if="loadingData">
<fa name="spinner" spin="true"></fa> ${Loading data}...
</div>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 03:13 PM
Have you setup the outbound REST message via System Web Services > Outbound > REST Message?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 06:40 AM
Hi @jcmings ,
No, i haven't setup it. Can you explain what i have to do there please?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 07:05 AM
Hi @jcmings,
I have set up the outbound REST message. i got a 401 http error. It is the same error that failed my script. i tried to use my admin account which i use to navigate in the SNOW dashbord management but nothing changed. here is the print screen. Do you have any solution to solve it please?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 01:05 PM
Is there any documentation from the endpoint you're trying to hit? Usually they should provide you with authentication credentials. Sounds like you may need to get that from the endpoint's POC.