crowdin / crowdin-api-client-php

PHP client library for Crowdin API
https://packagist.org/packages/crowdin/crowdin-api-client
MIT License
57 stars 31 forks source link

Add more examples of API Client usage #112

Open andrii-bodnar opened 1 year ago

andrii-bodnar commented 1 year ago

Currently, we have very few simple examples in the Readme and it would be great to have more examples that would include more complex workflows:

It's better to create a separate file for these examples like here.

ivdimova commented 1 year ago

Hey @andrii-bodnar, could you please provide an example of downloading a glossary? Everything else seems to work fine, but as there are not many examples, I am unsure what goes wrong with the glossary download, may be I am missing a step. The exports seem to work fine though. Thanks in advance!

andrii-bodnar commented 1 year ago

Hi @ivdimova,

could you please provide the current code sample where you're trying to download a glossary?

Thanks.

ivdimova commented 1 year ago

@andrii-bodnar well, it looks like the download method only requires the glossary id, so I tried to create an import and then download - $export` = $crowdin->glossary->export( $id, 'csv' ); $downloadFile = $crowdin->glossary->download( $id );

However in the API docs the download endpoint also requires an export ID?

andrii-bodnar commented 1 year ago

@ivdimova hm, the GlossaryApi:download method looks a bit outdated indeed. It should include the exportId as well.

Thanks for pointing this out. Would you like to create a PR with the fix? 🙂

faizan1191 commented 11 months ago

@andrii-bodnar do you want more examples of API usage in the readme of this repo as currently, we only have example of creating a directory?

andrii-bodnar commented 11 months ago

@faizan1191 we can create a separate file for examples like in the JS API client - https://github.com/crowdin/crowdin-api-client-js/blob/master/EXAMPLES.md