{"id":25171815,"url":"https://github.com/basemax/jokegoserviceapi","last_synced_at":"2026-02-13T20:39:15.662Z","repository":{"id":187346757,"uuid":"649293580","full_name":"BaseMax/JokeGoServiceAPI","owner":"BaseMax","description":"Welcome to the Joke Service RESTful API! This API allows you to manage a collection of jokes, including adding new jokes, editing existing jokes, deleting jokes, rating jokes, and retrieving a list of all jokes with pagination and sorting options.","archived":false,"fork":false,"pushed_at":"2025-11-20T04:19:27.000Z","size":80,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-20T06:11:18.773Z","etag":null,"topics":["api","api-go","go","go-api","joke","joke-service","joke-webservice","jokes-api","restful","restful-api","web-service","webservice"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BaseMax.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null}},"created_at":"2023-06-04T12:05:32.000Z","updated_at":"2025-11-20T04:19:24.000Z","dependencies_parsed_at":"2023-08-10T00:40:23.910Z","dependency_job_id":"26919007-8605-41d5-83b6-f55c9893dab9","html_url":"https://github.com/BaseMax/JokeGoServiceAPI","commit_stats":{"total_commits":3,"total_committers":3,"mean_commits":1.0,"dds":0.6666666666666667,"last_synced_commit":"571cc740861d11a9fa98bfe239dd1ec4adbbb99f"},"previous_names":["basemax/jokegoserviceapi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BaseMax/JokeGoServiceAPI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FJokeGoServiceAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FJokeGoServiceAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FJokeGoServiceAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FJokeGoServiceAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaseMax","download_url":"https://codeload.github.com/BaseMax/JokeGoServiceAPI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FJokeGoServiceAPI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29417689,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["api","api-go","go","go-api","joke","joke-service","joke-webservice","jokes-api","restful","restful-api","web-service","webservice"],"created_at":"2025-02-09T09:22:11.744Z","updated_at":"2026-02-13T20:39:15.642Z","avatar_url":"https://github.com/BaseMax.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Joke Go Service API\n\nWelcome to the Joke Service RESTful API! This API allows you to manage a collection of jokes, including adding new jokes, editing existing jokes, deleting jokes, rating jokes, and retrieving a list of all jokes with pagination and sorting options.\n\n## Routes\n\n- Register user: `POST /register`\n\nThis endpoint register user and retrieve JWT token.\n\n- Login user: `POST /login`\n\nThis endpoint login user and retrieve JWT token.\n\n- Refresh token: `POST /refresh`\n\nThis endpoint refresh user JWT token and retrieve new token.\n\n- Get a Single Joke: `GET /jokes/{joke_id}`\n\nThis endpoint allows you to retrieve a specific joke by its ID.\n\n- Search for Jokes: `GET /jokes/search?query={search_query}`\n\nThis endpoint enables searching for jokes based on a search query. It returns a list of jokes that match the search query.\n\n- Get Random Joke: `GET /jokes/random`\n\nThis endpoint retrieves a random joke from the collection.\n\n- Get Top Rated Jokes: `GET /jokes/top-rated?limit={limit}`\n\nThis endpoint returns a list of the top-rated jokes, sorted by the highest rating. The limit parameter specifies the maximum number of jokes to retrieve.\n\n- Get Jokes by Author: `GET /jokes/authors/{author_name}`\n\nThis endpoint retrieves a list of jokes by a specific author. It returns all jokes authored by the given author name.\n\n- Add a Comment to a Joke: `POST /jokes/{joke_id}/comments`\n\nThis endpoint allows users to add a new comment to a specific joke.\n\n- Edit a Comment: `PUT /jokes/{joke_id}/comments/{comment_id}`\n\nThis endpoint allows users to edit a comment on a specific joke.\n\n- Delete a Comment: `DELETE /jokes/{joke_id}/comments/{comment_id}`\n\nThis endpoint allows users to delete a comment from a specific joke.\n\n- Get All Comments of a Joke: `GET /jokes/{joke_id}/comments`\n\nThis endpoint retrieves all comments associated with a specific joke.\n\n## API Endpoints\n\n### Register user\n```\nPOST /register\n```\n\nThis endpoint register user and retrieve JWT token.\n\n**Request**\n```json\n{\n  \"username\": \"username\",\n  \"password\": \"password\"\n}\n```\n\n**Response**\n```json\n{\n  \"bearer\": \"JWT token\"\n}\n```\n\n### Login user\n```\nPOST /login\n```\n\nThis endpoint login user and retrieve JWT token.\n\n**Request**\n```json\n{\n  \"username\": \"username\",\n  \"password\": \"password\"\n}\n```\n\n**Response**\n```json\n{\n  \"bearer\": \"JWT token\"\n}\n```\n\n### Refresh token\n```\nPOST /refresh\n```\n\nThis endpoint refresh user JWT token and retrieve new token.\n\n**Request**\n```json\n{\n  \"username\": \"username\",\n  \"password\": \"password\"\n}\n```\n\n**Response**\n```json\n{\n  \"bearer\": \"JWT token\"\n}\n```\n### Add a New Joke\n```\nPOST /jokes\n```\n\nThis endpoint allows you to add a new joke to the collection.\n\n**Request**\n```json\n{\n  \"content\": \"The joke content goes here\",\n  \"author\": \"Author Name\"\n}\n```\n\n**Response**\n```json\n{\n  \"id\": \"unique_joke_id\",\n  \"content\": \"The joke content goes here\",\n  \"author\": \"Author Name\",\n  \"rating\": 0\n}\n```\n\n### Edit a Joke\n```\nPUT /jokes/{joke_id}\n```\n\nThis endpoint allows you to edit an existing joke.\n\n**Request**\n\n```json\n{\n  \"content\": \"Updated joke content\",\n  \"author\": \"Updated Author Name\"\n}\n```\n\n**Response**\n\n```json\n{\n  \"id\": \"unique_joke_id\",\n  \"content\": \"Updated joke content\",\n  \"author\": \"Updated Author Name\",\n  \"rating\": 0\n}\n```\n\n### Delete a Joke\n```\nDELETE /jokes/{joke_id}\n```\n\nThis endpoint allows you to delete a joke from the collection.\n\n**Response**\n\n```\n204 No Content\n```\n\n### Rate a Joke\n```\nPOST /jokes/{joke_id}/rating\n```\n\nThis endpoint allows you to rate a joke on a scale of 1 to 5.\n\n**Request**\n\n```json\n{\n  \"rating\": 4\n}\n```\n\n**Response**\n\n```json\n{\n  \"id\": \"unique_joke_id\",\n  \"content\": \"The joke content goes here\",\n  \"author\": \"Author Name\",\n  \"rating\": 4\n}\n```\n\n### Get a Single Joke\n```\nGET /jokes/{joke_id}\n```\n\nThis endpoint allows you to retrieve a specific joke by its ID.\n\n**Response**\n```json\n{\n  \"id\": \"unique_joke_id\",\n  \"content\": \"The joke content goes here\",\n  \"author\": \"Author Name\",\n  \"rating\": 0\n}\n```\n\n### Get a List of Jokes\n```\nGET /jokes?limit={limit}\u0026page={page}\u0026sort={sort_order}\n```\n\nThis endpoint retrieves a paginated list of jokes with optional sorting.\n\n**Parameters**\n\n- `limit` (optional, default: 10): The maximum number of jokes to return per page.\n- `page` (optional, default: 1): The page number to retrieve.\n- `sort` (optional, default: \"latest\"): The sort order for the jokes. Possible values are \"latest\" (newest first) and \"rating\" (highest rating first).\n\n**Response**\n\n```json\n{\n  \"total\": 100,\n  \"page\": 1,\n  \"limit\": 10,\n  \"sort\": \"latest\",\n  \"jokes\": [\n    {\n      \"id\": \"unique_joke_id\",\n      \"content\": \"The joke content goes here\",\n      \"author\": \"Author Name\",\n      \"rating\": 4\n    },\n    // More jokes...\n  ]\n}\n```\n\n**Pagination**\n\nThe API supports pagination to retrieve jokes in chunks. You can control the number of jokes per page using the limit parameter and navigate through pages using the page parameter.\n\n**Sorting**\n\nThe API provides sorting options to order the list of jokes. Use the sort parameter with the values \"latest\" to sort by the newest first or \"rating\" to sort by the highest rating first.\n\n### Get Random Joke\n```\nGET /jokes/random\n```\n\nThis endpoint retrieves a random joke from the collection.\n\n**Response**\n```json\n{\n  \"id\": \"unique_joke_id\",\n  \"content\": \"The joke content goes here\",\n  \"author\": \"Author Name\",\n  \"rating\": 0\n}\n```\n\n### Get Top Rated Jokes\n```\nGET /jokes/top-rated?limit={limit}\n```\n\nThis endpoint returns a list of the top-rated jokes, sorted by the highest rating. The limit parameter specifies the maximum number of jokes to retrieve.\n\n**Response**\n```json\n{\n  \"limit\": 10,\n  \"jokes\": [\n    {\n      \"id\": \"unique_joke_id\",\n      \"content\": \"The joke content goes here\",\n      \"author\": \"Author Name\",\n      \"rating\": 4\n    },\n    // More jokes...\n  ]\n}\n```\n\n### Get Jokes by Author\n```\nGET /jokes/authors/{author_name}?limit={limit}\u0026page={page}\u0026sort={sort_order}\n```\n\nThis endpoint retrieves a list of jokes by a specific author. It returns all jokes authored by the given author name.\n\n**Response**\n```json\n{\n  \"total\": 100,\n  \"page\": 1,\n  \"limit\": 10,\n  \"sort\": \"latest\",\n  \"jokes\": [\n    {\n      \"id\": \"unique_joke_id\",\n      \"content\": \"The joke content goes here\",\n      \"author\": \"Author Name\",\n      \"rating\": 4\n    },\n    // More jokes...\n  ]\n}\n```\n### Add a new comment\n```\nPOST /jokes/{joke_id}/comments\n```\n\nThis endpoint allows users to add a new comment to a specific joke.\n\n**request**\n\n```json\n{\n  \"content\": \"Comment content\"\n}\n```\n\n**response**\n\n```json\n{\n  \"id\": \"unique_comment_id\",\n  \"content\": \"Comment content\",\n  \"author\": \"Author name\"\n}\n```\n\n### Edit a Comment\n```\nPUT /jokes/{joke_id}/comments/{comment_id}\n```\n\nThis endpoint allows users to edit a comment on a specific joke.\n\n**request**\n\n```json\n{\n  \"content\": \"Updated comment content\",\n  \"author\": \"Updated author name\"\n}\n```\n\n**response**\n\n```json\n{\n  \"id\": \"unique_comment_id\",\n  \"content\": \"Updated comment content\",\n  \"author\": \"Updated author name\"\n}\n```\n\n### Delete a Comment\n```\nDELETE /jokes/{joke_id}/comments/{comment_id}\n```\n\nThis endpoint allows users to delete a comment from a specific joke.\n\n**response**\n\n```json\n204 No Content\n```\n\n### Get All Comments of a Joke\n```\nGET /jokes/{joke_id}/comments\n```\n\nThis endpoint retrieves all comments associated with a specific joke.\n\n**response**\n\n```json\n{\n  \"total\": 20,\n  \"comments\": [\n    {\n      \"id\": \"unique_comment_id\",\n      \"content\": \"Comment Content\",\n      \"author\": \"Author Name\"\n    },\n    // More comments...\n  ]\n}\n```\n\nCopyright 2023, Max Base\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fjokegoserviceapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasemax%2Fjokegoserviceapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fjokegoserviceapi/lists"}