Attachment to service API

Is there a way to attach files and use it in service api as file to upload it to other sites

Hi @sureshd,

You can use an entity node with the “Attachment” type which will prompt the user to upload a file and then you can use the entity node output to pass this to the service node API.

Regards,
Yoga Ramya

Hi @yogaramya.mendu ,
In my API I need to give like ‘uploadFile=@ location of the file on file system’, here how can I mention the location in kore.ai

Regards,
Suresh

Hi @sureshd,

When a file is uploaded to the entity node, the file object is returned as per the following screenshot:

image

Also, in the context object >> botUserSession >> channels, you can observe the attachment object.

Let us know if you need any further clarification.

Regards,
Yoga Ramya

Hi @yogaramya.mendu,

I can upload the image file and able to get the url,
image
after that i need to use this image file in a API(service node in kore.ai), by mentioning the filename along with path of the file for example in curl,
curl “https://instance.service-now.com/api/now/attachment/upload
–request POST
–header “Accept:application/json”
–user ‘admin’:‘admin’"
–header “Content-Type:multipart/form-data”
-F ‘table_name=incident’ -F ‘table_sys_id=xxxxxxxxxx’ -F ‘encryption_context=undefined’-F ‘uploadFile=@ location of the file on file system’
So, how to do this in kore.ai service node, for example
image

I tried this, but it is not working

Hi @yogaramya.mendu,

Any update on this?

Here I need to attach the file in API, ‘uploadFile=@ location of the file on file system’.

Regards,
Suresh

Hello sureshd,

Could you solved this issue? I was looking for the same.

Regards

Hi @daniel,

We have discussed this with our internal teams and observed that if your requirement is to pass the uploaded file to an API that can store the file in the required location, then passing the fileUrl alone will not help you achieve the requirement.

The fileUrl that is generated when a file is uploaded is only for one-time use i.e., once the URL is accessed to download the file, then it will be erased.

Hence, to achieve your requirement, we would need to download the file through botKit and then pass it to the respective API.

To understand more on botKit, please find the below documentation link:

https://developer.kore.ai/docs/bots/sdks/using-the-botkit-sdk/

However, we will further discuss this implementation with our development team and will let you know the implementation steps further.

Regards,
Yoga Ramya