{"id":21890908,"url":"https://github.com/statikbe/php-udb-helpers","last_synced_at":"2025-03-22T03:11:59.646Z","repository":{"id":71544941,"uuid":"585516130","full_name":"statikbe/php-udb-helpers","owner":"statikbe","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-07T12:58:26.000Z","size":39,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2025-03-07T13:05:34.788Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/statikbe.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":"2023-01-05T11:21:04.000Z","updated_at":"2025-03-07T12:58:23.000Z","dependencies_parsed_at":"2025-01-26T21:36:41.104Z","dependency_job_id":"c3bb5a5b-48ab-4fa0-bc05-63f7e69374c4","html_url":"https://github.com/statikbe/php-udb-helpers","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statikbe%2Fphp-udb-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statikbe%2Fphp-udb-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statikbe%2Fphp-udb-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statikbe%2Fphp-udb-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/statikbe","download_url":"https://codeload.github.com/statikbe/php-udb-helpers/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244898458,"owners_count":20528341,"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-28T12:18:14.582Z","updated_at":"2025-03-22T03:11:59.640Z","avatar_url":"https://github.com/statikbe.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UDB Helpers for PHP\n\n\n## Installation\n\nFirst, install the package through composer:\n\n````php\ncomposer require statikbe/udb-helpers\n````\n\nThen you can instanciate the EntryAPI class with the following parameters:\n\n`````php\nuse statikbe\\udb\\EntryAPI;\nuse statikbe\\udb\\Environments;\n\n$udb = new EntryAPI(\n    getenv(\"UDB_KEY\"), // API key\n    '/var/www/path/to/your/jwt/token.json', // Path to where you're JWT token will be stored\n    Environments::PROD // The package includes an enum for that sets endpoints based in environment\n);\n\n`````\n\n\n## Authentication\n\nTo authenticate with UDB, you'll need a JWT token. The url from which you get that token can be generate with the following command:\n\n````php\n$url = $udb-\u003eapi-\u003egeneralJwtUrl();\necho $url; \nexit;\n````\n\nThe code above will echo a URL. Paste that URL in a browser window, then you'll be prompted to log in with your UiT-ID.\nAfter logging in you'll see a blank screen with \"An internal server error occurred\". \n\n**You can find the access token and the refresh token in the url of that page.**\n\nSave both tokens in the json file the specified above, formatted like this:\n\n````json\n{\n  \"accessToken\": \"\",\n  \"refreshToken\": \"\"\n}\n````\n\n## Usage\n\nOnce you've authenticated with the API, you can use the following functions:\n\n\n### Searching for places\n````php\n$udb-\u003esearchPlaces([]);\n````\nThe function takes on array of potential search parameters, those can be found [here](https://docs.publiq.be/docs/uitdatabank/search-api/reference/operations/list-places)\n\n\n### Get all details for a specific place\n````php\n$udb-\u003egetPlace($placeId);\n````\n\n### Create a place\nThe data passed should be an array, with fields that match the [place model](https://docs.publiq.be/docs/uitdatabank/entry-api/reference/operations/create-a-place).\n````php\n$udb-\u003ecreatePlace($data);\n````\n\n\n---\n\n### Searching for Organizers\n````php\n$udb-\u003esearchOrganizers([]);\n````\nThe function takes on array of potential search parameters, those can be found [here](https://docs.publiq.be/docs/uitdatabank/search-api/reference/operations/list-organizers)\n\n\n### Get all details for a specific organizer\n````php\n$udb-\u003egetOrganizer($organizerId);\n````\n\n### Create an organizer\nThe data passed should be an array, with fields that match the [organizer model](https://docs.publiq.be/docs/uitdatabank/entry-api/reference/operations/create-a-organizer).\n````php\n$udb-\u003ecreateOrganizer($data);\n````\n\n---\n\n### Create an event\nThe data passed should be an array, with fields that match the [event model](https://docs.publiq.be/docs/uitdatabank/entry-api/reference/operations/create-a-event).\n````php\n$udb-\u003ecreateEvent($data);\n````\n\n### Update an event\nThe data passed should be an array, with fields that match the [event model](https://docs.publiq.be/docs/uitdatabank/entry-api/reference/operations/update-a-event).\n````php\n$udb-\u003eupdateEvent($eventId, $data);\n````\n\n### Update the workflowStatus of an event\nThe data passed should be an array, with fields that match the [workflowStatus model](https://docs.publiq.be/docs/uitdatabank/entry-api/reference/operations/update-a-event-workflow-status).\n````php\n$udb-\u003eupdateWorkflowStatus($eventId, $data);\n````\n\n### Update the workflowStatus of a place\nThe data passed should be an array, with fields that match the [workflowStatus model](https://docs.publiq.be/docs/uitdatabank/entry-api/reference/operations/update-a-place-workflow-status).\n````php\n$udb-\u003eupdatePlaceWorkflowStatus($eventId, $data);\n````\n\n// More to be added as we further develop this package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatikbe%2Fphp-udb-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstatikbe%2Fphp-udb-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatikbe%2Fphp-udb-helpers/lists"}