Download .zip |
Info | Documentation | View files (16) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2017-11-04 (1 month ago) | Not yet rated by the users | Total: 30 This week: 30 | All time: 9,079 This week: 26 |
Version | License | PHP version | Categories | |||
polr-api 2.0.0 | GNU General Publi... | 5 | HTTP, PHP 5, Web services |
Description | Author | |
This package provides an API for the Polr URL shortener service. |
<a name="top"></a>
Restful API for the Polr URL Shortener
<p>Delete the link with the given ending.</p>
DELETE /links/:ending
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | key | String | <p>The user API key.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | message | String | <p>The response message.</p>| | settings | Object | <p>The Polr instance config options.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | AccessDenied | Object | <p>The user does not have permission to delete links.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | NotFound | Object | <p>Unable to find a link with the given ending.</p>|
<p>Fetch a paginated list of links. The input parameters are those of the Datatables library.</p>
GET /links
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | draw | Integer | optional<p>The draw option.</p>| | columns | Object | optional<p>The table columns.</p>| | order | Object | optional<p>The data ordering.</p>| | start | Integer | optional<p>The data offset.</p>| | length | Integer | optional<p>The data count.</p>| | search | Object | optional<p>The search options.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | message | String | <p>The response message.</p>| | settings | Object | <p>The Polr instance config options.</p>| | result | Object | <p>The link list.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | AccessDenied | Object | <p>The user does not have permission to list links.</p>|
<p>Fetch a paginated list of links. The input parameters are those of the Datatables library.</p>
GET /users/me/links
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | draw | Integer | optional<p>The draw option.</p>| | columns | Object | optional<p>The table columns.</p>| | order | Object | optional<p>The data ordering.</p>| | start | Integer | optional<p>The data offset.</p>| | length | Integer | optional<p>The data count.</p>| | search | Object | optional<p>The search options.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | message | String | <p>The response message.</p>| | settings | Object | <p>The Polr instance config options.</p>| | result | Mixed | <p>The link list.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | AccessDenied | Object | <p>The user does not have permission to list links.</p>|
<p>Returns</p>
GET /links/:ending
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | key | String | <p>The user API key.</p>| | secret | String | optional<p>The link secret.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | message | String | <p>The response message.</p>| | settings | Object | <p>The Polr instance config options.</p>| | result | Object | <p>The link data.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | NotFound | Object | <p>Unable to find a link with the given ending.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | AccessDenied | Object | <p>Invalid URL code given for a secret URL.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | MissingParameters | Object | <p>There is a missing or invalid parameter.</p>|
<p>Create a shortened URL for a given link</p>
POST /links
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | key | String | <p>The user API key.</p>| | url | String | <p>The link to shorten.</p>| | ending | String | optional<p>A custom ending for the link.</p>| | secret | String | optional<p>Create a secret link or not.</p>| | ip | String | optional<p>The IP address the request came from.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | message | String | <p>The response message.</p>| | settings | Object | <p>The Polr instance config options.</p>| | result | Mixed | <p>The shortened URL.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | CreationError | Object | <p>An error occurs while shortening the link.</p>| | MissingParameters | Object | <p>There is a missing or invalid parameter.</p>|
<p>Update the link with the given ending.</p>
PUT /links/:ending
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | key | String | <p>The user API key.</p>| | url | String | optional<p>The new URL.</p>| | status | String | optional<p>The status change: enable, disable or toggle.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | message | String | <p>The response message.</p>| | settings | Object | <p>The Polr instance config options.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | AccessDenied | Object | <p>The user does not have permission to edit the link.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | NotFound | Object | <p>Unable to find a link with the given ending.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | MissingParameters | Object | <p>There is a missing or invalid parameter.</p>|
<p>Fetch stats of a given type for a single link.</p>
GET /links/:ending/stats
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | key | String | <p>The user API key.</p>| | type | String | <p>The type of stats to fetch.</p>| | ending | String | <p>The short URL id of the link.</p>| | left_bound | String | <p>The start date.</p>| | right_bound | String | <p>The end date.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | message | String | <p>The response message.</p>| | settings | Object | <p>The Polr instance config options.</p>| | result | Mixed | <p>The stats data.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | AccessDenied | Object | <p>The user does not have permission to view stats.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | AnalyticsError | Object | <p>An error occurs while fetching stats from the database.</p>| | MissingParameters | Object | <p>There is a missing or invalid parameter.</p>|
<p>Fetch stats of a given type.</p>
GET /stats
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | key | String | <p>The user API key.</p>| | type | String | <p>The type of stats to fetch.</p>| | left_bound | String | <p>The start date.</p>| | right_bound | String | <p>The end date.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | message | String | <p>The response message.</p>| | settings | Object | <p>The Polr instance config options.</p>| | result | Mixed | <p>The stats data.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | AccessDenied | Object | <p>The user does not have permission to view stats.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | AnalyticsError | Object | <p>An error occurs while fetching stats from the database.</p>| | MissingParameters | Object | <p>There is a missing or invalid parameter.</p>|
<p>Change the API Settings of the user with the given id.</p>
PUT /users/:id/api
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | key | String | <p>The user API key.</p>| | quota | String | optional<p>The new API quota.</p>| | status | String | optional<p>The API access change: enable, disable or toggle.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | message | String | <p>The response message.</p>| | settings | Object | <p>The Polr instance config options.</p>| | result | Object | <p>The updated user data.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | AccessDenied | Object | <p>The user does not have permission to edit the user.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | NotFound | Object | <p>Unable to find a user with the given id.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | MissingParameters | Object | <p>There is a missing or invalid parameter.</p>|
<p>Generate a new API access key for the user with the given id.</p>
POST /users/:id/api
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | key | String | <p>The user API key.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | message | String | <p>The response message.</p>| | settings | Object | <p>The Polr instance config options.</p>| | result | Mixed | <p>The updated user data.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | AccessDenied | Object | <p>The user does not have permission to edit the user.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | NotFound | Object | <p>Unable to find a user with the given id.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | MissingParameters | Object | <p>There is a missing or invalid parameter.</p>|
<p>Get the user with the given id</p>
GET /users/:id
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | key | String | <p>The user API key.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | message | String | <p>The response message.</p>| | settings | Object | <p>The Polr instance config options.</p>| | result | Object | <p>The user data.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | AccessDenied | Object | <p>The user does not have permission to get users.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | NotFound | Object | <p>Unable to find a user with the given id.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | MissingParameters | Object | <p>There is a missing or invalid parameter.</p>|
<p>Fetch a paginated list of users. The input parameters are those of the Datatables library.</p>
GET /users
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | draw | Integer | optional<p>The draw option.</p>| | columns | Object | optional<p>The table columns.</p>| | order | Object | optional<p>The data ordering.</p>| | start | Integer | optional<p>The data offset.</p>| | length | Integer | optional<p>The data count.</p>| | search | Object | optional<p>The search options.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | message | String | <p>The response message.</p>| | settings | Object | <p>The Polr instance config options.</p>| | result | Object | <p>The user list.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | AccessDenied | Object | <p>The user does not have permission to list users.</p>|
<p>Update the user with the given id.</p>
PUT /users/:id
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | key | String | <p>The user API key.</p>| | role | String | optional<p>The new role.</p>| | status | String | optional<p>The user status change: enable, disable or toggle.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | message | String | <p>The response message.</p>| | settings | Object | <p>The Polr instance config options.</p>| | result | Object | <p>The updated user data.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | AccessDenied | Object | <p>The user does not have permission to edit the user.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | NotFound | Object | <p>Unable to find a user with the given id.</p>|
| Name | Type | Description | |:---------|:-----------|:--------------------------------------| | MissingParameters | Object | <p>There is a missing or invalid parameter.</p>|
Files |
File | Role | Description | ||
---|---|---|---|---|
docs (1 file) | ||||
src (1 file, 2 directories) | ||||
tests (2 files) | ||||
apidoc.json | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
README.md | Doc. | Documentation |
Files | / | src |
File | Role | Description | ||
---|---|---|---|---|
Helpers (3 files) | ||||
Http (1 file, 2 directories) | ||||
PolrApiServiceProvider.php | Class | Class source |
Files | / | src | / | Helpers |
File | Role | Description |
---|---|---|
ResponseHelper.php | Class | Class source |
StatsHelper.php | Class | Class source |
UserHelper.php | Class | Class source |
Files | / | src | / | Http |
File | Role | Description | ||
---|---|---|---|---|
Controllers (3 files) | ||||
Middleware (1 file) | ||||
routes.php | Example | Example script |
Files | / | src | / | Http | / | Controllers |
File | Role | Description |
---|---|---|
LinkController.php | Class | Class source |
StatsController.php | Class | Class source |
UserController.php | Class | Class source |
Files | / | tests |
File | Role | Description |
---|---|---|
ExampleTest.php | Class | Class source |
TestCase.php | Class | Class source |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.