{"id":36253127,"url":"https://github.com/mr-pixel-kg/mrpixcloudprint-sdk","last_synced_at":"2026-01-11T07:02:45.002Z","repository":{"id":42854753,"uuid":"303671474","full_name":"mr-pixel-kg/mrpixcloudprint-sdk","owner":"mr-pixel-kg","description":"This is the official PHP library to use the mpXcloudprint services.","archived":false,"fork":false,"pushed_at":"2025-04-08T15:39:34.000Z","size":101,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-08T15:46:28.728Z","etag":null,"topics":["cloudprint","library","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mr-pixel-kg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-13T10:48:43.000Z","updated_at":"2025-01-14T12:39:21.000Z","dependencies_parsed_at":"2024-04-02T17:53:48.699Z","dependency_job_id":"045a45f1-66b5-4664-b64e-116e830b9527","html_url":"https://github.com/mr-pixel-kg/mrpixcloudprint-sdk","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/mr-pixel-kg/mrpixcloudprint-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mr-pixel-kg%2Fmrpixcloudprint-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mr-pixel-kg%2Fmrpixcloudprint-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mr-pixel-kg%2Fmrpixcloudprint-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mr-pixel-kg%2Fmrpixcloudprint-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mr-pixel-kg","download_url":"https://codeload.github.com/mr-pixel-kg/mrpixcloudprint-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mr-pixel-kg%2Fmrpixcloudprint-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28296941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T04:44:51.577Z","status":"ssl_error","status_checked_at":"2026-01-11T04:44:44.232Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudprint","library","php"],"created_at":"2026-01-11T07:02:44.920Z","updated_at":"2026-01-11T07:02:44.994Z","avatar_url":"https://github.com/mr-pixel-kg.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MrpixCloudPrint SDK\n\n![Version](https://img.shields.io/github/v/release/mr-pixel-kg/mrpixcloudprint-sdk?display_name=tag\u0026sort=semver)\n![Test](https://github.com/mr-pixel-kg/mrpixcloudprint-sdk/actions/workflows/test.yml/badge.svg)\n![Code Size](https://shields.io/github/languages/code-size/mr-pixel-kg/mrpixcloudprint-sdk)\n![Downloads](https://img.shields.io/packagist/dt/mrpix/cloudprintsdk)\n![License](https://img.shields.io/github/license/mr-pixel-kg/mrpixcloudprint-sdk)\n\nThis is the official PHP SDK of mr. pixel's CloudPrint service. This library contains methods to easily interact with the\nmpXcloudprint API. Below is a short instruction with some examples to get started with this SDK. For additional \ninformation, please visit our official documentation.\n\n## Installation\nThis library is not dependent to any http client like Guzzle. You can use any http client hat supports the \n[php-http/client-implementation](https://packagist.org/providers/php-http/client-implementation).\n\nTo get started quickly, install the cloudprint-sdk along with your favourite http client like Guzzle or Symfony Http Client:\n```\ncomposer require mrpix/cloudprintsdk symfony/http-client\n```\n\n## Usage\nThis project depends on Composer. It is recommended to let the Composer autoloader automatically load all your \ndependencies. The example below will show you how to include the client for the mpXcloudprint API.\n\n```php\nrequire 'vendor/autoload.php';\nuse Mrpix\\CloudPrintSDK\\HttpClient\\CloudPrintClient;\n\n$client = new CloudPrintClient();\n```\n### Authentication\nSome actions require you to be authenticated. There are three options you can use for authentication.\n\n1. **Provide login credentials to CloudPrintClient constructor**\n\n    The first option is to provide your login credentials when constructing the CloudPrintClient.\n    To do this you have to hand over the username in the first argument and the password in the \n    second argument.\n    \n    ```php\n    // Load credentials from config\n    $username = 'your-username@example.com';\n    $password = 'yourSecretPassword';\n    \n    $client = new CloudPrintClient($username, $password);\n    ```\n   \n   However, using hardcoded login credentials is not secure. This method is perfect if you want to load credentials \n   dynamically from some configuration. For static credentials, the recommended way is to use environment variables.\n\n2. **Environment Variables**\n\n    If you don't provide your login credentials in the first option, the cloudprint SDK looks for environment variables.\n    You can provide your credentials in the following environment variables:\n    \n    ```\n    MRPIX_CLOUDPRINT_USERNAME=your-username@example.com\n    MRPIX_CLOUDPRINT_PASSWORD=yourSecretPassword\n    ```\n\n3. **Explicit login**\n\n    The third option is to login with your credentials only if authentication is required.\n    To do this, you have to call the login method before sending requests.\n    Here is a example on how to do that:\n    \n    ```php\n    $client-\u003elogin('your-username@example.com', 'yourSecretPassword');\n    ```\n\nNote: If the login credentials are not correct, the server will return a 401 or 403 response for all requests.\n\n#### Test login credentials\nTo test if login credentials are correct, you can use the following example:\n\n```php\nif($client-\u003echeckLoginCredentials('your-username@example.com', 'yourSecretPassword'))\n{\n    echo 'Login successful!';\n} else {\n    echo 'Login failed!';\n}\n```\n\n### Insert a new printjob\nThe following section explains how to create a new printjob. It is recommended to create a new instance of an instruction.\nThe request can be build by using the 'build' method of the instruction. By compiling the request, all given data will be \nautomatically parsed to the required format by the API.\n\n#### Template\nThe following example can be used to create a new printjob based on a pre-defined template:\n\n```php\n$instruction = new InsertTemplatePrintJobInstruction(\n    'Printername', \n    'Templatename',\n    [\n        'variable_key'=\u003e'variable_value'\n    ]\n);\n$request = $instruction-\u003ebuildRequest();\n\ntry {\n    $client-\u003esend($request);\n} catch (ServerException $e) {\n    // In case of an error\n    echo 'Error '.$e-\u003egetStatusCode().\": \".$e-\u003egetMessage();\n}\n```\n\n#### Document\nIf you do not want to use a template, you can upload a whole document. To do that, you can use the following code:\n\n```php\n$instruction = new InsertDocumentPrintJobInstruction(\n    'Printername', \n    'This is the content of the document', \n    'nameOfTheFile.stm', \n    MediaTypes::TEXT_VND_STAR_MARKUP\n);\n$request = $instruction-\u003ebuildRequest();\n\ntry {\n    $client-\u003esend($request);\n} catch (ServerException $e) {\n    // In case of an error\n    echo 'Error '.$e-\u003egetStatusCode().\": \".$e-\u003egetMessage();\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmr-pixel-kg%2Fmrpixcloudprint-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmr-pixel-kg%2Fmrpixcloudprint-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmr-pixel-kg%2Fmrpixcloudprint-sdk/lists"}