addString: CrowdinValidationError: Value is required and can't be empty #175
-
Hello. Trying to add a string using Setup: const {SourceStrings} = require('@crowdin/crowdin-api-client');
const PROJECT_ID = <ID>;
const TOKEN = '...';
const sourceStringsApi = new SourceStrings({
token: TOKEN,
});
// get all strings via CroQL query
const search = (croql) =>
sourceStringsApi.listProjectStrings(PROJECT_ID, {
croql,
limit: 500,
});
// add new string
const addString = (identifier, text) => {
console.log('--addstring', {identifier, text});
return sourceStringsApi.addString(PROJECT_ID, {
identifier,
text,
});
}; Console output:
|
Beta Was this translation helpful? Give feedback.
Answered by
andrii-bodnar
May 18, 2022
Replies: 1 comment 7 replies
-
Hi @beshur! You need to pass the |
Beta Was this translation helpful? Give feedback.
7 replies
Answer selected by
beshur
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @beshur!
You need to pass the
fileId
also. It's required for file-based projects. https://support.crowdin.com/api/v2/#operation/api.projects.strings.post