Vor Kurzem aufgerufene Suchen


Keine vor kurzem aufgerufene Suchen

Luke Smith's Avatar

Luke Smith

Beigetreten 16. Aug. 2022

·

Letzte Aktivität 10. Jan. 2024

Folge ich

0

Follower

0

Gesamtaktivitäten

14

Stimmen

3

Abonnements

3

AKTIVITÄTSÜBERSICHT

Neueste Aktivität von Luke Smith

Luke Smith hat einen Kommentar hinterlassen

Community-Kommentar Feedback - Ticketing system (Support)

Funny how this has gotten no response from Zendesk at all. So frustrating.

Kommentar anzeigen · Gepostet 10. Jan. 2024 · Luke Smith

0

Follower

0

Stimmen

0

Kommentare


Luke Smith hat einen Post erstellt

Post Developer - Zendesk APIs

I'm having an issue with returning a response after creating a ticket. Note, the ticket gets created in Zendesk, so everything works except returning a response back to the browser. Here's my code:

const request = await fetch("https://{obscured}.zendesk.com/api/v2/tickets", {
    method: "POST",
    headers: {
        "Authorization": "Basic "+wp_helper.zendesk_token,
        "Content-Type": "application/json",
    },
    body: JSON.stringify({
        "ticket": {
            "comment": {
                "body": comment,
                "uploads": [
                    file_token
                ]
            },
            "requester": { "locale_id": 1, "name": full_name, "email": email },
            "subject": subject
        }
    })
});
let response = await request.json();
console.log(response);

These are the errors I'm getting in the browser console after the ticket is successfully created:

Tag: Eric Nelson

Gepostet 09. Sept. 2022 · Luke Smith

0

Follower

2

Stimmen

1

Kommentar


Luke Smith hat einen Kommentar hinterlassen

Community-Kommentar Developer - Zendesk APIs

Eric Nelson You rock! That worked perfectly. The thumbnails in Zendesk tickets now download a valid file that can be opened. We can close this ticket.

Really appreciate it!

Kommentar anzeigen · Gepostet 31. Aug. 2022 · Luke Smith

0

Follower

0

Stimmen

0

Kommentare


Luke Smith hat einen Kommentar hinterlassen

Community-Kommentar Developer - Zendesk APIs

That's right yep.. using AJAX to send POST request to Zendesk api. :)

Kommentar anzeigen · Gepostet 17. Aug. 2022 · Luke Smith

0

Follower

0

Stimmen

0

Kommentare


Luke Smith hat einen Kommentar hinterlassen

Community-Kommentar Developer - Zendesk APIs

Hey Eric Nelson,

I'm trying to upload a PDF file, but will need ability to upload docx, png etc. as well.

Kommentar anzeigen · Gepostet 17. Aug. 2022 · Luke Smith

0

Follower

0

Stimmen

0

Kommentare


Luke Smith hat einen Kommentar hinterlassen

Community-Kommentar Developer - Zendesk APIs

I'm at a loss here. The file continues to not work. Here's my latest ajax code for creating upload/attachment:

{
    url: "https://{obscured}.zendesk.com/api/v2/uploads?filename="+file_name,
    type: "POST",
    headers: {
        'Authorization': 'Basic '+wp_helper.zendesk_token,
        'Content-type': 'application/binary'
    },
    processData: false,
    data: file_base64
}

Note I'm passing the raw base64 content of the file.

Kommentar anzeigen · Bearbeitet 17. Aug. 2022 · Luke Smith

0

Follower

0

Stimmen

0

Kommentare


Luke Smith hat einen Kommentar hinterlassen

Community-Kommentar Developer - Zendesk APIs

Thanks for the reply Serge BERTAINA DUBOIS

Unfortunately that didn't work. :(

Kommentar anzeigen · Gepostet 17. Aug. 2022 · Luke Smith

0

Follower

0

Stimmen

0

Kommentare


Luke Smith hat einen Post erstellt

Post Developer - Zendesk APIs

I'm using the attachment and ticket api for creating a Zendesk ticket with an attachment. The ticket gets created successfully and even generates a thumbnail for the attached file with the correct file name! But when I download and try to open the file, it cannot be opened and the file is only a few hundred bytes.

Here's the Ajax call for creating the attachment first:

{
    url: "https://{obscured}.zendesk.com/api/v2/uploads?filename="+file_name,
    type: "POST",
    headers: {
        "Authorization": "Basic "+wp_helper.zendesk_token,
        "Content-Type": file_mime,
    },
    data: JSON.stringify({
        "content_type": file_mime,
        "content_url": file_url,
        "file_name": file_name,
        "size": file_size,
    })
}

And here's the nested Ajax call for creating the ticket with the generated file token from the parent ajax call:

{
    url: "https://{obscured}.zendesk.com/api/v2/tickets",
    type: "POST",
    headers: {
        "Authorization": "Basic "+wp_helper.zendesk_token,
        "Content-Type": "application/json",
    },
    contentType: "application/json",
    data: JSON.stringify({
        "ticket": {
            "comment": {
                "body": comment,
                "uploads": [
                    file_token
                ]
            },
            "requester": { "locale_id": 1, "name": full_name, "email": email },
            "subject": subject
        }
    })
}

I've double checked all variables are correctly formatted according to documentation and everything looks good. The weirdest part is the ticket is created with an attachment with the correct file name, but the file somehow does not get created properly on Zendesk.

Any thoughts?

Bearbeitet 16. Aug. 2022 · Luke Smith

1

Follower

3

Stimmen

11

Kommentare