POST /v1/:account/projects/:project/resources

Upload the resource file and import the file contents into the LingoHub project.

Path Parameters

  • account (username of project owner)
  • project (project url, e.g. “Sample Project” -> “sample-project”)

Required Parameters

Optional Parameters

  • Specific Import Settings
    • source:createNew
    • source:updateExisting
    • source:deactivateMissing
    • target:createNew
    • target:updateExisting
    • target:deactivateMissing
  • iso2_slug
  • path (the path information as stored on Lingohub, if a file with the same filename is imported from different path locations, eg. via repository import)

The “Specific Import Settings” will overwrite your project import settings. Each parameter overwrites a setting of your Import Settings just  for this API call and won’t change your saved project import settings.
Parameters starting with “source:” will be used if you upload a file that belongs to the source language of your project. The Parameters that start with “target:” apply if you are uploading a file that belongs to any of your target languages of your project.

 

Example

curl -X POST https://api.lingohub.com/v1/acme/projects/kaboom/resources.json?auth_token=token  -F "iso2_slug=en" -F "path=en.lproj/" -F "[email protected]/path/to/file/Localizable.strings"
// A message describing success/failure. The HTTP response code is an indicator for the success.

{ "status": "Success" }
curl -X POST https://api.lingohub.com/v1/acme/projects/kaboom/resources.xml?auth_token=token  -F "iso2_slug=en" -F "[email protected]/path/to/file/Localizable.strings"
<!-- A message describing success/failure. The HTTP response code is an indicator for the success. -->

<?xml version="1.0" encoding="UTF-8"?>
<hash>
  <status>Success</status>
</hash>


Was this Helpful ?   yes     no Chat with us