{"id":13616411,"url":"https://github.com/Streamlike/php-api-sdk","last_synced_at":"2025-04-14T00:32:15.078Z","repository":{"id":57060385,"uuid":"123588703","full_name":"Streamlike/php-api-sdk","owner":"Streamlike","description":null,"archived":false,"fork":false,"pushed_at":"2021-04-20T12:47:18.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-29T00:57:55.226Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.streamlike.eu","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Streamlike.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-02T14:25:20.000Z","updated_at":"2022-06-21T08:35:31.000Z","dependencies_parsed_at":"2022-08-24T14:53:31.797Z","dependency_job_id":null,"html_url":"https://github.com/Streamlike/php-api-sdk","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Streamlike%2Fphp-api-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Streamlike%2Fphp-api-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Streamlike%2Fphp-api-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Streamlike%2Fphp-api-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Streamlike","download_url":"https://codeload.github.com/Streamlike/php-api-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223612022,"owners_count":17173564,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-01T20:01:28.190Z","updated_at":"2024-11-08T00:31:32.562Z","avatar_url":"https://github.com/Streamlike.png","language":"PHP","readme":"# Streamlike PHP API SDK\n\n## Requirements\n\nPHP needs to be a minimum version of PHP 5.4.0.\n\n## Installation\n\nDownload package and include Sdk.php classe.\n\nOr with composer:\n\n`composer require streamlike/php-api-sdk`\n\n## Samples\n\n### Autoloading\n\n```php\n\u003c?php\n\n// via composer autoload\nrequire './vendor/autoload.php';\n\n// or basic require\nrequire './src/Streamlike/Api/Sdk.php';\n```\n\n### Authentication - Get a session token\n\n```php\n\u003c?php\n\n$login = 'myStreamlikeLogin';\n$password = 'myStreamlikePassword';\n\n$sdk = new \\Streamlike\\Api\\Sdk();\ntry {\n    $result = $sdk-\u003eauthenticate($login, $password);\n\n    $sessionToken = $result['token'];\n\n    var_dump($sessionToken);\n} catch (\\Exception $e) {\n    if ($e instanceof Streamlike\\Api\\Exception\\InvalidInputException) {\n        print_r($e-\u003egetErrors());\n    }\n}\n```\n\n### GET medias list\n\n```php\n\u003c?php\n\n$sdk = new \\Streamlike\\Api\\Sdk($sessionToken);\ntry {\n    $result = $sdk-\u003ecall('medias');\n\n    var_dump($result);\n} catch (\\Exception $e) {\n    // handle errors\n}\n\n```\n\n### POST a new media\n\n```php\n\u003c?php\n\n$sdk = new \\Streamlike\\Api\\Sdk($sessionToken);\ntry {\n    $data = [\n        'name' =\u003e 'via sdk',\n        'permalink' =\u003e 'via-sdk',\n        'type' =\u003e 'video',\n        'visibility' =\u003e [\n            'state' =\u003e 'online',\n        ],\n    ];\n\n    $files = [\n        'source' =\u003e [\n            'encode' =\u003e [\n                'media_file' =\u003e '/path/to/video/file',\n            ],\n        ],\n    ];\n\n    $result = $sdk-\u003ecall('medias', 'POST', $data, $files);\n} catch (\\Exception $e) {\n    if ($e instanceof Streamlike\\Api\\Exception\\InvalidInputException) {\n        print_r($e-\u003egetErrors());\n    }\n}\n```\n\n## Running tests\n\nDo a `git clone` on the Github repository:\n\n```\ngit clone git@github.com:Streamlike/php-api-sdk.git streamlike-api\ncd streamlike-api\n```\n\nInstall dependencies using composer:\n\n```\ncomposer install\n```\n\nRun tests:\n\n```\nphp vendor/bin/atoum -d tests\n```\n","funding_links":[],"categories":["PHP"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStreamlike%2Fphp-api-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FStreamlike%2Fphp-api-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStreamlike%2Fphp-api-sdk/lists"}