Dust Community Icon

Struggling with Dust Apps: Curl POST Issues and Workarounds

·
·

Hello !!!! I'm building some Dust Apps to connect to my Attio CRM, GCal and some more. Overall I always have big struggle making Dust apps work using curl POST. Because the environment is easier to work with, I write some Google Script functions that I can easily test, edit and so on... and then the Dust Apps simply call those Google Script with the correct input. t works well when I call them using a Curl GET and passing input in the URL, but I can't do that for some input (like email body). When I try to do a POST I get some error and weird behavior within dust App. Those same Curl POST calls work perfectly when called from somewhere else that Dust (tried on many device, and environment). We have been 3 different persons struggling to make those Dust curl POST work. It there a know bug or any work around ? Thanks in advance for your help !

  • Avatar of Alban
    Alban
    ·
    ·

    Hi Raphael, can you tell us a bit more about the 'very weird error' you're seeing? Without details it's a bit hard to investigate 😁

  • Avatar of Raphaël Vullierme
    Raphaël Vullierme
    ·
    ·

    Sure 😉 [ 1 log] [ 1 success ] 0: { created, status, headers, body } created: 1739781795987 status: 200 headers: { content-type, cache-control, pragma, expires, date, transfer-encoding, referrer-policy, x-content-type-options, x-xss-protection, server } content-type: text/html; charset=utf-8 cache-control: no-cache, no-store, max-age=0, must-revalidate pragma: no-cache expires: Mon, 01 Jan 1990 00:00:00 GMT date: Mon, 17 Feb 2025 08:43:15 GMT transfer-encoding: chunked referrer-policy: origin x-content-type-options: nosniff x-xss-protection: 1; mode=block server: GSE body: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Error</title><style type="text/css" nonce="qDmUztWayI-jtAUylCaoeg">body {background-color: #fff; margin: 0; padding: 0;}.errorMessage {font-family: Arial,sans-serif; font-size: 12pt; font-weight: bold; line-height: 150%; padding-top: 25px;}</style></head><body style="margin:20px"><div><img alt="Google Apps Script" src="//ssl.gstatic.com/docs/script/images/logo.png"></div><div style="text-align:center;font-family:monospace;margin:50px auto 0;max-width:600px">TypeError: Cannot read properties of undefined (reading &#39;target_object&#39;) (line 52, file &quot;Code&quot;)</div></body></html>

  • Avatar of Raphaël Vullierme
    Raphaël Vullierme
    ·
    ·

    Happy to send the full query in private

  • Avatar of Alban
    Alban
    ·
    ·

    Well that's a quite clear error, you're calling {someVariable}.target_object in your code and someVariable is undefined

  • Avatar of Alban
    Alban
    ·
    ·

    Can you try to direct your Dust app call to something like https://webhook.site to see exactly what your app is sending?