PageSourceSearch

https://docs.phpvms.net/assets/js/65df3d35.a5a79555.js

js phpvms.net collected 2026-10-04 13:25:37 UTC 5,584 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkphpvms_docs=self.webpackChunkphpvms_docs||[]).push([[8559],{98895(e,n,i){i.r(n),i.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>c,frontMatter:()=>a,metadata:()=>t,toc:()=>l});const t=JSON.parse('{"id":"api/overview","title":"Overview","description":"phpvms includes a REST API that can be used for retrieving or saving","source":"@site/docs/api/overview.md","sourceDirName":"api","slug":"/api/overview","permalink":"/8.x/api/overview","draft":false,"unlisted":false,"editUrl":"https://github.com/phpvms/docs/tree/master/docs/api/overview.md","tags":[],"version":"current","frontMatter":{"id":"overview","title":"Overview"},"sidebar":"docs","previous":{"title":"Awards","permalink":"/8.x/developers/awards"},"next":{"title":"Authentication","permalink":"/8.x/api/auth"}}');var r=i(74848),s=i(28453);const a={id:"overview",title:"Overview"},o=void 0,d={},l=[{value:"Pagination",id:"pagination",level:2},{value:"Rate Limiting",id:"rate-limiting",level:2},{value:"Response Code",id:"response-code",level:3},{value:"Response Headers",id:"response-headers",level:3},{value:"More Information",id:"more-information",level:3},{value:"Errors",id:"errors",level:2},{value:"Unauthorized",id:"unauthorized",level:3},{value:"Not Found",id:"not-found",level:3},{value:"Validation Errors",id:"validation-errors",level:3}];function h(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.p,{children:"phpvms includes a REST API that can be used for retrieving or saving\ninformation."}),"\n",(0,r.jsx)(n.h2,{id:"pagination",children:"Pagination"}),"\n",(0,r.jsx)(n.p,{children:"Where indicated, pagination is enabled/available. When calling those APIs, the\ndata is returned in this format:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"data"})," contains a list of all of the objects (for example, the airports)"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"links"})," contains the links to navigate through the paginated list"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"meta"})," contains information about the current dataset"]}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-json",children:'{\n  "data": [ ... ],\n  "links": {\n    "first":"http://phpvms.test/api/airports?page=1",\n    "last":"http://phpvms.test/api/airports?page=3",\n    "prev":null,\n    "next":"http://phpvms.test/api/airports?page=2"\n  },\n  "meta": {\n    "current_page": 1,\n    "from":1,\n    "last_page":3,\n    "path":"http://phpvms.test/api/airports",\n    "per_page":50,\n    "to":50,\n    "total":120\n  }\n}\n'})}),"\n",(0,r.jsx)(n.h2,{id:"rate-limiting",children:"Rate Limiting"}),"\n",(0,r.jsx)(n.p,{children:"Laravel's API Middleware includes a rate limiter, which, by default, it set to\n60 requests per minute, per-IP."}),"\n",(0,r.jsx)(n.h3,{id:"response-code",children:"Response Code"}),"\n",(0,r.jsxs)(n.p,{children:["If you exceed the throttling, you'll have a ",(0,r.jsx)(n.code,{children:"429 Too Many Requests"})," HTTP\nresponse code. You'll also have a ",(0,r.jsx)(n.code,{children:"Retry-After"})," header included, indicating the\nnumber of seconds to wait:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-http",children:"Retry-After: 60\n"})}),"\n",(0,r.jsx)(n.p,{children:"The below headers will also be included."}),"\n",(0,r.jsx)(n.h3,{id:"response-headers",children:"Response Headers"}),"\n",(0,r.jsx)(n.p,{children:"When a request is made, several headers are returned to show you where you are\nin terms of throttling:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-http",children:"X-RateLimit-Limit: 60\nX-RateLimit-Remaining: 59\n"})}),"\n",(0,r.jsx)(n.h3,{id:"more-information",children:"More Information"}),"\n",(0,r.jsxs)(n.p,{children:["To read some more information about how the throttling works in Laravel,\n",(0,r.jsx)(n.a,{href:"https://mattstauffer.com/blog/api-rate-limiting-in-laravel-5-2/",children:"check out this page"})]}),"\n",(0,r.jsx)(n.h2,{id:"errors",children:"Errors"}),"\n",(0,r.jsx)(n.p,{children:"Where possible, the standard HTTP error codes are followed and returned, with\nextra information in the body, if available."}),"\n",(0,r.jsx)(n.h3,{id:"unauthorized",children:"Unauthorized"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"401"}
1)," is returned if the API key is invalid, or the user is disallowed from API\naccess. The ",(0,r.jsx)(n.code,{children:"message"})," parameter will offer more error."]}),"\n",(0,r.jsx)(n.h3,{id:"not-found",children:"Not Found"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"404"})," is returned if an entity is not found"]}),"\n",(0,r.jsx)(n.h3,{id:"validation-errors",children:"Validation Errors"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"400"}),", with details in the ",(0,r.jsx)(n.code,{children:"message"})," parameter about the bad input."]})]})}function c(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},28453(e,n,i){i.d(n,{R:()=>a,x:()=>o});var t=i(96540);const r={},s=t.createContext(r);function a(e){const n=t.useContext(s);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),t.createElement(s.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.