{"id":20884919,"url":"https://github.com/opensource-socialnetwork/extendapi","last_synced_at":"2025-06-23T19:08:04.138Z","repository":{"id":84226836,"uuid":"173610425","full_name":"opensource-socialnetwork/ExtendAPI","owner":"opensource-socialnetwork","description":"A example to utilize the OSSN RESTful API,  it extends the existing API feature and add custom method to system","archived":false,"fork":false,"pushed_at":"2023-09-20T15:41:13.000Z","size":7,"stargazers_count":8,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-12T18:47:08.109Z","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/opensource-socialnetwork.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-03T18:00:22.000Z","updated_at":"2025-02-15T10:57:32.000Z","dependencies_parsed_at":"2024-11-18T08:12:00.664Z","dependency_job_id":"25aade1a-96c5-49ec-9d51-1b70f46f4252","html_url":"https://github.com/opensource-socialnetwork/ExtendAPI","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/opensource-socialnetwork/ExtendAPI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensource-socialnetwork%2FExtendAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensource-socialnetwork%2FExtendAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensource-socialnetwork%2FExtendAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensource-socialnetwork%2FExtendAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opensource-socialnetwork","download_url":"https://codeload.github.com/opensource-socialnetwork/ExtendAPI/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensource-socialnetwork%2FExtendAPI/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261539317,"owners_count":23174136,"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-11-18T08:11:56.912Z","updated_at":"2025-06-23T19:07:59.077Z","avatar_url":"https://github.com/opensource-socialnetwork.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExtendAPI\nA example to utilize the OSSN RESTful API,  it extends the existing API feature and add custom method to system\nThis component add custom api method (my_custom_end_point) that can be called following way :\n\n    CURL https://www.mywebsite.com/api/v1.0/my_custom_end_point?api_key_token=\u003cmy_api_key_token\u003e\n\nThe output is simply the comparing two static variables and display api response.\n\nYou can edit this component and add more methods by simply adding below in function `my_custom_end_point_register` in file components/ExtendAPI/ossn_com.php\n\n    $methods['v1.0'][] = 'custom_method_second';\n\nOnce you added you need to create a file in `components/ExtendAPI/plugins/default/services/v1.0/custom_method_second.php`\n\n## Set success and error response\n\nTo set success response use following :\n\n    $params['OssnServices']-\u003esuccessResponse(\"My message for success goes here\");\t\n\nFor error:\n\n    $params['OssnServices']-\u003ethrowError('200', \"Error response here\"); //don't change 200 error code,  in case you want to have own error code , you may change it with your own custom error code.\n    \n    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensource-socialnetwork%2Fextendapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopensource-socialnetwork%2Fextendapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensource-socialnetwork%2Fextendapi/lists"}