https://github.com/crowdin/crowdin-api-client-php
PHP client library for Crowdin API
https://github.com/crowdin/crowdin-api-client-php
api client crowdin-api hacktoberfest php sdk
Last synced: 3 months ago
JSON representation
PHP client library for Crowdin API
- Host: GitHub
- URL: https://github.com/crowdin/crowdin-api-client-php
- Owner: crowdin
- License: mit
- Created: 2019-10-11T13:59:40.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2025-03-28T16:07:34.000Z (4 months ago)
- Last Synced: 2025-04-02T22:34:00.169Z (3 months ago)
- Topics: api, client, crowdin-api, hacktoberfest, php, sdk
- Language: PHP
- Homepage: https://packagist.org/packages/crowdin/crowdin-api-client
- Size: 1.84 MB
- Stars: 59
- Watchers: 6
- Forks: 33
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
![]()
# Crowdin PHP client
The Crowdin PHP client is a lightweight interface to the Crowdin API. It provides common services for making API requests.
Our API is a full-featured RESTful API that helps you to integrate localization into your development process. The endpoints that we use allow you to easily make calls to retrieve information and to execute actions needed.
[**`API Client Docs`**](https://crowdin.github.io/crowdin-api-client-php/packages/Crowdin.html) |
[**`Examples`**](https://github.com/crowdin/crowdin-api-client-php/blob/master/EXAMPLES.md) |
[**`Crowdin API`**](https://developer.crowdin.com/api/v2/) |
[**`Crowdin Enterprise API`**](https://developer.crowdin.com/enterprise/api/v2/)[](https://packagist.org/packages/crowdin/crowdin-api-client)
[](https://packagist.org/packages/crowdin/crowdin-api-client)
[](https://github.com/crowdin/crowdin-api-client-php/actions/workflows/basic.yml)
[](https://codecov.io/gh/crowdin/crowdin-api-client-php)
[](https://github.com/crowdin/crowdin-api-client-php/graphs/contributors)
[](https://github.com/crowdin/crowdin-api-client-php/blob/master/LICENSE)### Requirements
* PHP >= 7.1
## Installation
Install via Composer
```console
composer require crowdin/crowdin-api-client
```### Quick Start
The API client must be instantiated and configured before calling any API method.
```php
use CrowdinApiClient\Crowdin;$crowdin = new Crowdin([
'access_token' => '',
'organization' => '', // optional
]);
````` - Personal Access Token. You can generate Personal Access Token in your Crowdin Account Settings.
`` - Organization domain name (for Crowdin Enterprise users only).
For more about Authorization see the [documentation](https://developer.crowdin.com/api/v2/#section/Introduction/Authorization).
#### REST API Examples
* Create directory
```php
$directory = $crowdin->directory->create(
,
['name'=> 'My Directory']
);
```* Edit directory
```php
$directory->setTitle('My Title');$crowdin->directory->update($directory);
```* Delete directory
```php
$crowdin->directory->delete($directory->getProjectId(), $directory->getId());
```#### GraphQL API Example
For more information about GraphQL API see the [documentation](https://support.crowdin.com/developer/graphql-api/).
```php
$query = 'query($limit: Int) {
viewer {
projects(first: $limit) {
edges {
node {
name
files(first: $limit) {
totalCount
edges {
node {
name
type
}
}
}
}
}
}
}
}';$response = $crowdin->graphql->query($query, null, ['limit' => 10]);
```## Seeking Assistance
If you find any problems or would like to suggest a feature, please read the [How can I contribute](/CONTRIBUTING.md#how-can-i-contribute) section in our contributing guidelines.
## Contributing
If you would like to contribute, please read the [Contributing Guidelines](/CONTRIBUTING.md).
### License
The Crowdin PHP client is licensed under the MIT License.
See the LICENSE file distributed with this work for additional
information regarding copyright ownership.Except as contained in the LICENSE file, the name(s) of the above copyright
holders shall not be used in advertising or otherwise to promote the sale,
use or other dealings in this Software without prior written authorization.