Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Upload Attachment to Case by Using SCP

    Use this API to upload binary or text attachments by using Secure Copy Protocol (SCP) to cases created in Juniper Support System (JSS).

    URI

    http://[host]/api/juniper/servicenow/case-management/cases/{id} /uploadAttachmentViaSCP?queue=http://[host]/api/hornet-q/queues/jms.queue.queuename (HTTP method = POST)

    URI Parameters

    Parameter

    Type

    Required

    Description

    id

    Integer

    Yes

    ID of the case to which attachments are to be uploaded

    queuename

    String

    Yes

    Name of the upload attachment job queue

    Consumes

    • application/vnd.juniper.servicenow.case-management.uploadattachmentviascp+xml; version=1;charset=UTF-8
    • application/vnd.juniper.servicenow.case-management.uploadattachmentviascp+json; version=1;charset=UTF-8

    Request Elements

    Element

    Type

    Description

    user

    String

    Username of the system where the attachment is located

    password

    String

    Password of the system where the attachment is located

    machineIP

    String

    IP address of the system where the attachment is located

    files

    String

    Absolute path of the attachment files to be uploaded

    Produces

    • application/vnd.juniper.servicenow.case-management.case+xml;version=1
    • application/vnd.juniper.servicenow.case-management.case+json;version=1

    Response Elements

    Element

    Type

    Description

    href

    String

    Link to the upload attachment job

    id

    Integer

    ID of the upload attachment job

    Sample Input

    Sample XML Input

    <scpfileupload>
    <user>user@example.com</user>
    <password>newpassword</password>
    <machineIP>192.0.2..117</machineIP>
    <files>home/admin/testAttachment.txt,/home/admin/sampleAttachment.txt</files>
    </scpfileupload>
    

    Sample JSON Input

    {
    "scpfileupload: { "user": "user@example.com",
    ”password”: “newpassword”,
    ”machineIP”: “192.0.2.117”,
    ”files”: “home/admin/testAttachment.txt,/home/admin/sampleAttachment.txt”
        }
     }
     

    Sample Output

    Sample XML Output

    <task href= "/api/space/job-management/jobs/1310761" >
    <id>1310761</id>
    </task>
    

    Sample JSON Output

    {
      "task": { "href": "/api/space/job-management/jobs/1310761"
    ”id”: “1310761” }
    }
    

    Error Codes

    Message

    Description

    Bad request: Invalid IP

    The machine IP is null or not valid.

    Bad request: Invalid file Name

    The files element is null.

    Modified: 2016-08-11