getItemAttachments

This function returns the metadata about the file attachments for an item that exists in ExtraView. This method will only return data about the attachments. To get the attachments use the http call to the API.

Input

Class

Name

Type

Required

Details

GetItemAttachmentsRequest

userId

String

Yes

The callers user name

GetItemAttachmentsRequest

password

String

Yes

The callers password

GetItemAttachmentRequest

itemId

int

?

The int item id. This field is optional if itemIdStr is given, else it is required. It is recommended that you use itemIdStr

GetItemAttachmentRequest

itemIdStr

String

?

The String item Id. This field is optional if itemId is used. It is recommended that you use itemIdStr

Output

Class

Name

Type

Required

Details

GetItemAttachmentsResponse

success

boolean

Yes

True is succeeded False if failed

GetItemAttachmentsResponse

returnCode

String

No

See Appendix for details

GetItemAttachmentsResponse

returnMessage

String

No

Human readable message

GetItemAttachmentsResponse

attachments

Array

No

A list of AttachmentBeans

Attachment

attachmentDate

Date

Yes

The date the attachment was added to the item

Attachment

fileName

String

Yes

The file name of the attachment

Attachment

fileSize

Integer

Yes

The file size of the attachment

Attachment

attachmentCreater

String

Yes

The userId who insertd the attachment

Attachment

attachmentId

Integer

Yes

The id of the attachment

Attachment

description

String

Yes

The description of the attachment

Attachment

fileType

String

No

The optional mime type

Example

public static void testGetItemAttachments(EVItemServiceStub stub) {
    try {
        GetItemAttachmentsDocument reqEnvelope = GetItemAttachmentsDocument.Factory.newInstance();
        GetItemAttachmentsRequest request =
            reqEnvelope.addNewGetItemAttachments().addNewParam0();
        request.setUserId(ServiceClientHelper.ADMIN_USER_ID);
        request.setPassword(ServiceClientHelper.ADMIN_PASSWORD);
        request.setItemId(CREATED_ISSUE_ID);
        GetItemAttachmentsResponseDocument resEnvelope =
            stub.getItemAttachments(reqEnvelope);
        GetItemAttachmentsResponse response =
            resEnvelope.getGetItemAttachmentsResponse().getReturn();
        if (response.getSuccess()) {
            System.out.println("success: [" + response.getReturnCode() + "] : " +
                                              response.getReturnMessage());
        } else {
            System.out.println("failure: [" + response.getReturnCode() + "] : " +
                                              response.getReturnMessage());
        }
    } catch (Exception e) {
        e.printStackTrace();
        System.err.println("nnn");
    }
}