Comments (18)
@PatrykPlewaOfficial small update: our team is aware of it and will work on the fix
from crowdin-api-client-dotnet.
@andrii-bodnar How about the other issue above? 😉
from crowdin-api-client-dotnet.
@innomaxx could you please take a look?
from crowdin-api-client-dotnet.
@PatrykPlewaOfficial thank you, I was able to reproduce this issue. It's something not related to the Crowdin .NET client. Passing it to the team.
from crowdin-api-client-dotnet.
My tests showed that switching the Payload
property to object
type fixes the listing operation.
from crowdin-api-client-dotnet.
Another problem appears with AddWebhook
operation. The Payload
provided in the request does not match the Payload
that appears in Crowdin UI.
Request payload (Crowdin's default):
{
"name": "Exported translation updated",
"url": "http://localhost:5000/api/translation/updated",
"events": ["translation.updated"],
"requestType": "POST",
"isActive": true,
"batchingEnabled": false,
"contentType": "application/json",
"headers": { "x-api-key": "secret" },
"payload": {
"event": "{{event}}",
"oldTranslation": {
"id": "{{oldTranslationId}}",
"text": "{{oldTranslationText}}",
"pluralCategoryName": "{{oldTranslationPluralCategoryName}}",
"rating": "{{oldTranslationRating}}",
"createdAt": "{{oldTranslationCreatedAt}}"
},
"newTranslation": {
"id": "{{newTranslationId}}",
"text": "{{newTranslationText}}",
"pluralCategoryName": "{{newTranslationPluralCategoryName}}",
"rating": "{{newTranslationRating}}",
"createdAt": "{{newTranslationCreatedAt}}",
"user": {
"id": "{{userId}}",
"username": "{{userUsername}}",
"fullName": "{{userFullName}}",
"avatarUrl": "{{userAvatarUrl}}"
},
"targetLanguage": {
"id": "{{targetLanguageId}}",
"name": "{{targetLanguageName}}",
"editorCode": "{{targetLanguageEditorCode}}",
"twoLettersCode": "{{targetLanguageTwoLettersCode}}",
"threeLettersCode": "{{targetLanguageThreeLettersCode}}",
"locale": "{{targetLanguageLocale}}",
"androidCode": "{{targetLanguageAndroidCode}}",
"osxCode": "{{targetLanguageOsxCode}}",
"osxLocale": "{{targetLanguageOsxLocale}}",
"textDirection": "{{targetLanguageTextDirection}}",
"dialectOf": "{{targetLanguageDialectOf}}"
},
"string": {
"id": "{{stringId}}",
"identifier": "{{stringIdentifier}}",
"key": "{{stringKey}}",
"text": "{{stringText}}",
"type": "{{stringType}}",
"context": "{{stringContext}}",
"maxLength": "{{stringMaxLength}}",
"isHidden": "{{stringIsHidden}}",
"isDuplicate": "{{stringIsDuplicate}}",
"masterStringId": "{{stringMasterStringId}}",
"revision": "{{stringRevision}}",
"hasPlurals": "{{stringHasPlurals}}",
"labelIds": "{{stringLabelIds}}",
"url": "{{stringUrl}}",
"createdAt": "{{stringCreatedAt}}",
"updatedAt": "{{stringUpdatedAt}}",
"file": {
"id": "{{fileId}}",
"name": "{{fileName}}",
"title": "{{fileTitle}}",
"type": "{{fileType}}",
"path": "{{filePath}}",
"status": "{{fileStatus}}",
"revision": "{{fileRevision}}",
"branchId": "{{branchId}}",
"directoryId": "{{directoryId}}"
},
"project": {
"id": "{{projectId}}",
"userId": "{{projectUserId}}",
"sourceLanguageId": "{{projectSourceLanguageId}}",
"targetLanguageIds": "{{projectTargetLanguageIds}}",
"identifier": "{{projectIdentifier}}",
"name": "{{projectName}}",
"createdAt": "{{projectCreatedAt}}",
"updatedAt": "{{projectUpdatedAt}}",
"lastActivity": "{{projectLastActivity}}",
"description": "{{projectDescription}}",
"url": "{{projectUrl}}",
"cname": "{{projectCname}}",
"logo": "{{projectLogo}}",
"isExternal": "{{projectIsExternal}}",
"externalType": "{{projectExternalType}}",
"hasCrowdsourcing": "{{projectHasCrowdsourcing}}"
}
}
}
}
}
Payload that appears in Crowdin UI:
{
"event": "{{event}}",
"project": "{{projectIdentifier}}",
"project_id": "{{projectId}}",
"language": "{{targetLanguageId}}",
"source_string_id": "{{stringId}}",
"old_translation_id": "{{oldTranslationId}}",
"new_translation_id": "{{newTranslationId}}",
"user": "{{userFullName}}",
"user_id": "{{userId}}",
"file_id": "{{fileId}}",
"file": "{{filePath}}"
}
from crowdin-api-client-dotnet.
Hi @PatrykPlewaOfficial ! Checking on our side
from crowdin-api-client-dotnet.
Hi @PatrykPlewaOfficial!
Thanks for your issue and investigation. Fixed in #128 + added tests.
from crowdin-api-client-dotnet.
Hi guys, great news 👍 .
How about this issue?
Another problem appears with
AddWebhook
operation. ThePayload
provided in the request does not match thePayload
that appears in Crowdin UI.Request payload (Crowdin's default):
{ "name": "Exported translation updated", "url": "http://localhost:5000/api/translation/updated", "events": ["translation.updated"], "requestType": "POST", "isActive": true, "batchingEnabled": false, "contentType": "application/json", "headers": { "x-api-key": "secret" }, "payload": { "event": "{{event}}", "oldTranslation": { "id": "{{oldTranslationId}}", "text": "{{oldTranslationText}}", "pluralCategoryName": "{{oldTranslationPluralCategoryName}}", "rating": "{{oldTranslationRating}}", "createdAt": "{{oldTranslationCreatedAt}}" }, "newTranslation": { "id": "{{newTranslationId}}", "text": "{{newTranslationText}}", "pluralCategoryName": "{{newTranslationPluralCategoryName}}", "rating": "{{newTranslationRating}}", "createdAt": "{{newTranslationCreatedAt}}", "user": { "id": "{{userId}}", "username": "{{userUsername}}", "fullName": "{{userFullName}}", "avatarUrl": "{{userAvatarUrl}}" }, "targetLanguage": { "id": "{{targetLanguageId}}", "name": "{{targetLanguageName}}", "editorCode": "{{targetLanguageEditorCode}}", "twoLettersCode": "{{targetLanguageTwoLettersCode}}", "threeLettersCode": "{{targetLanguageThreeLettersCode}}", "locale": "{{targetLanguageLocale}}", "androidCode": "{{targetLanguageAndroidCode}}", "osxCode": "{{targetLanguageOsxCode}}", "osxLocale": "{{targetLanguageOsxLocale}}", "textDirection": "{{targetLanguageTextDirection}}", "dialectOf": "{{targetLanguageDialectOf}}" }, "string": { "id": "{{stringId}}", "identifier": "{{stringIdentifier}}", "key": "{{stringKey}}", "text": "{{stringText}}", "type": "{{stringType}}", "context": "{{stringContext}}", "maxLength": "{{stringMaxLength}}", "isHidden": "{{stringIsHidden}}", "isDuplicate": "{{stringIsDuplicate}}", "masterStringId": "{{stringMasterStringId}}", "revision": "{{stringRevision}}", "hasPlurals": "{{stringHasPlurals}}", "labelIds": "{{stringLabelIds}}", "url": "{{stringUrl}}", "createdAt": "{{stringCreatedAt}}", "updatedAt": "{{stringUpdatedAt}}", "file": { "id": "{{fileId}}", "name": "{{fileName}}", "title": "{{fileTitle}}", "type": "{{fileType}}", "path": "{{filePath}}", "status": "{{fileStatus}}", "revision": "{{fileRevision}}", "branchId": "{{branchId}}", "directoryId": "{{directoryId}}" }, "project": { "id": "{{projectId}}", "userId": "{{projectUserId}}", "sourceLanguageId": "{{projectSourceLanguageId}}", "targetLanguageIds": "{{projectTargetLanguageIds}}", "identifier": "{{projectIdentifier}}", "name": "{{projectName}}", "createdAt": "{{projectCreatedAt}}", "updatedAt": "{{projectUpdatedAt}}", "lastActivity": "{{projectLastActivity}}", "description": "{{projectDescription}}", "url": "{{projectUrl}}", "cname": "{{projectCname}}", "logo": "{{projectLogo}}", "isExternal": "{{projectIsExternal}}", "externalType": "{{projectExternalType}}", "hasCrowdsourcing": "{{projectHasCrowdsourcing}}" } } } } }Payload that appears in Crowdin UI:
{ "event": "{{event}}", "project": "{{projectIdentifier}}", "project_id": "{{projectId}}", "language": "{{targetLanguageId}}", "source_string_id": "{{stringId}}", "old_translation_id": "{{oldTranslationId}}", "new_translation_id": "{{newTranslationId}}", "user": "{{userFullName}}", "user_id": "{{userId}}", "file_id": "{{fileId}}", "file": "{{filePath}}" }
is this related to the client? Has this been fixed as well? Let me know.
from crowdin-api-client-dotnet.
I can share with you my investigation into that. It looks more to me like a back-end side issue.
The Crowdin's API Log
shows that the request had a correct payload however, something different was saved in the system.
from crowdin-api-client-dotnet.
@PatrykPlewaOfficial thanks for your investigation. We will check it on our side asap
from crowdin-api-client-dotnet.
Please reopen until the investigation is finished 😉
from crowdin-api-client-dotnet.
@PatrykPlewaOfficial thanks for the investigation, I will check it on the API side in more detail and then will come back as soon as possible
from crowdin-api-client-dotnet.
@PatrykPlewaOfficial recently we've enhanced the webhook payloads and now it includes much more data than before. It seems like your webhook was created before that and uses the old format (I mean this: Payload that appears in Crowdin UI
). It was kept in the old format for compatibility. But the new webhooks created via API or UI will have the new enhanced data.
from crowdin-api-client-dotnet.
Hi @andrii-bodnar .
I kinda don't understand that answer.
There is an API endpoint to create a new webhook of a desired payload - a payload of my choice.
However, the endpoint does not work correctly. I expect my payload to appear in Crowdin but I see something completely different.
Or do you mean that the .NET client is outdated that's why the Crowdin API does not respect my Payload property? Which would be very odd because the client works exactly like the docs say.
from crowdin-api-client-dotnet.
@PatrykPlewaOfficial probably I misunderstood the request. Could you please share in more detail what do you mean by "appear in Crowdin"?
from crowdin-api-client-dotnet.
Sure @andrii-bodnar ,
This is how my payload in the request look like
{
"name": "Exported translation updated",
"url": "http://localhost:5000/api/translation/updated",
"events": ["translation.updated"],
"requestType": "POST",
"isActive": true,
"batchingEnabled": false,
"contentType": "application/json",
"headers": { "x-api-key": "secret" },
"payload": {
"event": "{{event}}",
"oldTranslation": {
"id": "{{oldTranslationId}}",
"text": "{{oldTranslationText}}",
"pluralCategoryName": "{{oldTranslationPluralCategoryName}}",
"rating": "{{oldTranslationRating}}",
"createdAt": "{{oldTranslationCreatedAt}}"
},
"newTranslation": {
"id": "{{newTranslationId}}",
"text": "{{newTranslationText}}",
"pluralCategoryName": "{{newTranslationPluralCategoryName}}",
"rating": "{{newTranslationRating}}",
"createdAt": "{{newTranslationCreatedAt}}",
"user": {
"id": "{{userId}}",
"username": "{{userUsername}}",
"fullName": "{{userFullName}}",
"avatarUrl": "{{userAvatarUrl}}"
},
"targetLanguage": {
"id": "{{targetLanguageId}}",
"name": "{{targetLanguageName}}",
"editorCode": "{{targetLanguageEditorCode}}",
"twoLettersCode": "{{targetLanguageTwoLettersCode}}",
"threeLettersCode": "{{targetLanguageThreeLettersCode}}",
"locale": "{{targetLanguageLocale}}",
"androidCode": "{{targetLanguageAndroidCode}}",
"osxCode": "{{targetLanguageOsxCode}}",
"osxLocale": "{{targetLanguageOsxLocale}}",
"textDirection": "{{targetLanguageTextDirection}}",
"dialectOf": "{{targetLanguageDialectOf}}"
},
"string": {
"id": "{{stringId}}",
"identifier": "{{stringIdentifier}}",
"key": "{{stringKey}}",
"text": "{{stringText}}",
"type": "{{stringType}}",
"context": "{{stringContext}}",
"maxLength": "{{stringMaxLength}}",
"isHidden": "{{stringIsHidden}}",
"isDuplicate": "{{stringIsDuplicate}}",
"masterStringId": "{{stringMasterStringId}}",
"revision": "{{stringRevision}}",
"hasPlurals": "{{stringHasPlurals}}",
"labelIds": "{{stringLabelIds}}",
"url": "{{stringUrl}}",
"createdAt": "{{stringCreatedAt}}",
"updatedAt": "{{stringUpdatedAt}}",
"file": {
"id": "{{fileId}}",
"name": "{{fileName}}",
"title": "{{fileTitle}}",
"type": "{{fileType}}",
"path": "{{filePath}}",
"status": "{{fileStatus}}",
"revision": "{{fileRevision}}",
"branchId": "{{branchId}}",
"directoryId": "{{directoryId}}"
},
"project": {
"id": "{{projectId}}",
"userId": "{{projectUserId}}",
"sourceLanguageId": "{{projectSourceLanguageId}}",
"targetLanguageIds": "{{projectTargetLanguageIds}}",
"identifier": "{{projectIdentifier}}",
"name": "{{projectName}}",
"createdAt": "{{projectCreatedAt}}",
"updatedAt": "{{projectUpdatedAt}}",
"lastActivity": "{{projectLastActivity}}",
"description": "{{projectDescription}}",
"url": "{{projectUrl}}",
"cname": "{{projectCname}}",
"logo": "{{projectLogo}}",
"isExternal": "{{projectIsExternal}}",
"externalType": "{{projectExternalType}}",
"hasCrowdsourcing": "{{projectHasCrowdsourcing}}"
}
}
}
}
}
This is the same exact payload visible in API Log in Crowdin
And finally, this is what I see as a payload of my created webhook on Webhooks page (Crowdin UI)
which is completely different than my request.
from crowdin-api-client-dotnet.
The development team has looked into this and confirmed that the current behavior is correct.
The request payload above is incorrect and should have the following structure:
{
"payload": {
"string.added": {...},
"string.updated": {...},
"string.deleted": {...}
}
}
Please refer to the API documentation to see the full valid example (The Request samples section).
from crowdin-api-client-dotnet.
Related Issues (20)
- Apply Pre-Translation API: add labels support HOT 3
- Applications API support HOT 8
- Report Settings Template: add the `isPublic` property support HOT 1
- Source Files: add the `context` property support HOT 4
- `WorkflowsApiExecutor` is not accessible in the `CrowdinApiClient` class HOT 2
- Strings translations APIs: add new parameters support HOT 2
- NuGet package: add Readme HOT 1
- Screenshots APIs: add the `labelIds` parameter support HOT 3
- Applications API: add support for new endpoints HOT 5
- StringBatchOperations return null HOT 7
- String-based API support HOT 6
- Security Logs API support
- List Language Translations API: support new parameters HOT 3
- Fields API support HOT 6
- Custom fuzzy match types in translation cost report HOT 1
- Remove the `markAddedTranslationsAsDone` parameter
- Tasks API updates
- UploadTranslations not working for XLIFF file HOT 3
- AI API support
- Add the `orderBy` parameter to list methods
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crowdin-api-client-dotnet.