Service Desk Practitioners Forum

Creating Attaching using Web APIs

Ajay Bala
New Member.

Creating Attaching using Web APIs


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 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 !
Ajay Bala
New Member.

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());