# HTTP Request - SNOW POST

**URL:** <https://forum.uipath.com/t/http-request-snow-post/363652>\
**Category:** Studio\
**Tags:** service-now, webapi, activities\
**Created:** [November 22, 2021, 4:13pm UTC](https://forum.uipath.com/t/http-request-snow-post/363652 "2021-11-22T16:13:11Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![lori.k.aucoin](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lori.k.aucoin/32/177528_2.png) [@lori.k.aucoin](https://forum.uipath.com/u/lori.k.aucoin)\
**Post date:** [November 22, 2021, 4:13pm UTC](https://forum.uipath.com/t/http-request-snow-post/363652/1 "2021-11-22T16:13:11Z")

</div>

API Post attachment of Excel file to Service Now is not allowing me to open after manually downloading attached file. Excel cannot open file “” because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file.

HTTP Request Activity - POST  
Attachment - File path and name (with extension) - Ex: documents/Config.xlsx  
Content-type = used nothing, document/excel, multi-part  
Body = Empty  
Body format = application/json

---

<div class="post-metadata">

**Author:** ![dokumentor](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/dokumentor/32/459286_2.png) [@dokumentor](https://forum.uipath.com/u/dokumentor)\
**Post date:** [November 22, 2021, 4:28pm UTC](https://forum.uipath.com/t/http-request-snow-post/363652/2 "2021-11-22T16:28:24Z")

</div>

It is probable that you didn’t indicate filename extension or MIME type when executing POST. Can you provide more information? Like screenshot of HTTP Request activity properties

---

<div class="post-metadata">

**Author:** ![lori.k.aucoin](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lori.k.aucoin/32/177528_2.png) [@lori.k.aucoin](https://forum.uipath.com/u/lori.k.aucoin)\
**Post date:** [November 22, 2021, 4:34pm UTC](https://forum.uipath.com/t/http-request-snow-post/363652/3 "2021-11-22T16:34:02Z")

</div>

HTTP Properties:

 ![image](https://global.discourse-cdn.com/uipath/original/4X/c/d/7/cd74505a62a8bda15754228e6cebf269527516a5.png)

---

<div class="post-metadata">

**Author:** ![dokumentor](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/dokumentor/32/459286_2.png) [@dokumentor](https://forum.uipath.com/u/dokumentor)\
**Post date:** [November 22, 2021, 4:34pm UTC](https://forum.uipath.com/t/http-request-snow-post/363652/4 "2021-11-22T16:34:47Z")

</div>

correct Content-Type for xlsx file is:

```auto
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

```

---

<div class="post-metadata">

**Author:** ![lori.k.aucoin](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lori.k.aucoin/32/177528_2.png) [@lori.k.aucoin](https://forum.uipath.com/u/lori.k.aucoin)\
**Post date:** [November 22, 2021, 4:43pm UTC](https://forum.uipath.com/t/http-request-snow-post/363652/5 "2021-11-22T16:43:04Z")

</div>

That did not resolve the issue.  
If I use the API Explorer in SNOW with the same file, I am able to successfully download and open the file.

---

<div class="post-metadata">

**Author:** ![dokumentor](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/dokumentor/32/459286_2.png) [@dokumentor](https://forum.uipath.com/u/dokumentor)\
**Post date:** [November 22, 2021, 4:46pm UTC](https://forum.uipath.com/t/http-request-snow-post/363652/6 "2021-11-22T16:46:44Z")

</div>

Were you able to perform post to upload attachment using UiPath? Did you receive a 201 code?

---

<div class="post-metadata">

**Author:** ![lori.k.aucoin](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lori.k.aucoin/32/177528_2.png) [@lori.k.aucoin](https://forum.uipath.com/u/lori.k.aucoin)\
**Post date:** [November 22, 2021, 4:47pm UTC](https://forum.uipath.com/t/http-request-snow-post/363652/7 "2021-11-22T16:47:33Z")

</div>

Yes sir.

---

<div class="post-metadata">

**Author:** ![dokumentor](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/dokumentor/32/459286_2.png) [@dokumentor](https://forum.uipath.com/u/dokumentor)\
**Post date:** [November 22, 2021, 4:55pm UTC](https://forum.uipath.com/t/http-request-snow-post/363652/8 "2021-11-22T16:55:17Z")

</div>

Can you share link to ServiceNow API Docs you are using?

---

<div class="post-metadata">

**Author:** ![lori.k.aucoin](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lori.k.aucoin/32/177528_2.png) [@lori.k.aucoin](https://forum.uipath.com/u/lori.k.aucoin)\
**Post date:** [November 22, 2021, 5:19pm UTC](https://forum.uipath.com/t/http-request-snow-post/363652/9 "2021-11-22T17:19:15Z")

</div>

[ServiceNow Developers](https://developer.servicenow.com/dev.do#!/reference/api/quebec/rest/c_AttachmentAPI) along with API explorer doc in SNOW to test out manually.

I am using /api/now/attachment/file from a binary request (not from a multipart form).

---

<div class="post-metadata">

**Author:** ![dokumentor](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/dokumentor/32/459286_2.png) [@dokumentor](https://forum.uipath.com/u/dokumentor)\
**Post date:** [November 22, 2021, 5:29pm UTC](https://forum.uipath.com/t/http-request-snow-post/363652/10 "2021-11-22T17:29:44Z")

</div>

As I can see you must set mime type depending on your file format. For xlsx, use:

`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`

This must be set in **BodyFormat** property

In parameters you also have to define the correct file name including extension.

And in **Body** property you need to include binary content from file (for example):

![image](https://global.discourse-cdn.com/uipath/original/4X/4/2/e/42e144150a374694aa4b1effba644c583eebad25.png)

Hope it helps!

---

<div class="post-metadata">

**Author:** ![lori.k.aucoin](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lori.k.aucoin/32/177528_2.png) [@lori.k.aucoin](https://forum.uipath.com/u/lori.k.aucoin)\
**Post date:** [November 30, 2021, 2:20pm UTC](https://forum.uipath.com/t/http-request-snow-post/363652/11 "2021-11-30T14:20:13Z")

</div>

Switched to /api/now/attachment/upload and everything worked as expected.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [December 3, 2021, 2:20pm UTC](https://forum.uipath.com/t/http-request-snow-post/363652/12 "2021-12-03T14:20:15Z")

</div>

Closed on December 3, 2021, 2:20pm UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
