Can't call project/%d/translations/es-ES to upload a translation file. Get "Method not allowed"

I’m trying to upload a translation file using the API by hitting https://api.crowdin.com/api/v2/projects/564701/translations/es-ES
with {“storageId”:2236760569,“fileId”:73294,“importEqSuggestions”:true,“autoApproveImported”:true}
as the body.
This call always returns “Method Not Allowed” and a 405 error. I’ve gone through every setting, and all the API powers, and it seems like this method should work. I can hit a dozen different API endpoints and they work fine, it’s just this one that’s failing.

What do I need to do to enable this API endpoint for my project?

Hi!
Please try running the following endpoint and let us know about the result: https://crowdin.com/api/v2/projects/564701/translations/es-ES

I get the same “Method not allowed” error.

Hello Adam,

Are you using this call?
https://support.crowdin.com/developer/api/v2/#tag/Translations/operation/api.projects.translations.postOnLanguage

I don’t see any unsuccessful API logs with “upload translation” calls for project 564701 (you can double-check in Project Tools - API - API Logs).

Also, I see that on October 4 you successfully uploaded the Spanish translation into this project, can you kindly let me know what has changed from that time? Did you use different call or different call structure?

That upload happened when I went through the “Upload Translations” webform on Crowdin. I’ve never managed to successfully upload a translation file via the API.

I don’t see any unsuccessful calls either, so I’m very confused what’s happening. FWIW I’ve also tried this on our prod project 10880 and I see exactly the same error message.

I’d also note that I’m getting a 405, not a 401:Unauthorized or a 403:Forbidden. I’d expect one of those if permissions was a problem, but at this point I don’t really know what to expect.

Ok, I think I found my issue. I was sending a PUT request, and this is a POST api. It seems to be working better now.

Hello Adam,

Please try performing this call via some sandbox tool (like Postman for example), to avoid misconfiguration. Also, make sure you’re using the needed scopes in the access token.

https://support.crowdin.com/developer/api/v2/#tag/Translations/operation/api.projects.translations.postOnLanguage

In case it doesn’t work via Postman, please share with me the full call payload (without a token or other sensitive data) + some details about the translation file (what format you have, can it be uploaded via UI without any issues, etc)

If you have some concerns about privacy (sharing payload, translation file, etc) feel free to send me a direct message instead of replying here

Oh, I missed your last reply. Great to hear that everything works well now!