{"id":20779266,"url":"https://github.com/bolt/jsonaccess","last_synced_at":"2025-04-30T19:42:06.085Z","repository":{"id":20677407,"uuid":"23960329","full_name":"bolt/jsonaccess","owner":"bolt","description":"JSONAccess","archived":false,"fork":false,"pushed_at":"2015-08-29T13:59:29.000Z","size":174,"stargazers_count":8,"open_issues_count":5,"forks_count":11,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-30T19:22:13.244Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bolt.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}},"created_at":"2014-09-12T12:48:21.000Z","updated_at":"2017-12-19T15:10:36.000Z","dependencies_parsed_at":"2022-07-21T20:18:11.720Z","dependency_job_id":null,"html_url":"https://github.com/bolt/jsonaccess","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bolt%2Fjsonaccess","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bolt%2Fjsonaccess/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bolt%2Fjsonaccess/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bolt%2Fjsonaccess/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bolt","download_url":"https://codeload.github.com/bolt/jsonaccess/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251771428,"owners_count":21641259,"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-17T13:26:58.101Z","updated_at":"2025-04-30T19:42:06.061Z","avatar_url":"https://github.com/bolt.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"JSONAccess\n==========\n\nProvides simple JSON access to Bolt's internal data structures.\n\nWhat it does\n------------\n\nEnabling this extension adds routes to the application that serves content as\nJSON rather than HTML. This route defaults to `/json`, so if, for example, you\nhave a content type named 'entries', then the entry with ID 1 is available\nunder `/json/entries/1`.\n\nConfiguration\n-------------\n\nIn order to enable JSON serving for any content type, it has to be added to the\nextension's configuration file, located at `app/config/extensions/jsonaccess.bolt.yml`.\n\nSee the provided `config.yml.dist` for an example configuration with a brief\nexplanation.\n\nNote in particular that content types that you don't mention in the\nconfiguration file won't be served by the JSONAccess extension.\n\nCalls\n-----\n\nJSONAccess implements RESTful semantics for all calls, mapping resources as\nfollows:\n\n- `/json/{contenttype}` returns a list of records of the specified contenttype.\n  The default is to return all items in the same order that the front-end uses.\n  The listing contains the 'id' of every record, as well as a configurable\n  selection of fields (defaulting to all configurable fields, but none of the\n  'meta' fields Bolt introduces itself). The list of fields can be overridden in\n  the JSONAccess extension's `config.yml` file.\n- `/json/{contenttype}/{id}` returns one record of the specified contenttype,\n  including *all* fields.\n- `/json/{contenttype}/{id}/{relatedContenttype}` returns a list of records of\n  the specified related contenttype. The data format is the same as in\n  `/json/{contenttype}/`\n\nAdvanced listing\n----------------\n\nThe list call accepts some extra parameters (in the form of query string\nparameters appended to the URL):\n\n- `?order={fieldname}` and `?order={fieldname} {ordering}` - Order the list by\n  the specified field. Only one field is currently supported. The `ordering`\n  must be one of `ASC` or `DESC`.\n- `?limit={limit}` - specify the number of items to return.\n- `?page={page}` - to be combined with `limit`: get the n-th page. This is\n  1-based, so `1` designates the first page.\n\nSo for example `/json/pages?order=title\u0026limit=10\u0026page=2` sorts all Pages by\ntitle and returns entries 11 through 20 (inclusive).\n\nSending headers\n---------------\n\nTo work correctly with other tools that _read_ the JSON generated by Bolt and\nthis extension, it might be necessary to set the correct headers with the\nresponse. By default, this extension sets the following:\n\n```YML\nheaders:\n    'Access-Control-Allow-Origin': '*'\n    'Content-Type': 'application/json'\n```\n\nYou can define additional headers as required, or tweak the existing ones.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbolt%2Fjsonaccess","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbolt%2Fjsonaccess","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbolt%2Fjsonaccess/lists"}