Providing access via Integration

kirankr2061
Tera Contributor

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 ?

1 ACCEPTED SOLUTION

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 :

Screenshot 2026-02-12 125155.png

 

 

2) Which will look like this and having an response body :

Screenshot 2026-02-12 125212.png

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..

View solution in original post

3 REPLIES 3

yashkamde
Tera Guru

Hello @kirankr2061 ,

 

Yes this requirement can be done using Outbound REST Message Integration (E Bounding) :

Screenshot 2026-02-12 114001.png

 

In that you will have to configure Target Instance End Point and to make :
Screenshot 2026-02-12 113952.png

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.

 

Is there any way can I use table api  instead ?

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 :

Screenshot 2026-02-12 125155.png

 

 

2) Which will look like this and having an response body :

Screenshot 2026-02-12 125212.png

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..