crowdin v1 API to crowdin v2 API

193 Views Asked by At

I'm using crowdin's V1 API to send newly added keys to crowdin and now want to shift to v2 API of crowdin. My current API is below $url = "https://api.crowdin.com/api/project/$projectIdentifier/update-file?key=$projectKey"

Now I read in crowdin docmentation they asked to create storage first then add file and then update file. I believe create storage and add file must be one time activity and update file is the API which I would have to create which will get called daily. Is this correct understanding?

I've create storage and can access it. *I need example to of all 3 actions using ps1.

  • add storage
  • add file
  • update file.*

I felt crowdin should have create storage for existing users who were using v1 API but looks like that's not there.

https://developer.crowdin.com/api/v2/#tag/Storage

1

There are 1 best solutions below

0
Andrii Bodnar On

The Crowdin API v2 Storage is a separate container for each file. You need to use the Add Storage method before adding files to your projects via API. Files that should be uploaded into storage include files for localization, screenshots, glossaries, and translation memories.

In your case, the sequence of API calls will be the following:

  • Add Storage to upload your file to the "container" for further use in other API methods.
  • Add File (using the received Storage ID from the Add Storage response).
  • or Update or Restore File in case the file already exists in the Crowdin project.

Please note that storages are not permanent, they will be purged sometime after uploading. Also, it is not recommended to reuse storages, it's always better to create a new one.

In addition, feel free to check the official API Clients available: