Service Desk Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Attaching using Web APIs

Highlighted
Ajay Bala
Acclaimed Contributor

Creating Attaching using Web APIs

Hi,

SD4.5, SP15

I am trying to add attachments to a Service call using Web APIs. I want to use the Attachment server inorder to add the attachments.

I tried to use the Example9.java available with the SErvice Pack, but it doesnt use the Attachment Server.

Can someone provide sample code for adding attachments using the Attachment Server ?

Thanks !
1 REPLY
Ajay Bala
Acclaimed Contributor

Re: Creating Attaching using Web APIs

More inputs
------------
Using the statement below, i am able to move the ftp to the Attachments folder. But the only issue is that, this doesnt attach the attachment to the service call.

The API program is run from a different machine than the server. Would appreciate if anyone can provide direction here.

Attachment attachmentsHandle = attachmentServer.openAttachment(itemType, item.getOID().toString());

AttachedItem xyz =attachmentsHandle.createAttachedItem("C:\\Cadm_ui.jar",nItem.getOID().toString());

Thanks,
Ajay
//Add this to "OnDomLoad" event