How to send base64encoded attachment with multipart data format from ServiceNow to TOPDESK tool

saikatmitra6919
Tera Contributor

Hi Team,

 

How to send base64encoded attachment with multipart data format from ServiceNow to TOPDESK tool. Any advise with coding example will be appreciated.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@saikatmitra6919 

check these links and you will get some idea, please enhance based on the API team

Multipart/form-data attachment pusg using Rest API from Snow->Jira 

Outbound REST - Multipart/form-data 

REST API attachments Transfer to JIRA 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

6 REPLIES 6

Do you have any screenshots ? 🙂

Building the multipart for TOPdesk is new to me.  I am unsure on how the boundary part need to be built correctly with the file data.

JoelL2
Tera Contributor

I complicated it with boundary etc... and did not note the RED text in the instructions...

1.  create NEW  "action". give it a name.

2. when action is created define INPUTS
JoelL2_2-1746170006813.png

 

When inputs is defined.
3. Define connection details. (not documented here on how to do this.)
NOTE: the "BASE URL:"

JoelL2_0-1746169822368.png

Note: a way of defining the resoource url part. (this is combined with the base url).
Note:  "POST" http method.

4.  Do not define header. it will not work if it is defined.

Note: no header.

Note: "Multipart".
Note: "File"   AND  contenttype and filename "from attachment".

Note: point out to the input defined in step 2.

JoelL2_3-1746170608750.png


OUTPUT  add some output variables storing REST message results.
they can be used in the calling flow.

Save and "publish" the action.

testing:
create a flow that is triggered on insert  "after" on the  sys_attachment table.
then add the action created.   test on a attachemnt and see the results.
a. 

JoelL2_4-1746171239062.png

b.

JoelL2_5-1746171362208.png

 

c.   press "steps" to see the actual data of the rest action results.

JoelL2_7-1746171468916.png