- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2017 11:14 AM
Hi community,
I have a Scripted REST API for a scoped application. I implemented a Scripted REST API Resource with a number of calls to the Table API to update a number of tables. For my Scripted REST API, it requires authentication. So when the Scripted REST API is called, username and password are provided. However, when the Table API endpoints are called within the Scripted REST API, authentication to the endpoints are required again.
How should the authentication be handled on Table API calls within my Scripted REST API? Is it possible, and follows best practices to pass the username and password I received for the Scripted REST API to the Table API endpoints?
Thanks for any help you can provide.
Jenny
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2017 11:21 AM
You can set up a Basic Auth Configuration in table sys_auth_profile_basic. Then put that record in a system property, and call it:
authID = gs.getProperty('basic_auth.profile');
In the script, you can then set:
r.setAuthenticationProfile('basic', authID);
or something like that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2017 11:21 AM
You can set up a Basic Auth Configuration in table sys_auth_profile_basic. Then put that record in a system property, and call it:
authID = gs.getProperty('basic_auth.profile');
In the script, you can then set:
r.setAuthenticationProfile('basic', authID);
or something like that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2017 11:38 AM
Hi Mike,
This is exactly what was missing. I set the authentication profile as suggested and it worked perfectly!
Thanks so much!
Jenny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2018 03:01 PM
Hello,
I need to create a Webservice API where input is: Sys ID of any record and output is: all *related* active records to that sys id. The relationships between the tables is maintained in Relationships under system definition.
Could you please guide me how to implement this? Sample code would be great.
Input: Sys ID of the record
Output: All *RELATED* active records from *VARIOUS* tables (in the following JSON format):
{
"result": [
{
"Sys ID": "5520267",
"CI Name": "Record 1",
"Table Name": "u_table_a"
},
{
"Sys ID": "5520367",
"CI Name": "Record 2",
"Table Name": "u_table_a"
},
{
"Sys ID": "8331210",
"CI Name": "Record 1",
"Table Name": "u_table_b"
},
{
"Sys ID": "8321210",
"CI Name": "Record 2",
"Table Name": "u_table_b"
},
{
"Sys ID": "3042006",
"CI Name": "Record 3",
"Table Name": "u_table_b"
},
{
"sys_id": "4509847",
"CI Name": "Record 1",
"Table Name": ""u_table_c"
}
{
"sys_id": "4509247",
"CI Name": "Record 2",
"Table Name": ""u_table_c"
}
]
}