How to add attachment while raising ServiceNow incident using HttpClient activity

Hi All,

I’m trying to add attachment while raising ServiceNow incident through API using HttpClient activities. I tried putting path by creating argument in Attachment section of properties panel, but I’m not sure how to use that argument.

EndPoint URL - https://xyz.service-now.com/api/now/table/incident

Body -
{“short_description”:“”,
“description”:“”,
“assignment_group”:“”,
“watch_list”:“”,
“caller_id”:“”}

I’ve used Simple Authentication here.

I’m able to raise incident without attachment but with attachment it’s giving error.

Can anyone please help here it’s urgent?

@arpitsharma1.sharma

Did you try attaching the attachment in postman first did it work?

in the attachment section click on create argument and add the attachment name and provide the path in it

Please check this

cheers

Is it possible to have this upload .xaml file ?

@arpitsharma1.sharma

Did you happen to check the video?

I dont have the exact endpoint details with me…if you can procvide the payload and endpoint details i can give a sample…else try to do it with postman first and then import the curl which will create the request automatically with required parameters

Cheers

I don’t have access to Postman, API’s are provided by API team.

Can you create the sample without correct Endpoint and Cred… I’ll edit them with right details and then I will try it out.

@arpitsharma1.sharma

Without the details i have already provided how to create…

Basically in attachment firld provide the name you are given from the api team and give the filepth

Cheers

I tried creating argument in attachment properties and passed the file path in it, but where to use this argument ?

@arpitsharma1.sharma

you need not use it anywhere…that argument will be added to body automatically when an attachment property is used

cheers

I tried that but throwing error -

“{"error":{"message":"Invalid content-type. Supported request media types for this service are: [application/json, application/xml, text/xml]","detail":null},"status":"failure"}”

@arpitsharma1.sharma

Is the key name in_filepath in your request? I dont think so…can you please check that

Cheers

In the endpoint you are asking to add in_filePath?

Here ? - https://xyz.service-now.com/api/now/table/incident

SNOW_Main.xaml (24.3 KB)

@arpitsharma1.sharma

No…in the payload how are you sending the file? How did the api team ask you to send?

Cheers

That’s the question… even I don’t know how can it be done…

I’ve attached the workflow above… Can you edit it with your solution.

@arpitsharma1.sharma

Without the payload information you cannot create the http request…

For example when you need to hit orch api then you need basic values like tenantname,username,password as the parameters…if these names itself are wrong or not know you cannot it the api

First get the api info then you can create http request

Cheers