"No Template Submitted" response from API???

oschlipf Approved! Accountant Posts: 11 Expensify Newcomer

I've searched the forum here but can't find a solution to this problem. This seems like it must be pretty basic but it's stumping me. I’m working on a script to interact with an API and I’m using curl on a Linux box because the API documentation is written with curl as the example scripting language. The part I’m having trouble with is passing in my “report template” as one of the parameters.

I'm just trying to get a basic "hello world" type call going for starters so I'm using the exact example from the API documentation:

--data-urlencode 'template@expensify_template.ftl'

That’s the piece that doesn’t seem to be working because the API responds with:

{"responseMessage":"No Template Submitted","responseCode":410}create: line 21: --data-urlencode: not found

My template file is in the same directory as the curl script and its named expensify_template.ftl.

Why is it telling me I didn't submit a template when I actually did (or so it appears to me)?

Best Answer

  • Francois Laithier
    Francois Laithier Expensify Team Posts: 33 Expensify Team
    Answer ✓

    Hi there,

    The part create: line 21: --data-urlencode: not found suggests that the --data-urlencode instruction is not part of your curl command. If you wrote that instruction on a separate line, make sure to add \ at the end of the previous line, like this:

    curl -X POST 'https://integrations.expensify.com/.....' \
        -d 'requestJobDescrption={...}' \
        --data-urlencode 'template@expensify_template.ftl'

    If that still doesn't work, try to replace the @ operator (which tells curl to read the content of the specified file) with a value directly, e.g.: --data-urlencode 'template=hello%20world