Sebastian L
Mega Sage

So I would add it in your HTTP Methods, and create one with corresponding with your action. I would honestly also have all your OAUTH done by an OAUTH profile also instead of all that custom scripting... 

 

In your endport you write "https://api-dev.nametopic.com/data/v1/topics/${topicName}" 

And under Variable substitution you add one with name "topicName" and no escaping.

so ${topicName} is what is being replaced.  Se example for an azure integration using these principles. 

 

Then in your script you don't need to provide the URL, instead you write: 

 

var r = new sn_ws.RESTMessageV2('name_of_rest_message, 'name_of_HTTP_METHOD'); 
r.setStringParameterNoEscape('topicName', topicName);
var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();

 

For my Azure example I would write: 

var group_id = 'x';
var r = new sn_ws.RESTMessageV2('Azure AD', 'Add Members to Group');
r.setStringParameterNoEscape('group-id', group_id);
var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();