- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
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 ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
53m ago
Yes you can do this through Table API also,
1) First of all In Target Instance hit an API endpoint which will having GET call from main Instance :
2) Which will look like this and having an response body :
3) Now hit this API in your Target Instance -> REST Message -> GET method (Using TEST related Link) So you will be getting an response body,
Now use this response body for creating the User and giving access to that User..
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
yesterday
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
yesterday
Is there any way can I use table api instead ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
53m ago
Yes you can do this through Table API also,
1) First of all In Target Instance hit an API endpoint which will having GET call from main Instance :
2) Which will look like this and having an response body :
3) Now hit this API in your Target Instance -> REST Message -> GET method (Using TEST related Link) So you will be getting an response body,
Now use this response body for creating the User and giving access to that User..
If my response helped mark as helpful and accept the solution..
