Receive email notifications by changing your settings.
Click on your picture in the top right corner, go to Preferences and select your notification preferences.
Thank you for contributing to our forum!
Please keep in mind:
1. To only comment on the topic where the discussion is about. Do you have a new question or topic? Please start a new discussion.
2. Be kind to other users!

Excel import via API

I'm trying to import an excel via the API. I believe this should be the call for that: https://preview.tygron.com/api/session/event/editorexcelsheet/


It's however unclear to me what this exactly requires as an input. It's a string, byte, string input with no additional information. I assume it's something like:

  • Excel name
  • Excel fyle as a byte array or something
  • Some other string.

What is the input per element and I are there any pointers on how to get the Excel import as a byte array?

Comments

  • Hi Len,

    the arguments required should be as follows:

    • The name of the file being uploaded ("example.xlsx")
    • The binary data of the file in full
    • The user uploading the file ("user@organization.com")

    The binary data of the file is the least directly transparent part, but whichever language or framework you are using should be able to load read the binary data of the file as stored locally. That data can then be sent verbatim to the API, or as a base64 string. You can test this in the online html api endpoint by taking an excel file, running it through a base64 encoder, then setting the resulting base64 string as the second parameter. Do note that the base64 string will need to be enclosed with double quotes. The parameters will therefor be:

    • example.xlsx
    • "TGlrZSB0aGlzLCBidXQgdXNlIGEgZmlsZQ=="
    • script@organization.com

    Regards!

    Rudolf

  • Took some trial and error but figured it out. Important note which took me a while to find is that the input name can't have a capital letter. But I believe I have it working.


    Maybe it might be an option for the other users to update the online html api endpoint page to reflect what you've written in this reply.


    Thanks! Len

Sign In or Register to comment.