onesky / api-documentation-platform

Documentation of platform API
60 stars 55 forks source link

Upload fails with { message: 'String file not found', code: 404 } #50

Closed bezysoftware closed 5 years ago

bezysoftware commented 5 years ago

I cannot upload phrases using the API, I get this error

{ message: 'String file not found', code: 404 }

Here's what the url looks like:

https://platform.api.onesky.io/1/projects/159815/files?api_key=...&timestamp=1559209817&dev_hash=...&is_keeping_all_strings=false&file_format=IOS_STRINGS&file=Localizable.strings

The file with this name and format exist in the web app

ryan-dan-coleman commented 5 years ago

Hi there, please open a support request by emailing support@oneskyapp.com with your organization name. We will investigate your case.

bezysoftware commented 5 years ago

It turned out to be bug in my code. Still, would be nice to have some more verbose response to understand what the server sees. If anyone is interested, this it the code I used for powershell:

    $form = @{
        'is_keeping_all_strings' = 'false'
        'file_format' = 'IOS_STRINGS'
        'file' = Get-Item $file
    }

    $response = Invoke-RestMethod -uri $uri -Method Post -Form $form

In particular notice the 'file' parameter