-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
560 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Zen | ||
|
||
GET /api/v1/zen | ||
|
||
## Description | ||
|
||
Returns an IT Joke. This endpoint is used to test the connectivity of the API. | ||
|
||
## Parameters | ||
|
||
## Return format | ||
|
||
A JSON Object filled with: | ||
|
||
* joke — The joke | ||
|
||
## Errors | ||
|
||
|
||
## Example | ||
|
||
### **Request** | ||
|
||
``` json | ||
|
||
GET /api/v1/zen | ||
``` | ||
|
||
### **Return** | ||
|
||
``` json | ||
{ | ||
joke: "Waiting for the joke. It' comming ...." | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Entity Resource | ||
|
||
GET /entities | ||
|
||
## Description | ||
|
||
Returns a listing of all entities. | ||
|
||
## Parameters | ||
|
||
None | ||
|
||
## Return format | ||
|
||
A JSON Object filled an array of entity following the **[entity format][]**. | ||
|
||
## Errors | ||
|
||
None | ||
|
||
## Example | ||
|
||
### **Request** | ||
|
||
``` json | ||
|
||
GET /entities | ||
``` | ||
|
||
### **Return** | ||
|
||
``` json | ||
[ | ||
{ | ||
id: 12, | ||
name: "osoc17", | ||
url: "entities_osoc17", | ||
image: "http://2017.summerofcode.be/images/squarelogo-LI.png", | ||
created_at: "2017-07-16 16:04:10", | ||
updated_at: "2017-07-19 20:21:34" | ||
}, | ||
{ | ||
id: 23, | ||
name: "crypto blockchain", | ||
url: "entities-crypto-blockchain", | ||
image: null, | ||
created_at: "2017-07-01 16:35:18", | ||
updated_at: "2017-07-13 09:21:57" | ||
} | ||
] | ||
``` | ||
|
||
[entity format]: ../../formats.md#short-format-entity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Entity Resource | ||
|
||
GET /entities/{id} | ||
|
||
## Description | ||
|
||
Returns a specified **[entity format][]**. | ||
|
||
## Parameters | ||
|
||
- **id** — [integer] The id of the specified **[entity format][]**. | ||
|
||
|
||
## Return format | ||
|
||
A JSON Object filled with an entity following the **[entity format][]**. | ||
|
||
## Errors | ||
|
||
All errors return an HTTP error response with a JSON Object as keys ``message`` about the error, ``request.method`` the method of the received request, ``request.path`` the path used to send the request, ``request.input`` an array containing the parameters sent. | ||
|
||
- **404 Not Found** — An Entity with the specified ID does not exist. | ||
|
||
## Example | ||
|
||
### **Request** | ||
|
||
``` json | ||
GET /entities/12 | ||
``` | ||
|
||
### **Return** | ||
|
||
``` json | ||
{ | ||
id: 12, | ||
name: "osoc17", | ||
url: "entities_osoc17", | ||
image: "http://2017.summerofcode.be/images/squarelogo-LI.png", | ||
created_at: "2017-07-16 16:04:10", | ||
updated_at: "2017-07-19 20:21:34" | ||
} | ||
|
||
``` | ||
|
||
### **Wrong Request** | ||
|
||
``` json | ||
GET /entities/abc | ||
``` | ||
|
||
### **Error Response** | ||
|
||
``` json | ||
{ | ||
message: "The requested object is not valid", | ||
request: { | ||
method: "GET", | ||
path: "api/v1/entities/abc", | ||
parameters: [ ] | ||
}, | ||
data: [ ] | ||
} | ||
``` | ||
|
||
|
||
[entity format]: ../../formats.md#short-format-entity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
# Resources Format | ||
|
||
This document details all resources retrievable via the API. | ||
|
||
## Base | ||
|
||
All request for the API must be prefix by ``/api/v1``. | ||
|
||
|
||
## Error Format | ||
|
||
All errors return an HTTP error response with a JSON Object as keys ``message`` about the error, ``request.method`` the method of the received request, ``request.path`` the path used to send the request, ``request.input`` an array containing the parameters sent. | ||
|
||
``` json | ||
{ | ||
message: "The requested object is not valid", | ||
request: { | ||
method: "GET", | ||
path: "api/v1/handle/lorem-ipsum", | ||
parameters: [ ] | ||
}, | ||
data: [ ] | ||
} | ||
``` | ||
|
||
## Default Service | ||
|
||
List of the default service available. | ||
|
||
|ID | Name| Link | Logo |Color | ||
---|----|-------|-------|-------- | ||
|1 | Facebook| https://facebook.com| none| Blue | ||
|2 | Twitter | https://twitter.com| none| Cyan | ||
|3 | Youtube | https://youtube.com| none| Red | ||
|4 | Google+ | https://plus.google.com | none | White | ||
|5 | Instagram|https://instagram.com| none| Gray | ||
|
||
|
||
## User format | ||
|
||
A User is | ||
|
||
The format of a User object includes the following data: | ||
|
||
- **id** — [integer] ID of the user. | ||
- **email** — [string] The email of the user. | ||
- **fullname** — [string] The surname and/or lastname of the user. | ||
- **username** — [string] The username of the user. | ||
- **type** — [enum(admin,**visitor**)] The username of the user. | ||
|
||
## Entity format | ||
|
||
A Entity is | ||
|
||
The format of a Entity object includes the following data: | ||
|
||
- **id** — [integer] ID of the entity, | ||
- **name** — [string] Name of the entity | ||
- **url** — [string] URL of the entity | ||
- **image** — [string] The visual represention of the entity. Upload or fetched from the | ||
- **created_at** — [timestamp] Timestamp of time of entity creation | ||
- **updated_at** — [timestamp] Timestamp of time of entity last update. | ||
|
||
## Handle format | ||
|
||
A Handle is | ||
|
||
The format of a Handle object includes the following data: | ||
|
||
- **id** — [integer] ID of the handle, | ||
- **name** — [string] Name of the handle | ||
- **url** — [string] URL of the handle | ||
- **created_at** — [timestamp] Timestamp of time of handle' creation | ||
- **updated_at** — [timestamp] Timestamp of time of handle' last update. | ||
- **fetched_at** — [timestamp] Timestamp of time of handle' last fetch. | ||
- **is_fetching** — [bit] Timestamp of time of handle last update. | ||
- **entity_id** — [integer] The ID of the attached **[Entity][]**. | ||
- **service_id** — [integer] The ID of the attached **[Service][]**: | ||
- **provider_id** — [integer] The ID of the attached **[Provider][]**: | ||
|
||
## Service format | ||
|
||
A Service is | ||
|
||
The format of a Service object includes the following data: | ||
|
||
- **id** — [integer] ID of the service. | ||
- **name** — [string] Name of the service. | ||
- **link** — [string] The link to website of the service. | ||
- **logo** — [string] The Link of the representing' logo of the service. | ||
- **color** — [string] The color assigned to this service for the rending. | ||
- **created_at** — [timestamp] Timestamp of time of service creation | ||
|
||
## Provider format | ||
|
||
A Provider is | ||
|
||
The format of a Provider object includes the following data: | ||
|
||
- **id** — [integer] ID of the provider. | ||
- **social_id** — [string] The ID assigned on the social media | ||
- **email** — [string] The email of the user. | ||
- **fullname** — [string] The surname and/or lastname of the user. | ||
- **username** — [string] The username of the user. | ||
|
||
## Fetcher format | ||
|
||
A Fetcher is | ||
|
||
The format of a Fetcher object includes the following data: | ||
|
||
- **id** — [integer] ID of the provider. | ||
- **data** — [json] The Data of the | ||
- **handle_id** — [integer] The ID of the attached **[Handle][]**. | ||
|
||
|
||
|
||
|
||
[entity]:[entity-format] | ||
[service]:[service-format] | ||
[handle]:[handle-format] | ||
[provider]:[provider-format] | ||
|
||
[Category]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#categories | ||
[gallery kind]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#gallery-kinds | ||
[License type]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#license_types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Entity Resource | ||
|
||
GET /entities/{url} | ||
|
||
## Description | ||
|
||
Returns a specified **[entity format][]**. | ||
|
||
## Parameters | ||
|
||
- **URL** — [string] The URL of the specified **[entity format][]**. | ||
|
||
|
||
## Return format | ||
|
||
A JSON Object filled with an entity following the **[entity format][]**. | ||
|
||
## Errors | ||
|
||
All errors return an HTTP error response with a JSON Object as keys ``message`` about the error, ``request.method`` the method of the received request, ``request.path`` the path used to send the request, ``request.input`` an array containing the parameters sent. | ||
|
||
- **404 Not Found** — An Entity with the specified URL does not exist. | ||
|
||
## Example | ||
|
||
### **Request** | ||
|
||
``` json | ||
GET /entities/entities_osoc17 | ||
``` | ||
|
||
### **Return** | ||
|
||
``` json | ||
{ | ||
id: 12, | ||
name: "osoc17", | ||
url: "entities_osoc17", | ||
image: "http://2017.summerofcode.be/images/squarelogo-LI.png", | ||
created_at: "2017-07-16 16:04:10", | ||
updated_at: "2017-07-19 20:21:34" | ||
} | ||
|
||
``` | ||
|
||
### **Wrong Request** | ||
|
||
``` json | ||
GET /entities/lorem-ipsum | ||
``` | ||
|
||
### **Error Response** | ||
|
||
``` json | ||
{ | ||
message: "The requested object is not valid", | ||
request: { | ||
method: "GET", | ||
path: "api/v1/entities/lorem-ipsum", | ||
parameters: [ ] | ||
}, | ||
data: [ ] | ||
} | ||
``` | ||
|
||
|
||
[entity format]: ../../formats.md#short-format-entity |
Oops, something went wrong.