Download the PHP package dvids/api-client without Composer
On this page you can find all versions of the php package dvids/api-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package api-client
DVIDS API Client for PHP
A modern PHP client library for the DVIDS (Defense Video & Imagery Distribution System) Content Submission API, built with PHP 8.2+ features including readonly classes, enums, named parameters, and strong typing.
Features
- Modern PHP 8.2+ Syntax: Utilizes readonly classes, enums, union types, and named parameters
- OAuth2 Authentication: Full support for DVIDS OAuth2 authentication flow
- Type Safety: Comprehensive type hints and data models for all API responses
- Immutable Design: Immutable client instances for thread safety
- Resource Clients: Dedicated clients for different API resources (Authors, Batches, etc.)
- File Uploads: Support for both simple and multipart file uploads
- Error Handling: Specific exception types for different HTTP status codes
- PSR-4 Autoloading: Standard PHP autoloading support
Installation
Requirements
- PHP 8.2 or higher
ext-jsonextensionext-opensslextension
Quick Start
Basic Usage
OAuth2 Authentication
Upload a single photo (simple case, no batch interaction)
Working with ServiceUnits
Working with Authors
File Upload Workflow with BatchUpload
The SDK uses a BatchUpload system with presigned URLs for secure file uploads:
src/ ├── DvidsClient.php # Main client class ├── DvidsApiClient.php # Low-level HTTP client ├── Exception/ # Exception classes │ ├── ApiException.php │ ├── BadRequestException.php │ ├── UnauthorizedException.php │ ├── AuthenticationException.php │ ├── NotFoundException.php │ └── ConflictException.php ├── Model/ # Data model classes │ ├── Author.php │ ├── AuthorReference.php │ ├── Batch.php │ ├── BatchUpload.php │ ├── BatchUploadReference.php │ ├── Branch.php │ ├── Graphic.php │ ├── GraphicCategoryReference.php │ ├── GraphicStatus.php │ ├── JobGrade.php │ ├── Photo.php │ ├── PhotoStatus.php │ ├── Publication.php │ ├── PublicationIssue.php │ ├── PublicationIssueStatus.php │ ├── PublicationReference.php │ ├── ServiceUnitReference.php │ └── ThemeReference.php └── Resource/ # Resource-specific clients ├── AuthorClient.php ├── BatchClient.php ├── GraphicClient.php ├── PhotoClient.php └── PublicationClient.php bash composer test bash composer analyze bash composer cs-fix
## Contributing
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests for new functionality
5. Run the test suite
6. Submit a pull request
## License
This project is licensed under the MIT License.
## Related Documentation
- [DVIDS API Documentation](https://api.dvidshub.net/docs/)
- [OAuth2 Authentication Guide](https://api.dvidshub.net/docs/authentication)
- [DoD Visual Information Style Guide](https://www.dimoc.mil/)
## Support
For issues related to the DVIDS API itself, please contact [[email protected]](mailto:[email protected]). For issues with this PHP client library, please open an issue on the repository.