René's URL Explorer Experiment


Title: [API Request]: /api/search to return url to result · Issue #3080 · BookStackApp/BookStack · GitHub

Open Graph Title: [API Request]: /api/search to return url to result · Issue #3080 · BookStackApp/BookStack

X Title: [API Request]: /api/search to return url to result · Issue #3080 · BookStackApp/BookStack

Description: API Endpoint or Feature Thanks for adding /api/search endpoint :) One attribute that this endpoint doesn't return is a url which is directly linkable - it seems as an API consumer I need to do additional business logic/API calls to get a...

Open Graph Description: API Endpoint or Feature Thanks for adding /api/search endpoint :) One attribute that this endpoint doesn't return is a url which is directly linkable - it seems as an API consumer I need to do addi...

X Description: API Endpoint or Feature Thanks for adding /api/search endpoint :) One attribute that this endpoint doesn't return is a url which is directly linkable - it seems as an API consumer I need to do ...

Opengraph URL: https://github.com/BookStackApp/BookStack/issues/3080

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[API Request]: /api/search to return url to result","articleBody":"### API Endpoint or Feature\n\nThanks for adding `/api/search` endpoint :) One attribute that this endpoint doesn't return is a url which is directly linkable - it seems as an API consumer I need to do additional business logic/API calls to get a URL to be able to link to the result.\n\n### Use-Case\n\nI have an external system which displays related bookstack results by querying on a tag, I want to just display a list of search results in the external system and directly link to them using a single API call (and ideally not get into the internal details of bookstack pages/chapters/shelves etc)\r\n\r\ni.e.\r\n```\r\n $resp = $client->get(\"https://bookstack/api/search?query=[Tagname={$tagvalue}]\");\r\n $response = json_decode($resp->getBody());\r\n foreach  ($response->data as $result) {\r\n        $o.=\"\u003cli>\u003ca target='_blank' href='{$result->url}'>{$result->name}\u003c/a>\u003c/li>\\n\";        \r\n }   \r\n```\n\n### Additional context\n\nI quickly hacked in this locally with the following patch - if this approach is valid, i'd be happy to update tests etc and prepare a pull request. \r\n```\r\ndiff --git a/app/Http/Controllers/Api/SearchApiController.php b/app/Http/Controllers/Api/SearchApiController.php\r\nindex ba960b9d..0a9d2df1 100644\r\n--- a/app/Http/Controllers/Api/SearchApiController.php\r\n+++ b/app/Http/Controllers/Api/SearchApiController.php\r\n@@ -52,9 +52,10 @@ class SearchApiController extends ApiController\r\n                 'id', 'name', 'slug', 'book_id',\r\n                 'chapter_id', 'draft', 'template',\r\n                 'created_at', 'updated_at',\r\n-                'tags', 'type',\r\n+                'tags', 'type', 'url',\r\n             ]);\r\n             $result->setAttribute('type', $result->getType());\r\n+            $result->setAttribute('url', $result->getURL());\r\n         }\r\n \r\n         return response()->json([\r\n```","author":{"url":"https://github.com/danpoltawski","@type":"Person","name":"danpoltawski"},"datePublished":"2021-11-26T07:12:34Z","url":"https://github.com/BookStackApp/BookStack/issues/3080"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:7c2c51cb-cdfd-5b04-4247-4f1a45c0cfa3
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id92E4:2ADB95:905ABA:CF2715:6AFD88F1
html-safe-nonce8c707c233359bc307b9cb2b3fe8231f00e1293b03a57006fd82f8a8cc3dd7e94
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MkU0OjJBREI5NTo5MDVBQkE6Q0YyNzE1OjZBRkQ4OEYxIiwidmlzaXRvcl9pZCI6IjE4NzEzMzcwNTI0NjE0MzUxMjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac88addf287a319cae495c47bae38c2aeb8cb78bf2ef16eee7dfb2f023ccc93b2c
hovercard-subject-tagissue:1064166141
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/BookStackApp/BookStack/3080/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ee7a03737a228c0f68ca6e187e62ba295c361edd9227dfe6181fa7ae9de71eb5/BookStackApp/BookStack/issues/3080
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ee7a03737a228c0f68ca6e187e62ba295c361edd9227dfe6181fa7ae9de71eb5/BookStackApp/BookStack/issues/3080
og:image:altAPI Endpoint or Feature Thanks for adding /api/search endpoint :) One attribute that this endpoint doesn't return is a url which is directly linkable - it seems as an API consumer I need to do addi...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedanpoltawski
hostnamegithub.com
expected-hostnamegithub.com
Nonebc86424ef34a73b386237872800e922d149d65ba907f63d6f150a2dcb8433bea
turbo-cache-controlno-preview
go-importgithub.com/BookStackApp/BookStack git https://github.com/BookStackApp/BookStack.git
octolytics-dimension-user_id20912696
octolytics-dimension-user_loginBookStackApp
octolytics-dimension-repository_id41589337
octolytics-dimension-repository_nwoBookStackApp/BookStack
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id41589337
octolytics-dimension-repository_network_root_nwoBookStackApp/BookStack
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release927a6c5ab1c32b38830f1b9d3050c0b9e9aa92e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/BookStackApp/BookStack/issues/3080#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FBookStackApp%2FBookStack%2Fissues%2F3080
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FBookStackApp%2FBookStack%2Fissues%2F3080
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=BookStackApp%2FBookStack
Reloadhttps://github.com/BookStackApp/BookStack/issues/3080
Reloadhttps://github.com/BookStackApp/BookStack/issues/3080
Reloadhttps://github.com/BookStackApp/BookStack/issues/3080
BookStackApphttps://github.com/BookStackApp
BookStackhttps://github.com/BookStackApp/BookStack
Codehttps://github.com/BookStackApp/BookStack
Issueshttps://github.com/BookStackApp/BookStack/issues
Pull requests3 (3)https://github.com/BookStackApp/BookStack/pulls
Security and quality8 (8)https://github.com/BookStackApp/BookStack/security
Insightshttps://github.com/BookStackApp/BookStack/insights
https://github.com/BookStackApp/BookStack
New issuehttps://github.com/login?return_to=https://github.com/BookStackApp/BookStack/issues/3080
New issuehttps://github.com/login?return_to=https://github.com/BookStackApp/BookStack/issues/3080
[API Request]: /api/search to return url to resulthttps://github.com/BookStackApp/BookStack/issues/3080#top
🔩 API Requesthttps://github.com/BookStackApp/BookStack/issues?q=state%3Aopen%20label%3A%22%3Anut_and_bolt%3A%20API%20Request%22
v21.11.3https://github.com/BookStackApp/BookStack/milestone/85
https://github.com/danpoltawski
danpoltawskihttps://github.com/danpoltawski
on Nov 26, 2021https://github.com/BookStackApp/BookStack/issues/3080#issue-1064166141
danpoltawskihttps://github.com/danpoltawski
🔩 API Requesthttps://github.com/BookStackApp/BookStack/issues?q=state%3Aopen%20label%3A%22%3Anut_and_bolt%3A%20API%20Request%22
on Nov 26, 2021https://github.com/BookStackApp/BookStack/issues/3080#event-5675967480
https://github.com/ssddanbrown
ssddanbrownhttps://github.com/ssddanbrown
on Nov 26, 2021https://github.com/BookStackApp/BookStack/issues/3080#issuecomment-979997187
@danpoltawskihttps://github.com/danpoltawski
https://github.com/BookStackApp/BookStack/blob/master/dev/api/responses/search-all.jsonhttps://github.com/BookStackApp/BookStack/blob/master/dev/api/responses/search-all.json
ssddanbrownhttps://github.com/ssddanbrown
v21.11.3https://github.com/BookStackApp/BookStack/milestone/85
on Dec 6, 2021https://github.com/BookStackApp/BookStack/issues/3080#event-5723173485
ssddanbrownhttps://github.com/ssddanbrown
on Dec 6, 2021https://github.com/BookStackApp/BookStack/issues/3080#event-5723222063
Added url and preview_html params to search API resultshttps://github.com/BookStackApp/BookStack/commit/b22dd3cb88335b362fdc5989e818829798d6658b
b22dd3chttps://github.com/BookStackApp/BookStack/commit/b22dd3cb88335b362fdc5989e818829798d6658b
https://github.com/ssddanbrown
ssddanbrownhttps://github.com/ssddanbrown
on Dec 6, 2021https://github.com/BookStackApp/BookStack/issues/3080#issuecomment-987193490
#3096https://github.com/BookStackApp/BookStack/issues/3096
b22dd3chttps://github.com/BookStackApp/BookStack/commit/b22dd3cb88335b362fdc5989e818829798d6658b
ssddanbrownhttps://github.com/ssddanbrown
completedhttps://github.com/BookStackApp/BookStack/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Dec 6, 2021https://github.com/BookStackApp/BookStack/issues/3080#event-5723229224
https://github.com/danpoltawski
danpoltawskihttps://github.com/danpoltawski
on Dec 6, 2021https://github.com/BookStackApp/BookStack/issues/3080#issuecomment-987270353
Sign up for freehttps://github.com/signup?return_to=https://github.com/BookStackApp/BookStack/issues/3080
Sign in to commenthttps://github.com/login?return_to=https://github.com/BookStackApp/BookStack/issues/3080
🔩 API Requesthttps://github.com/BookStackApp/BookStack/issues?q=state%3Aopen%20label%3A%22%3Anut_and_bolt%3A%20API%20Request%22
v21.11.3https://github.com/BookStackApp/BookStack/milestone/85
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.