Wa_D
(Wa D)
October 24, 2023, 5:45pm
1
Hi All,
I’ve been trying to hit FreshService Create a Ticket API from my react native app.
However, i kept getting validation error for attachments, if i do not append any attachments, the requests are succesfful.
{
"description": "Validation failed",
"errors": [
{
"field": "attachments",
"message": "It should contain elements of type valid file format only",
"code": "datatype_mismatch"
}
]
}
this is my request on my RN debugger:
am i using the wrong uri? or am i appending the object wrong? , it does not work if i just append the uri only also.
Please help! thanks
Hi,
have you tried another file other than the .png? Does the error not like your .png extension?
Wa_D
(Wa D)
October 25, 2023, 2:24am
3
Hi thanks for the reply,
i’ve also tried PDF. still get the same error
Wa_D
(Wa D)
October 26, 2023, 3:59pm
4
Hi, bumping this.
Anyone used React Native to upload attachments before? Thanks a million!
Wa_D
(Wa D)
November 16, 2023, 12:21pm
5
bump please, still facing this issue
Michele
(Michele Mangiaterra)
February 12, 2024, 9:10am
7
Hello @Wa_D ,
I was facing pretty much the same problem last year. This solution worked for me.
Hello @Thakur_Ganeshsingh ,
The documentation for the “create a ticket with attachment” tells you to attach the file via a path on your machine.
curl -v -u user@yourcompany.com :test -F ‘attachments=@/Users/user/Desktop/api_attach.png’ -F ‘subject=Support Needed…’ -F ‘description=Details about the issue…’ -F ‘email=tom@outerspace.com’ -F ‘priority=1’ -F ‘status=2’ -F ‘workspace_id=3’ -X POST ‘https://domain.freshservice.com/api/v2/tickets ’
In the meantime I found another way to send files to…
1 Like
system
(system)
Closed
May 12, 2024, 9:10am
8
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.