User Tools

Site Tools


api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
api [2020/08/16 17:00]
A User Not Logged in old revision restored (2019/12/11 02:42)
api [2021/07/18 03:50]
tim
Line 1: Line 1:
-====== LiteCart API ======+====== LiteCart Public API ======
  
 The official website and add-ons store have a public API currently offering read-only access to resources using REST and JSON. The official website and add-ons store have a public API currently offering read-only access to resources using REST and JSON.
  
-Make a HTTP GET request for the following URLs:+Make a HTTP request to the following URLs:
  
-^ Endpoint                                   ^ Pagination  ^ Search Filter ^ +^ Method ^ Endpoint                                        ^ Pagination  ^ Search Filter ^ Limit 
-| https://www.litecart.net/api/releases      | Yes         | Yes | +| GET    | https://www.litecart.net/api/releases           | Yes         | -             | Yes   
-| https://www.litecart.net/api/releases/{id} | -           | -   +| GET    | https://www.litecart.net/api/releases/{version} | -           | -             | -     
-| https://www.litecart.net/api/addons        | Yes         | Yes | +| GET    | https://www.litecart.net/api/addons             | Yes         | Yes           | Yes   
-| https://www.litecart.net/api/addons/{id}   | -           | -   |+| GET    | https://www.litecart.net/api/addons/{id}        | -           | -             -     | 
 + 
 +===== Search Filter ===== 
 + 
 +Endpoints supporting search filter uses a HTTP GET query parameter like the following: 
 + 
 +    https://...?query=my+search+string 
 + 
 +===== Limit Results ===== 
 + 
 +Results can be limited to a desired number. 
 + 
 +    https://...?limit=10
  
 ===== Pagination ===== ===== Pagination =====
Line 17: Line 29:
     Link: <https://...?page=1>; rel=first, <https://...?page=1>; rel=prev, <https://...?page=2>; rel=next,<https://...?page=2>; rel=last     Link: <https://...?page=1>; rel=first, <https://...?page=1>; rel=prev, <https://...?page=2>; rel=next,<https://...?page=2>; rel=last
  
-===== Search Filter =====+You can extract a pagination link using regular expressions: 
 + 
 +    if (preg_match('#<(.*?)>; rel="?next"?#m', $headers, $matches)) { 
 +      $next_link $matches[1]; 
 +    }
  
-Endpoints supporting search filter uses a HTTP GET query parameter like the following: 
  
-    https://...?query=my+search+string 
  
api.txt · Last modified: 2021/07/18 03:50 by tim