Providing access via Integration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
let say I am user having a admin access in instance A instance now I want admin access in instance B but I don't have user record there now from instance A can I able to create a user in instance B and provide him admin access through a catalog request from instance A.
Any thought or any solution ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hello @kirankr2061 ,
Yes this requirement can be done using Outbound REST Message Integration (E Bounding) :
In that you will have to configure Target Instance End Point and to make :
POST request body :
{
"id":"${user}",
"fName":"User1"
"lName":"Demo"
}
Business rule Before Insert :
(function executeRule(current, previous /*null when async*/ ) {
try {
var r = new sn_ws.RESTMessageV2('global.Second Instance Integration', 'User create POST');
r.setStringParameterNoEscape('user', current.user_name);
var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
var res = JSON.parse(responseBody);
current.u_targetid = res.result.sysId;
} catch (ex) {
var message = ex.message;
}
})(current, previous);Scripted Rest API for user creation :
(function process( /*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {
var User = request.body.data;
var responseBody = {};
var gr = new GlideRecord('sys_user');
gr.initialize();
gr.user_name= User.id;
gr.first_name = User.fName;
gr.last_name = User.lName;
var newSysID = gr.insert();
responseBody.message = 'User is created';
responseBody.sysId = newSysID;
response.setBody(responseBody);
})(request, response);
If my response helped mark as helpful and accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Is there any way can I use table api instead ?
