How can we pass an attachment from servicenow to freshservice through rest api

How can we send an attachment in json format from servicenow to freshservice through rest api. can you provide an example JSON for attachment by using javascript?.

1 Like

Hey @sai_krishna_amaranen, Welcome to the community :tada:
please find more about Ticket API and its attributes at Freshdesk API Documentation

An example JSON with attachments

{
  "cc_emails" : ["ram@freshdesk.com", "diana@freshdesk.com"],
  "fwd_emails" : [ ],
  "reply_cc_emails" : ["ram@freshdesk.com", "diana@freshdesk.com"],
  "email_config_id" : null,
  "group_id" : null,
  "priority" : 1,
  "requester_id" : 129,
  "responder_id" : null,
  "source" : 2,
  "status" : 2,
  "subject" : "Ticket Title",
  "id" : 1,
  "type" : "Question",
  "to_emails" : null,
  "product_id" : null,
  "fr_escalated" : false,
  "spam" : false,
  "urgent" : false,
  "is_escalated" : false,
  "created_at" : "2015-07-09T13:08:06Z",
  "updated_at" : "2015-07-23T04:41:12Z",
  "due_by" : "2015-07-14T13:08:06Z",
  "fr_due_by" : "2015-07-10T13:08:06Z",
  "description_text" : "this is a sample ticket",
  "description" : "<div>this is a sample ticket</div>",
  "custom_fields" : {
   "category" : null
  },
  "tags" : [ ],
  "attachments":[
     {
        "id":4004881085,
        "content_type":"image/jpeg",
        "file_size":44115,
        "name":"attachment1.jpg",
        "attachment_url":"https://cdn.freshdesk.com/data/helpdesk/attachments/production/4004881085/original/attachment.jpg"
        "created_at":"2014-07-28T16:20:03+05:30",
        "updated_at":"2014-07-28T16:20:03+05:30",
     },
     {
        "id":4004881086,
        "content_type":"image/jpeg",
        "file_size":44134,
        "name":"attachment2.jpg",
        "attachment_url":"https://cdn.freshdesk.com/data/helpdesk/attachments/production/4004881085/original/attachment2.jpg"
        "created_at":"2014-07-28T16:20:03+05:30",
        "updated_at":"2014-07-28T16:20:03+05:30",
     }
  ]
}
2 Likes

@sai_krishna_amaranen

What is that you are trying to accomplish in this case?

Are you trying to create a ticket with an attachment?