Api
Titel
Old | New | ||
---|---|---|---|
1 | 1 | Api |
Permalink
Old | New | ||
---|---|---|---|
1 | 1 | api |
Inhalt
Old | New | ||
---|---|---|---|
1 | # LiteCart Public API | ||
1 | 2 | ||
3 | The official website and add-ons store have a public API currently | ||
4 | offering read-only access to resources using REST and JSON. | ||
5 | |||
6 | Make a HTTP request to the following URLs: | ||
7 | |||
8 | \^ Method \^ Endpoint \^ Pagination \^ Search Filter \^ Limit \^ | GET | ||
9 | | | Yes | - | Yes | | GET | ||
10 | | | - | - | - | ||
11 | | | GET | | Yes | Yes | Yes | ||
12 | | | GET | | - | - | ||
13 | | - | | ||
14 | |||
15 | ## Search Filter | ||
16 | |||
17 | Endpoints supporting search filter uses a HTTP GET query parameter like | ||
18 | the following: | ||
19 | |||
20 | [https://](https://)...?query=my+search+string | ||
21 | |||
22 | ## Limit Results | ||
23 | |||
24 | Results can be limited to a desired number. | ||
25 | |||
26 | [https://](https://)...?limit=10 | ||
27 | |||
28 | ## Pagination | ||
29 | |||
30 | Endpoints supporting pagination will return a header like the following: | ||
31 | |||
32 | Link: ; rel=first, ; rel=prev, ; rel=next,; rel=last | ||
33 | |||
34 | You can extract a pagination link using regular expressions: | ||
35 | |||
36 | if (preg_match('#; rel="?next"?#m', $headers, $matches)) { | ||
37 | $next_link = $matches[1]; | ||
38 | } |
Bearbeitet von %benutzer am %datum um %zeit