Giter VIP home page Giter VIP logo

Comments (18)

ira-sem avatar ira-sem commented on July 4, 2024 1

@PatrykPlewaOfficial small update: our team is aware of it and will work on the fix

from crowdin-api-client-dotnet.

PatrykPlewaOfficial avatar PatrykPlewaOfficial commented on July 4, 2024 1

@andrii-bodnar How about the other issue above? 😉

from crowdin-api-client-dotnet.

andrii-bodnar avatar andrii-bodnar commented on July 4, 2024 1

@innomaxx could you please take a look?

from crowdin-api-client-dotnet.

andrii-bodnar avatar andrii-bodnar commented on July 4, 2024 1

@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.

PatrykPlewaOfficial avatar PatrykPlewaOfficial commented on July 4, 2024

My tests showed that switching the Payload property to object type fixes the listing operation.

from crowdin-api-client-dotnet.

PatrykPlewaOfficial avatar PatrykPlewaOfficial commented on July 4, 2024

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.

ira-sem avatar ira-sem commented on July 4, 2024

Hi @PatrykPlewaOfficial ! Checking on our side

from crowdin-api-client-dotnet.

innomaxx avatar innomaxx commented on July 4, 2024

Hi @PatrykPlewaOfficial!
Thanks for your issue and investigation. Fixed in #128 + added tests.

from crowdin-api-client-dotnet.

PatrykPlewaOfficial avatar PatrykPlewaOfficial commented on July 4, 2024

Hi guys, great news 👍 .

How about this issue?

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}}"
}

is this related to the client? Has this been fixed as well? Let me know.

from crowdin-api-client-dotnet.

PatrykPlewaOfficial avatar PatrykPlewaOfficial commented on July 4, 2024

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.

image

from crowdin-api-client-dotnet.

innomaxx avatar innomaxx commented on July 4, 2024

@PatrykPlewaOfficial thanks for your investigation. We will check it on our side asap

from crowdin-api-client-dotnet.

PatrykPlewaOfficial avatar PatrykPlewaOfficial commented on July 4, 2024

Please reopen until the investigation is finished 😉

from crowdin-api-client-dotnet.

andrii-bodnar avatar andrii-bodnar commented on July 4, 2024

@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.

andrii-bodnar avatar andrii-bodnar commented on July 4, 2024

@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.

PatrykPlewaOfficial avatar PatrykPlewaOfficial commented on July 4, 2024

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.

andrii-bodnar avatar andrii-bodnar commented on July 4, 2024

@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.

PatrykPlewaOfficial avatar PatrykPlewaOfficial commented on July 4, 2024

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
image

And finally, this is what I see as a payload of my created webhook on Webhooks page (Crowdin UI)
image

which is completely different than my request.

from crowdin-api-client-dotnet.

andrii-bodnar avatar andrii-bodnar commented on July 4, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.