Skip to main content

I have a zap that creates a file from a google doc template and then sends it to a onedrive folder. It works, but its sending the file as text/google doc format when using the “file” object. I tried using the “file docx” object, but I get errors. is there something to know?

Hi @VF Immigration 

For us to have more info, post screenshots with how your Zap steps are outlined and configured in EDIT mode.

Help link for using files in Zaps: https://zapier.com/help/create/basics/send-files-in-zaps


Here’s the part of my zap that involves the File object:

As you can see, when using “file” everything works, ut when I use “file docx” it doesnt

 


@VF Immigration 

Can you post screenshots showing the encountered error?


The zap runs with success, but I get this 401 error in the upload to onedrive step, and then the file is uploaded as a raw text file instead of .docx

 


@VF Immigration 

The Zap substep API error is related to the JWT for authentication. (see context below)

 

In Zaps, file objects, like you are using, are temp files that expire after 1 hour.

Make sure you are trying with current/fresh data from Step 8.

You may need to test Step 8 again before testing Step 18 that uses data from Step 8.

 

###

 

Feedback from ChatGPT

The error you are encountering is related to an improperly formatted JSON Web Token (JWT). The message indicates that the JWT token is not well-formed because it lacks the necessary components, which are typically separated by periods (.).

Here’s a breakdown of the error:

  • "code": "InvalidAuthenticationToken": This suggests that the authentication process failed because the provided token was invalid.
  • "message": "IDX14100: JWT is not well formed, there are no dots (.)": This part of the message highlights that the JWT lacks the required structure. JWTs are supposed to have three parts: the header, payload, and signature, separated by periods (.).
    • JWS Format: The expected format is EncodedHeader.EncodedPayload.EncodedSignature.
    • JWE Format: Alternatively, for an encrypted JWT (JWE), the format would be EncodedProtectedHeader.EncodedEncryptedKey.EncodedInitializationVector.EncodedCiphertext.EncodedAuthenticationTag.

In summary, the system expects a valid JWT token, which consists of these components separated by periods, but the provided token is missing them. This suggests either an issue with token generation or an incomplete/incorrect token being passed in the request.

Suggested Action:

Ensure that the JWT is being generated properly and that it follows the correct format. If you're using a third-party service or library to generate the JWT, check the configuration or setup to ensure it's correctly creating the token.


Hi, thanks for the info, but My two steps don’t have any delays. I tested all the steps and even ran the published version and it still didn’t work.

After testing multiple ideas that I had, I found that hard-coding the format in the title parameter gave the right results. So i just ended up adding ”.docx” manually to the file name parameter in my zap.


Hi, thanks for the info, but My two steps don’t have any delays. I tested all the steps and even ran the published version and it still didn’t work.

After testing multiple ideas that I had, I found that hard-coding the format in the title parameter gave the right results. So i just ended up adding ”.docx” manually to the file name parameter in my zap.

I also ended up using the export link from Google Docs instead of the File object


Thanks for taking the time to share details on the solution you implemented @VF Immigration. Really glad you were able to get things solved - nice work! 😁 🙌

Seems like you’ve got things all sorted for now but please do reach back out if you need any further help at all. In the meantime, happy Zapping! ⚡️