Sending a ZIP file encoded in base64 via Keitaato Admin API in a Form

I’m working on integrating with the Keitaato Admin API, and I’m having trouble understanding how to send a ZIP file encoded in base64 as part of the form data. Here’s a brief overview of what I’m trying to achieve:

I have a form where users upload data, including a ZIP file.
The Keitaato Admin API expects string the ZIP file to be encoded in base64.
My question is: How can I properly send this ZIP file encoded in base64 as part of the form data to the Keitaato Admin API? Do I need to save the uploaded ZIP file on my server, then get its content convert its content to base64, and then send the request to the API?

  • base64_encode(file_get_contents('path/to/file.zip'))? But it’s very strange that it requires to put it as base64 string. Maybe try simply making multipart upload?

    – 

  • I assume you mean this? docs.keitaro.io/en/development/admin-api.html . Since there’s no documentation of specific endpoints, it’s very hard to advise on what the proper way to do it is, because we can’t see how the API documents what it’s expecting you to send. Please provide more detail

    – 

  • Be clear, what endpoint are you using ? don’t you have a Swagger or something, what is the documentation saying ?

    – 

  • @ADyson admin-api.docs.keitaro.io/#tag/Offers/paths/~1offers/post this one parametr archive it waiting for zip

    – 

Leave a Comment