{"id":28453881,"url":"https://github.com/concretecms/community_api_client","last_synced_at":"2025-06-28T05:31:20.678Z","repository":{"id":50918055,"uuid":"368944077","full_name":"concretecms/community_api_client","owner":"concretecms","description":null,"archived":false,"fork":false,"pushed_at":"2022-05-19T01:21:20.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-06T18:53:02.942Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/concretecms.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":"2021-05-19T17:06:52.000Z","updated_at":"2022-05-19T01:21:23.000Z","dependencies_parsed_at":"2022-08-27T05:12:44.227Z","dependency_job_id":null,"html_url":"https://github.com/concretecms/community_api_client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/concretecms/community_api_client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concretecms%2Fcommunity_api_client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concretecms%2Fcommunity_api_client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concretecms%2Fcommunity_api_client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concretecms%2Fcommunity_api_client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/concretecms","download_url":"https://codeload.github.com/concretecms/community_api_client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concretecms%2Fcommunity_api_client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262381262,"owners_count":23302203,"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":"2025-06-06T18:40:06.115Z","updated_at":"2025-06-28T05:31:20.672Z","avatar_url":"https://github.com/concretecms.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Community Api Client\n\nThis is the official api client that is used to communicate with the community site.\n\nCurrently the functionality is very limited but it get's extended soon.\n\nYou can use the api client to assign achievements.\n\n## Requirements\n\n- PHP 7.1\n- Can only run within Concrete CMS context\n\n## Installation\n\nThe Community API client can be installed using Composer.\n\nComposer\nTo install run `composer require concrete5/community_api_client`\n\n## Configuration\n\nThere is no interface for configure the api client. However there are multiple options to do that.\n\n### Option 1: Programmatically\n\nIf you want to setup the credentials programmatically you can do so like this:\n\n```php\nuse Concrete\\Core\\Support\\Facade\\Application;\nuse PortlandLabs\\CommunityApiClient\\ApiClient;\n\n/** @var ApiClient $apiClient */\n$apiClient = $app-\u003emake(ApiClient::class);\n$apiClient\n    -\u003esetEndpoint(\"your_endpoint\")\n    -\u003esetClientId(\"your_client_id\")\n    -\u003esetClientSecret(\"your_client_secret\");\n```\n\n### Option 2: With a configuration file\n\nYou can also take use of an configuration file.\n\nAll you need to do is creating a file located at `application/config/community_api_client.php` with the following content:\n\n```php\n\u003c?php\nreturn [\n    'endpoint' =\u003e 'your_endpoint',\n    'client_id' =\u003e 'your_client_id',\n    'client_secret' =\u003e 'your_client_secret'\n];\n\n```\n\n### Option 3: With the Concrete CMS CLI application\n\nYou can also take use of the cli application to configure the api client.\n\n```shell script\nconcrete/bin/concrete5 c5:config set community_api_client.endpoint your_endpoint\nconcrete/bin/concrete5 c5:config set community_api_client.client_id your_client_id\nconcrete/bin/concrete5 c5:config set community_api_client.client_secret your_client_secret\n```\n\n### Option 4: With environment variables\n\nYou can also setup the credentials with environment variables. The following variables are used.\n\n```\nAPI_COMMUNITY_ENDPOINT\nAPI_COMMUNITY_CLIENT_ID\nAPI_COMMUNITY_CLIENT_SECRET\n```\n\nIf environment variables are configured the concrete CMS configuration will be ignored. \n\n## Usage\n\nAfter you have configured the endpoint you can communicate with the api interface.\n\nThe following code snippet demonstrates you how to deal with it.\n\n```php\nuse Concrete\\Core\\Support\\Facade\\Application;\nuse PortlandLabs\\CommunityApiClient\\Models\\Achievements;\n\n$app = Application::getFacadeApplication();\n/** @var Achievements $achievements */\n$achievements = $app-\u003emake(Achievements::class);\n$success = $achievements-\u003eassign(\"test_handle\");\n```\n\nCurrently there is now api documentation available. So if you want to know what functionality is available you need to take a look at the models folder within this repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconcretecms%2Fcommunity_api_client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconcretecms%2Fcommunity_api_client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconcretecms%2Fcommunity_api_client/lists"}