How to transfer attachments to 3rd party

Community Alums
Not applicable

Hi All,

 

We have to send all the attachments available in instance to 3rd party tool. It would be really helpful if you provide me the steps and configuration. We have around 1 Million attachment, all we have to transfer to 3rd party tool. It is very difficult to do it manually.

 

I urge you to please provide the configuration.

 

Thanks,

Tejas

2 REPLIES 2

Manmohan K
Tera Sage

Hi @Community Alums ,

 

You can use below sample code to configure script to send attachment to 3rd party

function sampleRESTMessageV2() {
    try {
        var request = new sn_ws.RESTMessageV2();
        request.setHttpMethod('post');
        request.setEndpoint('<third party endpoint URL>');
        request.setRequestBodyFromAttachment('<attachment sys_id>');
        
        var response = request.execute();
        var httpResponseStatus = response.getStatusCode();
      
        gs.info("http response status_code: " + httpResponseStatus);        
    }
    catch (ex) {
        var message = ex.getMessage();
        gs.info(message);
    }

 

Community Alums
Not applicable

Hello @Manmohan K ,

 

Thanks for your reply. Could you please share the steps where to configure this code and I hope you noted that there are around 4 Million attachments we have to transfer, there is typo. 

 

Thanks,

Tejas