0

The API's Documentation said I should put in Body Params:

  1. restaurant_token:(required)string -> API Access Token providen by Tiller
  2. provider_token:(required)string -> API Access Token providen by Tiller
  3. inventory:(required)file -> Inventory import file
  4. clear:(booleantrue) -> remove existing items or not

My POST request is :

https://app.tillersystems.com/api/inventory/import

And my JSON is:

{
    "provider_token": "xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "restaurant_token": "xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "inventory": "C://Mes Projets//N74_Interface_Sage_Tiller//Exe//Traitement//Articles_SAGE_20210826172848541.csv",
    "clear": true
}

The request's answer is:

{
    "import": false,
    "message": "Missing \"inventory\" file field."
}
Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
  • You can convert the file to base64. But do not forget that in this case, its size increases by 33% – wowandy Aug 27 '21 at 09:23

1 Answers1

0

You can encode file to base64 and put it as string like this

But I think the best solution is to use standard file sharing protocols

To send large files, in any case, you will have to send them in their original form, without convertation to base64

To download files on the client, you can receive data about the file in the json format, which will include the generated link to download the file using the standard protocol

wowandy
  • 1,124
  • 2
  • 10
  • 23