Skip to main content
Question

Transferring attachments from the API


DBZachritz
Apprentice
Forum|alt.badge.img+2

We’re trying to create sub-tickets (*not actual “Child Tickets*) via an API call, but we need to be able to transfer attachments from the main ticket to them (they generally only have one attachment).

When I attempt to put the attachment section from the JSON of the parent ticket into the creation payload, I get a Validation Failed on attachments field of datatype_mismatch with message “It should be of type valid file format”.

Here’s the payload I’m putting into my POST to /api/v2/tickets

{
"email": "REDACTED@redacted.org",
"status": 2,
"priority": 1,
"source": 1,
"subject": "Child Vaya Onboarding Test",
"description": "This is a test to Business Apps. Please refer to the parent ticket for attachments.",
"workspace_id": 2,
"group_id": 23000165356,
 "attachments": [
            {
                "id": 23005786611,
                "content_type": "application/octet-stream",
                "size": 1306,
                "name": "EMP--2024_01_18.csv",
                "attachment_url": "https://REDACTED.attachments.freshservice.com/data/helpdesk/attachments/production/23005786611/original/EMP--2024_01_18.csv?response-content-type=application/octet-stream&Expires=1705702403&Signature=hHUklMRKDi9U4P0RWzp9Zq3fbGzG2w~5J7ERH3RFnqq90cLrS3K~0T7gCcsjQrbkbgJ4DQtf895nW1IzP2tgbKO0hEJDjEkd6iyGSafn~ZR2uosn-CEOwjDpMaTRYwtvxWOn1NzfVFiELLXOsYM0P5Ac4teQpJimzmDfXbNzysU1m7g5RT-pyvJnexMsenaWvobmnlucb-1Nr9GyKnVC70kqTnFUJfyHoWrNs40hRpNu~rOAiJsh4OAaKwxDpegLwGL3DFDfuMz9P6QwuKDakwelUjgYbR3T6odCXOaloOkkjAj-cqbgu4P0Z6XtqGnSGxvpsxompVjmSsMPT7FQbQ__&Key-Pair-Id=APKAIPHBXWY2KT5RCMPQ",
                "created_at": "2024-01-18T13:45:12Z",
                "updated_at": "2024-01-18T13:45:12Z"
            }
        ]
}

Any help would be greatly appreciated.

Did this topic help you find an answer to your question?

2 replies

Daniel Söderlund
Skilled Expert
Forum|alt.badge.img+14

Freshdesk webhook do not allow to change the data type. So it can’t be done. 


Daniel Söderlund
Skilled Expert
Forum|alt.badge.img+14

You may need to look at a app for this. 


Reply